You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
See that the media query doesn't work (not in preview but with real browser window)
Expected behavior
Media query declaration should work.
Describe the bug
I investigated the output CSS with help of LLM and it looks like that the transformation to container query doesn't handle well the CSS that Astro framework generates currently.
[EDIT]
I narrowed down the issue to the postcss-viewport-to-container-toggle 2.0.1 update which actually introduced :where() breaking media queries scoped in Astro components.
Details
The LLM's conclusion was:
Your media queries stopped working because Astro’s scoping compiler introduced :where() wrappers with [data-astro-cid] prefixes applied to the wrong elements (body), which breaks the selector specificity and prevents rules from matching.
So it’s not the @media or @container themselves that are broken — the selectors generated inside them are invalid/unmatchable.
To Reproduce
ncu -u && -rf node_modules && rm package-lock.json && npm install).Expected behavior
Media query declaration should work.
Describe the bug
I investigated the output CSS with help of LLM and it looks like that the transformation to container query doesn't handle well the CSS that Astro framework generates currently.
[EDIT]
I narrowed down the issue to the postcss-viewport-to-container-toggle 2.0.1 update which actually introduced :where() breaking media queries scoped in Astro components.
Details
The LLM's conclusion was: