Skip to content

Commit

Permalink
[system][docs] Fix link to createCssVarsProvider (#43661)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Sep 9, 2024
1 parent 82bb4dc commit 903768b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.old.md
Original file line number Diff line number Diff line change
Expand Up @@ -4127,8 +4127,8 @@ A big thanks to the 17 contributors who made this release possible. Here are som

```diff
import {
unstable_createCssVarsProvider as createCssVarsProvider,
+ unstable_createCssVarsTheme as createCssVarsTheme,
unstable_createCssVarsProvider as createCssVarsProvider,
+ unstable_createCssVarsTheme as createCssVarsTheme,
} from '@mui/system';

const { CssVarsProvider } = createCssVarsProvider({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Now, the Button's `backgroundColor`, `borderColor` and text `color` values will
For framework- or language-specific setup instructions, see [CSS theme variables—Usage—Server-side rendering](/material-ui/customization/css-theme-variables/usage/).
For framework or language specific setup, see [this](/material-ui/customization/css-theme-variables/usage/)

See the complete usage of `createCssVarsProvider` in [Material UI](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/styles/CssVarsProvider.tsx) and [Joy UI](https://github.com/mui/material-ui/blob/master/packages/mui-joy/src/styles/CssVarsProvider.tsx).
See the complete usage of `createCssVarsProvider` in [Material UI](https://github.com/mui/material-ui/blob/master/packages/mui-material/src/styles/ThemeProviderWithVars.tsx) and [Joy UI](https://github.com/mui/material-ui/blob/master/packages/mui-joy/src/styles/CssVarsProvider.tsx).

## API

Expand Down
22 changes: 12 additions & 10 deletions packages/mui-material/src/styles/ThemeProviderWithVars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@ let warnedOnce = false;
// TODO: remove in v7
// eslint-disable-next-line @typescript-eslint/naming-convention
function Experimental_CssVarsProvider(props: any) {
if (!warnedOnce) {
console.warn(
[
'MUI: The Experimental_CssVarsProvider component has been ported into ThemeProvider.',
'',
"You should use `import { ThemeProvider } from '@mui/material/styles'` instead.",
'For more details, check out https://mui.com/material-ui/customization/css-theme-variables/usage/',
].join('\n'),
);
if (process.env.NODE_ENV !== 'production') {
if (!warnedOnce) {
console.warn(
[
'MUI: The Experimental_CssVarsProvider component has been ported into ThemeProvider.',
'',
"You should use `import { ThemeProvider } from '@mui/material/styles'` instead.",
'For more details, check out https://mui.com/material-ui/customization/css-theme-variables/usage/',
].join('\n'),
);

warnedOnce = true;
warnedOnce = true;
}
}

return <InternalCssVarsProvider {...props} />;
Expand Down

0 comments on commit 903768b

Please sign in to comment.