diff --git a/documentation/docs/02-template-syntax/05-styles-and-classes.md b/documentation/docs/02-template-syntax/05-styles-and-classes.md index c2c3b7e799..7747cc7133 100644 --- a/documentation/docs/02-template-syntax/05-styles-and-classes.md +++ b/documentation/docs/02-template-syntax/05-styles-and-classes.md @@ -32,24 +32,24 @@ To apply styles to a selector globally, use the `:global(...)` modifier. ```svelte ``` @@ -73,28 +73,22 @@ To apply all styles after a certain point to a selector globally, use the `:glob ```svelte ``` -The difference between `:global` and `:global(...)` is that `:global(...)` only makes all styles within its braces global, whereas `:global` makes all styles coming after it global, including those in nested CSS. - -If `:global` is preceeded by a descendant combinator, the combinator is removed from the output. That means that `div :global.x` is equivalent to `div.svelte-hash.x`. +> The second example above could also be turned into a `.a :global .b .c .d` selector, where everything after the `:global` is unscoped. Both forms are semantically equal, and as such this form is also supported, but the nested form is recommended instead when writing styles. ## Nested style tags