Media-queries are not created for the classes declared as functions
- Dominant language
- JavaScript
- Stars
- 7.1k
- Forks
- 386
- PR merge metrics
- No merged PRs in 30d
Description
__Expected behavior:__
When there is a class declared as a function, the media queries related to this class are applied. Hence, here a block with the exampleClass applied should be red on the screens wider than 600px.
```
exampleClass: (props) => ({
color: "white",
backgroundColor: "blue",
width: props.prop1 ? "50%" : "100%",
"@media(min-width:600px)": {
backgroundColor: "red"
}
})
```
__Describe the bug:__
For the classes declared as functions media queries are not applied unless they are declared as functions themselves.

This variant won't work as well.
`
"@media(min-width:600px)": {
exampleClass: {
backgroundColor: "red"
}
}
`
But this one will do.
`
"@media(min-width:600px)": {
exampleClass: () => ({
backgroundColor: "red"
})
}
`

__Reproduction:__
You may check the working reproduction example here - https://codesandbox.io/s/react-jss-bug-report-guijv
__Versions (please complete the following information):__
- jss: 10.7.1
- Browser: Chrome - Version 93.0.4577.82 (Official Build) (x86_64)
- OS: macOS 11.2.3 (20D91)
Contributor guide
Assessment
This issue has not been assessed yet.