Variable values in @global
- Dominant language
- JavaScript
- Stars
- 7.1k
- Forks
- 386
- PR merge metrics
- No merged PRs in 30d
Description
__Is your feature request related to a problem? Please describe.__
I want to use variables values in @global
but if @global is a function then "Uncaught TypeError: Cannot set property 'fnStyle1587427462315' of null", if fields of @global are functions they are ignored
```
const useStyles = createUseStyles({
'@global': {
'#sntch_block': {
display: () => 'none',
},
},
});
```
__Describe the solution you'd like__
Variables values like already implemented but working inside @global
__Are you willing to implement it?__
Yes if it's simple to do (your code seems so clean and easy to understand)
I have updated from early 10 version to the latest (react-jss and jss 10.1.1, I first only updated react-jss to 10.1.1 and let jss in 10.0.1 which triggers an error "sheet.updateOne" is not a function, you should consider printing a warning when incompatible version are being run together because it is hard otherwise to debug what is wrong). And both of these version have this issue.
Contributor guide
Research direction
Start by reproducing the reported createUseStyles example with an @global rule whose display value is a function, then trace the @global handling that produces the null-property TypeError. Done means variable and function-valued fields work inside @global without the reported error; the issue also mentions incompatible react-jss and jss versions as a separate warning concern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100