Closed quantizor closed 2 years ago
@probablyup That's fascinating and the first I've heard of it. I thought &&
just increased the specificity of the selector. Is this something that changed in styled-components or has it always worked this way?
@probablyup That's fascinating and the first I've heard of it. I thought
&&
just increased the specificity of the selector. Is this something that changed in styled-components or has it always worked this way?
It's been troublesome behavior for a bit now. I've been wanting to change the selector for targeting instances to something else so the behavior is more consistent. My thought was &
for static class name and %
for instances...
Yeah I am very suprised, for me it was increasing the specificity not giving a unique className :o
A single ampersand refers to the static component selector which will have unintended effects when the styled-components babel plugin is also used. Double ampersand refers to an instance of the component, e.g. a specific
<x.div>
not ALL<x.div>
.