Support typings for jss-plugin-nested
See original GitHub issueIs your feature request related to a problem? Please describe.
jss.createStyleSheet({
foo: {
"&:hover": {
background: "blue"
},
}
});
this code can’t pass type check.
Describe the solution you’d like https://github.com/cssinjs/jss/issues/795 I’d thought the first item in this issue(Add typings to the extend plugin and preset default) is about the typings for plugin-nested, but I checked the v10.0.0-alpha.10 and it seems not. Is there any reason that the typings for nested rule is not included in the next release?
Are you willing to implement it? Yes
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
jss-plugin-nested - npm
JSS plugin that enables support for nested selectors. Latest version: 10.9.2, last published: 5 months ago. Start using jss-plugin-nested in ...
Read more >jss-plugin-nested | Yarn - Package Manager
JSS plugin that enables support for nested selectors. cssinjs, css-in-js, css in js, jss ... See our website jss-plugin-nested for more information.
Read more >Pseudo and Nested Selectors - JSS
Pseudo and Nested Selectors · Use & to reference selector of the parent rule · Use $ruleName to reference a local rule within...
Read more >jss-plugin-nested examples - CodeSandbox
Learn how to use jss-plugin-nested by viewing and forking jss-plugin-nested example apps on CodeSandbox.
Read more >Top 5 jss-plugin-nested Code Examples | Snyk
To help you get started, we've selected a few jss-plugin-nested examples, based on popular ways it is used in public projects. ; 'inherit',...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@HenriBeck I think the current type definition is little helpful. It passes type checkings for any style with any possible plugin, but at the same time, it can’t autocomplete any property at all.
I don’t know about function values, observables well. But array value, maybe it’s something like
Is this what you mean? Then I think it can be solved by just introducing JssValue.
It’s just a draft. I didn’t check it worked, But I’m willing to make it better. I think that JssValue should contain every type vanilla jss allows e.g, function, array.
I totally agree with you. But, how about making
Style
generic variable? Honestly, I think it’s the only option we have.Of course, we can offer default
Style
for vanilla js.And as far as I know,
Observable
is plugin-supported just like nested style which I’m asking. But I found they are defined in vanilla jss.Why isn’t there typing for plugin-nested? It seems just a simple inconsistency. If putting every type into vanilla js is hard(I think you considered it not only hard but also wrong, and I agree with you), then seperating into each plugin would be better.
Because the types are now inside
jss
, you should be able to remove@types/jss