styled-jsx
styled-jsx copied to clipboard
Selectors with `:last-child` wrapped on second line generates incorrect styles
With this styles:
<div className="baz">Hi there!</div>
<style jsx>{`
.foo
.bar:last-child
.baz {
color: red;
}
`}
</style>

Hi there!
will become red, even that it shouldnt.
Making the selector into one line fixes it:
<div className="baz">Hi there!</div>
<style jsx>{`
.foo .bar:last-child .baz {
color: red;
}
`}
</style>
Or removing :last-child fixes it too:
<div className="baz">Hi there!</div>
<style jsx>{`
.foo
.bar
.baz {
color: red;
}
`}
</style>
- OS: OSX 10.15.4
- Browser: Latest Chrome
- styled-jsx (version): 3.2.5