:root { .some-class & { ... } } does not work as expected
See original GitHub issueVersion
2.1.0
Reproduction
https://www.webpackbin.com/bins/-Kn_3D4-c-UzcHsTAZyh
Steps to reproduce
injectGlobal`
:root {
.some-class & {
color: red;
}
}
`
Expected Behavior
Should produce .some-class:root
selector
Actual Behavior
instead of .some-class :root
which does not work as expected. (Old parser was smart enough to remove that space).
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
cannot define pseudo states inside complex selectors · Issue #360 ...
I am trying to put states on some element which is not the root element. Maybe I am doing something wrong, but this...
Read more >How to add "class" to host element? - angular - Stack Overflow
This CSS is defined inside the component and the selector is only applied if the class someClass is set on the host element...
Read more >Root file writing questions - ROOT Forum
Hi Rooters, I have two questions regarding writing in root file. It might be very simple question but I could not find clue....
Read more >Test with Jest and calling public method on component
I have a component that works as expected. ... Custom elements and attributes do not register their view model instances with the root...
Read more >not - CSS-Tricks
The :not() property in CSS is a negation pseudo class and accepts a simple selector or a selector list as an argument.
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
Managed to reproduce, it’s when the namespace value is an empty string –
""
, Which is how i thinkinjectGlobal
uses stylis to process global css.Should be fixed in the next patch release.
sorry, was afk for a bit 😉 yea, we’re passing an empty namespace there, since it’s global css 😃
https://github.com/styled-components/styled-components/blob/master/src/utils/stringifyRules.js#L27