From 7bf3f20dc328d0d59190e3f0a4c6793d2a8d025c Mon Sep 17 00:00:00 2001 From: Geoff Rich Date: Sat, 26 Jun 2021 09:56:10 -0700 Subject: [PATCH] Add docs for compound :global selector (#6271) * Add docs for compound :global selector Co-authored-by: Antony Jones --- site/content/docs/01-component-format.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/site/content/docs/01-component-format.md b/site/content/docs/01-component-format.md index c51b56fcf9..30c53b225f 100644 --- a/site/content/docs/01-component-format.md +++ b/site/content/docs/01-component-format.md @@ -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

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. */ + } ```