Closed minzojian closed 1 year ago
we can define a combine screen like this
...
screens: {
mobile: { max: '767px' },
desktop: {
min: '1600px'
},
mobile_desktop:[
{ max: '767px' },
{
min: '1600px'
}],
...
but that is not flexible
so this PR also supported array style screen
below codes are equivalent
css` height: 480px;
${screen`mobile_desktop`}{
height: 120px;
}`,
css` height: 480px;
${screen`mobile,desktop`}{
height: 120px;
}`,
css({
height: '480px',
...screen(['mobile','desktop'])({
height: '120px'
})
}),
all code can generate codes like this
@media (max-width: 767px),(min-width: 1600px ){.css-1c4paup-App{height:120px;}}
Thanks for adding adding this feature - it looks quite useful ๐
I'll pop up some tests and add it to the next release.
Minimum Reproducible Example
https://github.com/minzojian/cra-emotion
basehttps://github.com/ben-rogerson/twin.examples/tree/master/cra-emotion
Issue Details if i set a custom screen define like this
and then define css like this
but after compiled, i got
the correct result should be