Open
Description
Describe the problem
Sometimes, we need to use :global() styles
to modify child components
Otherwise, it would not work.
<div>
<Icon class="extra" />
</div>
<style>
:global(.extra) {
color: red;
}
</style>
Describe the proposed solution
MAGIC value $HASH
$HASH is replaced with the value (for example: svelte-urs9w7) of component hash
The code could look so:
<div>
<Icon class="{$HASH} extra" />
</div>
<style>
.extra {
color: red;
}
</style>
finally - Icon class turn to:
class="svelte-urs9w7 extra"
Alternatives considered
Alternative: do it automatic
Add $HASH to any child component, that use class, defined in style-block
Importance
i cannot use svelte without it