Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Oct 1, 2024
1 parent 0153d49 commit 258a94d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/data/material/customization/shadow-dom/shadow-dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ const theme = createTheme({

### 3. CSS theme variables (optional)

If you want to use [CSS theme variables](/material-ui/customization/css-theme-variables/overview/) inside of the shadow DOM, you need to set the selectors for generating the CSS variables:
:::info
If you use **TypeScript**, you need to [extend the interface of the theme](/material-ui/customization/css-theme-variables/usage/#typescript) first.
:::

To use [CSS theme variables](/material-ui/customization/css-theme-variables/overview/) inside of the shadow DOM, you need to set the selectors for generating the CSS variables:

```diff
const theme = createTheme({
Expand All @@ -80,7 +84,7 @@ If you want to use [CSS theme variables](/material-ui/customization/css-theme-va
})
```

Next, use the `shadowRootElement` as the color scheme node for attaching the class:
Finally, set the `colorSchemeNode` prop using `shadowRootElement`, from step 1, as the value:

```diff
<ThemeProvider
Expand Down

0 comments on commit 258a94d

Please sign in to comment.