Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions docs/data/material/experimental-api/pigment-css/pigment-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ Pigment CSS uses the `prefers-color-scheme` media query by default to switch be
```js
const colorScheme = css`
background-color: ${({ theme }) => theme.colorSchemes.dark.colors.background};

color: ${({ theme }) => theme.colorSchemes.dark.colors.foreground};

@media (prefers-color-scheme: light) {
Expand All @@ -299,14 +298,14 @@ const colorScheme = css`

You can also customize the behavior by providing a `getSelector` function:

```js
extendTheme({
colorSchemes: {
light: { ... },
dark: { ... },
},
+ getSelector: (colorScheme) => colorScheme ? `.theme-${colorScheme}` : ':root',
});
```diff
extendTheme({
colorSchemes: {
light: { ... },
dark: { ... },
},
+ getSelector: (colorScheme) => colorScheme ? `.theme-${colorScheme}` : ':root',
});
```

### The sx prop
Expand All @@ -324,7 +323,7 @@ The `sx` prop works with all Material UI components as well as HTML elements an

If you use the `sx` prop on an HTML element, you'll need to augment the `HTMLAttributes` interface:

```js
```ts
type Theme = {
// your theme type
};
Expand All @@ -335,7 +334,9 @@ declare global {
sx?:
| React.CSSProperties
| ((theme: Theme) => React.CSSProperties)
| ReadonlyArray<React.CSSProperties | ((theme: Theme) => React.CSSProperties)>;
| ReadonlyArray<
React.CSSProperties | ((theme: Theme) => React.CSSProperties)
>;
}
}
}
Expand Down