[V.2.0.1] Parent inheritance problem
See original GitHub issuePlease check this: https://codesandbox.io/s/wplNXEN1J
Check .modifier & {
underneath.
This JSX:
<Container>
<div className='modifier'>
<div className='wrapper'>Hello World, this is my first styled component!</div>
</Container>
</div>
const Container = styled.div`
.wrapper {
background-color: green;
.modifier & {
background-color: red;
}
}
`;
Renders this HTML:
<div class="sc-bdVaJa YJEIW">
<div class="modifier">
<div class="wrapper">Hello World, this is my first styled component!</div>
</div>
</div>
The CSS is compiled as:
.sc-bdVaJa {}
.YJEIW .wrapper{background-color: green;}
.wrapper .modifier .YJEIW{background-color: red;}
I think the modifier should be: .YJEIW .modifier .wrapper
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Child inheritance generating InvalidCastException #10446
Issue I am trying to use Table Per Hierarchy inheritance in conjunction with a one to many relationship. Both the Parent and child...
Read more >Avoid wrong version interpolation if child's pom version is ...
There is another pom which declares the parent pom as its parent too (inheritance) but is not listed as sub module in this...
Read more >Analysis on Inheritance in Open Source Systems
When referring to an item that is being inherited by another, the words superclass, parent, and ancestor may be used. The term type...
Read more >Thinking in Java, 3rd ed. Revision 2.0: 1: Introduction to Objects
This is effectively what you get with inheritance, with the exception that if the original class (called the base or super or parent...
Read more >What Programmers do with Inheritance in Java
However, some compilers will write P#parent into the bytecode. As this information is not used in method lookup, the difference does not cause...
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
Hi @philpl It is only to illustrate the issue, not to be a real world example.
@thysultan Great, thanks for the fast fix!
@philpl Just did, can confirm that 2.0.1 with stylis 3.1.6 works. Awesome work!