Closed LowArmour closed 1 year ago
Sorry guys, it always happens like this: I search for a whole day, I don't find anything, then I post an issue. Afterwards, I search for another 5 mins and I find a solution :(.
I have found the solution in a CSS modules issue, which also uses :global(), not svelte or svelte-preprocess: https://github.com/css-modules/css-modules/issues/295
The solution is:
:global {
.child-component-first-class {
color: red;
&.child-component-second-class {
color: green;
}
}
It is also nicer.
Describe the bug
Let's say we have: ChildComponent.svelte
<p class="child-component-first-class child-component-second-class">Hello from child!</p>
and
ParentComponent.svelte
Although it is valid scss language, color: green will not be picked.
Reproduction
I cannot reproduce in REPL, I cannot seem to make scss and/or :global() run there.
Logs
System Info
Severity
annoyance