Closed trusktr closed 6 years ago
you can nest at-rules with the jss-nested plugin: http://cssinjs.org/jss-nested?v=v6.0.1#use-at-rules-inside-of-regular-rules
@HenriBeck
Yep, tested it, the example
const style = {
'html': {
[`@media (max-width: ${XS4})`]: {
'& #root, & #header, & #mobileMenu': (`
transform: scale( ${theme.media.scaleXS5} );
width: calc( 100% * 1 / ${theme.media.scaleXS5} );
`),
},
}
}
works.
There isn't any example like that in the docs though. It'd be nice to add an example that shows using &
inside of an @
rule works (currently there are only examples of style properties inside the at-rules).
Is your feature request related to a problem? Please describe.
In Sass we can do
Can we do similar with JSS? I don't see it in the docs.
Describe the solution you'd like
To write something like
so that the nested
&
inside the media query refers to the parenthtml
selector that is outside the media query.