Add docs for compound :global selector (#6271)

* Add docs for compound :global selector

Co-authored-by: Antony Jones <ant@enzy.org>
pull/6454/head
Geoff Rich 3 years ago committed by GitHub
parent 142de015eb
commit 7bf3f20dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -277,6 +277,15 @@ To apply styles to a selector globally, use the `:global(...)` modifier.
to this component */
color: goldenrod;
}
p:global(.red) {
/* this will apply to all <p> elements belonging to this
component with a class of red, even if class="red" does
not initially appear in the markup, and is instead
added at runtime. This is useful when the class
of the element is dynamically applied, for instance
when updating the element's classList property directly. */
}
</style>
```

Loading…
Cancel
Save