-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add note about parens in matchMedia #37504
Conversation
I was bitten by this and didn't find an explicit callout to help developers who might have been in my situation and could not understand why their code wouldn't work.
Preview URLs (comment last updated: 2025-01-23 16:30:40) |
This is misleading though. Anything that needs parentheses in |
@Josh-Cena That's a good point! Do you know what would be a better verbiage to communicate this? |
Taking some notes from the CSS media page: Note Just like in CSS, any media feature must be wrapped in parentheses inside the expression. For example: |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update @chriskirknielsen ! I think the wording here is fine but it doesn't need to be a note.
Co-authored-by: wbamberg <[email protected]>
Thank you @wbamberg, much appreciated! |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. Thanks!
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
Provides a note about explicit requirements for a
matchMedia
condition to be wrapped in parentheses.Motivation
I was bitten by this and didn't find an explicit callout to help developers who might have been in my situation and could not understand why their code wouldn't work.