Emotion: Not closing CSS block when nesting @supports and @media queries

Created on 7 Mar 2018  路  1Comment  路  Source: emotion-js/emotion

  • emotion version: 9.0.2
  • react version: 16.2.0

Relevant code:

const Elem = styled('div')({
  '@media (min-width: 980px)': {
    backgroundColor: 'blue',
    '@supports (width: 100vw)': {
        backgroundColor: 'red'
    }
  }
});

What you did:

I attempted to nest a CSS feature query inside a media query.

What happened:

The generated CSS in the head did not include a closing curly brace for the media-query block.

@media (min-width: 980px) {
    .css-1ihoyw2 {
        background-color:blue;
    }
    @supports (width: 100vw) {
        .css-1ihoyw2 {
            background-color:red;
        }
    }
// } <---- NOT IN GENERATED CSS

Suggested solution:

I'd expected the media-query block to wrap the feature-query block in the generated styled.

bug

Most helpful comment

@mitchellhamilton thanks!

>All comments

@mitchellhamilton thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MrFungusEli picture MrFungusEli  路  3Comments

mitchellhamilton picture mitchellhamilton  路  3Comments

kentcdodds picture kentcdodds  路  3Comments

meebix picture meebix  路  3Comments

rockmandash picture rockmandash  路  3Comments