Extraneous kebab-case warning for media queries
See original GitHub issueemotion
version: @emotion/core@10.0.6react
version: react@16.8.0-alpha.1
Relevant code:
mq.sm = `@media (min-width: 800px)`
<div css={{
[mq.sm]: {
display: 'flex'
}
}}>
What happened:
Error:
Using kebab-case for css properties in objects is not supported. Did you mean @media (minWidth: 800px)?
Problem description: Emotion warns about kebab case on media queries but probably should not. Using a kebab-casing of the original media query ie (minWidth: 800px) does not work as intended.
Suggested solution: Relax the warning for media queries
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Using media queries - CSS: Cascading Style Sheets | MDN
Media queries are case-insensitive. Media types define the broad category of device for which the media query applies: all , print , screen...
Read more >vue 3 emit warning " Extraneous non-emits event listeners"
I am trying to emit data from child to parent using the composition API. I get the following warning.
Read more >CSS masterclass – Media Queries
Media Queries select different style sheets for: different media: print, screen, projection, speech… different media characteristics: width, height, resolution…
Read more >Working with JavaScript Media Queries
matchMedia('(min-width: 768px)') // Check if the media query is true if (mediaQuery.matches) { // Then trigger an alert alert('Media Query ...
Read more >CSS and Javascript media queries
matches) { alert('Large Media Query Matched!') } Finally, we can listen for the changes function handleResizeChange(e) { // Check if the media ...
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 FreeTop 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
Top GitHub Comments
@corysimmons this is a different issue than reported originally here. And the warning you have received is sound - when using object styles you should use camel-cased properties. The same would have been reported for styled elements:
Ah, through the process in trying to create one I found that my media query value was
undefined
which caused the error. ieIf the value is an object, there is no warning. The warning could perhaps be improved but I wouldn’t consider it a bug. Thank you.