-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Labels
cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling
Milestone
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
brunnerh, ToP29, hearsid, groundbirdaircat and reinhard-sanz
Metadata
Metadata
Assignees
Labels
cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling