Skip to content

MediaQuery class does not work with not all ... or multiple conditions #14695

@jjones315

Description

@jjones315

Describe the bug

The new svelte MediaQuery class from svelte/reactivity does not work with media queries with not all or multiple conditions.
For example not all and (min-width: 900px) and (max-width: 599px), (min-width: 900px) are both not working as intended, it appears thats since MediaQuery always wraps the query in parentheses it breaks some queries.

Reproduction

https://svelte.dev/playground/ec93d95e0c63434d9ba67439e4afe011?version=5.11.2

Logs

N/A

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900
    Memory: 13.60 GB / 15.47 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
    pnpm: 9.7.1 - /mnt/c/Users/jjones/AppData/Roaming/npm/pnpm
    bun: 1.1.15 - /mnt/c/Users/jjones/AppData/Roaming/npm/bun

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions