Exceptions relating to media queries
See original GitHub issueHi 👋🏼 Super stoked to see a polyfill for this! Thanks for your work 😄
I wanted to try this out on a Docusaurus page for a custom component, but when loading the polyfill, I get the following two errors:
Uncaught DOMException: Element.matches: '@media (min-width: 1440px) ' is not a valid selector cqfill.js:130
Uncaught (in promise) DOMException: Document.querySelectorAll: '@media (min-width: 1440px) ' is not a valid selector cqfill.js:204
I’m not entirely sure what’s going on, but it seems to me that @media[...]
gets picked up as a rule and that it breaks some queries. That said, I may very well be doing something wrong. This happens both in Firefox 96 and in Chrome 97.
Do you have any ideas about what may be going wrong and/or how I can fix it?
Thanks for any input!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top Results From Across the Web
Good practice to write CSS Media Queries - Stack Overflow
I never have to use more than four media query rules, and then put all the needed exceptions for classes, id;s etc inside...
Read more >Using media queries - CSS: Cascading Style Sheets | MDN
Syntax · Media types define the broad category of device for which the media query applies: all , print , screen . ·...
Read more >Media Queries Level 3 - W3C
A media query consists of a media type and zero or more expressions that check for the conditions of particular media features. Among...
Read more >CSS media queries - the new code
At-media queries are conditions in your stylesheet. The style rules they contain are applied only if certain criteria are met, ...
Read more >You Probably Don't Need Media Queries Anymore
If you're still relying primarily on media queries to ensure your site or app is fully responsive, it might be time to take...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This issue should be fixed by the latest version of the polyfill (currently in alpha). Let me know if you run into any further problems and I’d be happy to reopen the issue.
Thank you!
I have the same issue, I am using the last version of the polyfill, v.0.1.2 and I am getting the error -> Document.querySelectorAll: '@media (min-width: 375px) ’ is not a valid selector
I am using React v17.0.2 and NextJS 12.1.0.
I add the import in useEffect inside the _app file