Skip to content

Commit

Permalink
fix one more
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and aarongarciah committed Oct 22, 2024
1 parent 43cd3ea commit 2988c1e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ A big thanks to the 18 contributors who made this release possible.

### Docs

- Add `theme.applyStyles` and migrate docs (#42498) @siriwatknp
- Add `theme.applyStyles()` and migrate docs (#42498) @siriwatknp
- Fix dashboard template console error (#42594) @oliviertassinari
- Migrate system props to `sx` prop (#42475) @siriwatknp
- [material-ui]Fix duplicated sentence (#42521) @alexfauquette
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.old.md
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ This release was mostly about 🐛 bug fixes and 📚 documentation improvements

- [zero-runtime] Use lodash instead of its subpackages (#40868) @michaldudak
- Add `applyStyles()` to theme (#40667) @siriwatknp
- [zero] Use `theme.applyStyles` in the demo app (#40787) @siriwatknp
- [zero] Use `theme.applyStyles()` in the demo app (#40787) @siriwatknp
- [zero] Add `useThemeProps` processor (#40648) @siriwatknp

### `@mui/[email protected]`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ For SSR (server-side rendering) applications, Material UI can not detected user

To prevent the issue, you need to ensure that there is no usage of `theme.palette.mode === 'dark'` in your code base.

If you have such a condition, replace it with the [`theme.applyStyles`](#appling-dark-styles) function:
If you have such a condition, replace it with the [`theme.applyStyles()`](#appling-dark-styles) function:

```diff
import Card from '@mui/material/Card';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ If you want to be able to manually toggle modes, see the guide to [toggling dark

## Applying dark styles

To customize styles for dark mode, use `theme.applyStyles` function.
To customize styles for dark mode, use `theme.applyStyles()` function.
This utility function will return the right selector.

The example below shows how to customize the Card component for dark mode:
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/customization/dark-mode/dark-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ If you are using the `InitColorSchemeScript` component to [prevent SSR flicker](

## Styling in dark mode

Use the `theme.applyStyles` utility to apply styles for a specific mode.
Use the `theme.applyStyles()` utility to apply styles for a specific mode.

We recommend using this function over checking `theme.palette.mode` to switch between styles as it has more benefits:

Expand Down
4 changes: 2 additions & 2 deletions docs/data/material/migration/upgrade-to-v6/upgrade-to-v6.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ See [CSS theme variables](/material-ui/customization/css-theme-variables/overvie

### Color mode theme utility

Material UI v6 introduces a new utility for adding styles to specific color modes called `theme.applyStyles`, designed to replace `theme.palette.mode` when applying light or dark styles:
Material UI v6 introduces a new utility for adding styles to specific color modes called `theme.applyStyles()`, designed to replace `theme.palette.mode` when applying light or dark styles:

```diff
const MyComponent = styled('button')(({ theme }) => ({
Expand All @@ -464,7 +464,7 @@ Material UI v6 introduces a new utility for adding styles to specific color mod
}))
```

Use these codemods to migrate your project to `theme.applyStyles`:
Use these codemods to migrate your project to `theme.applyStyles()`:

```bash
npx @mui/codemod@latest v6.0.0/styled <path/to/folder-or-file>
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/blog/material-ui-v6-is-out.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ It also works with the `sx` prop:

### New method of applying styles

The new API `theme.applyStyles` has been added for creating specific mode styles.
The new API `theme.applyStyles()` has been added for creating specific mode styles.
It's designed to replace the `theme.palette.mode === 'dark'` condition to fix the SSR flickering issue when combined with the CSS theme variables feature.

<codeblock>
Expand Down

0 comments on commit 2988c1e

Please sign in to comment.