Skip to content

Commit

Permalink
Update files/en-us/web/api/web_components/using_shadow_dom/index.md
Browse files Browse the repository at this point in the history
Co-authored-by: Estelle Weyl <[email protected]>
  • Loading branch information
wbamberg and estelle authored Oct 11, 2023
1 parent 5d4e9a4 commit ad71a19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions files/en-us/web/api/web_components/using_shadow_dom/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ The page CSS does not affect nodes inside the shadow DOM:

To style page elements in the shadow DOM, we can:

- Create an empty {{domxref("CSSStyleSheet")}} object
- Set its content using {{domxref("CSSStyleSheet.replace()")}} or {{domxref("CSSStyleSheet.replaceSync()")}}
- Add it to the shadow root by assigning it to {{domxref("ShadowRoot.adoptedStyleSheets")}}
1. Create an empty {{domxref("CSSStyleSheet")}} object
2. Set its content using {{domxref("CSSStyleSheet.replace()")}} or {{domxref("CSSStyleSheet.replaceSync()")}}
3. Add it to the shadow root by assigning it to {{domxref("ShadowRoot.adoptedStyleSheets")}}

Rules defined in the `CSSStyleSheet` will be scoped to the shadow DOM tree, as well as any other DOM trees to which we have assigned it.

Expand Down

0 comments on commit ad71a19

Please sign in to comment.