sveltejs / svelte

web development for the rest of us
https://svelte.dev
MIT License
79.75k stars 4.23k forks source link

Svelte 5 won't allow `:global(@page)` #14130

Open ptrxyz opened 2 days ago

ptrxyz commented 2 days ago

Describe the bug

Svelte 5 doesn't seem to like this:

    :global(@page) {
        size: A4;
        margin: 0cm;
        margin-top: 16mm;
        margin-bottom: 16mm;
    }

REPL: https://svelte.dev/playground/e771e2916c484705aa2c144cb6127119?version=5.1.9 (related to this on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/@page)

Reproduction

See code above or REPL link

Logs

No response

System Info

System:
    OS: Linux 6.11 Arch Linux
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 48.31 GB / 62.71 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 23.1.0 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.9.0 - /usr/bin/npm
    pnpm: 9.12.2 - /usr/bin/pnpm
    bun: 1.1.30 - ~/bin/bun
  Browsers:
    Brave Browser: 130.1.71.118
    Chromium: 130.0.6723.69

Severity

blocking an upgrade

Ocean-OS commented 1 day ago

Not entirely sure, but I believe this regex should be changed to fix the bug.