UNPKG

2.15 kBTypeScriptView Raw
1import * as React from 'react';
2import { SupportedColorScheme } from './createThemeWithVars';
3declare const useColorScheme: () => import("@mui/system").ColorSchemeContextValue<SupportedColorScheme>, deprecatedGetInitColorSchemeScript: typeof import("@mui/system/InitColorSchemeScript").default;
4declare function Experimental_CssVarsProvider(props: any): React.JSX.Element;
5declare const getInitColorSchemeScript: typeof deprecatedGetInitColorSchemeScript;
6/**
7 * TODO: remove this export in v7
8 * @deprecated
9 * The `CssVarsProvider` component has been deprecated and ported into `ThemeProvider`.
10 *
11 * You should use `ThemeProvider` and `createTheme()` instead:
12 *
13 * ```diff
14 * - import { CssVarsProvider, extendTheme } from '@mui/material/styles';
15 * + import { ThemeProvider, createTheme } from '@mui/material/styles';
16 *
17 * - const theme = extendTheme();
18 * + const theme = createTheme({
19 * + cssVariables: true,
20 * + colorSchemes: { light: true, dark: true },
21 * + });
22 *
23 * - <CssVarsProvider theme={theme}>
24 * + <ThemeProvider theme={theme}>
25 * ```
26 *
27 * To see the full documentation, check out https://mui.com/material-ui/customization/css-theme-variables/usage/.
28 */
29export declare const CssVarsProvider: (props: React.PropsWithChildren<Partial<import("@mui/system").CssVarsProviderConfig<SupportedColorScheme>> & {
30 theme?: {
31 cssVariables?: false;
32 cssVarPrefix?: string;
33 colorSchemes: Partial<Record<SupportedColorScheme, any>>;
34 colorSchemeSelector?: "media" | "class" | "data" | string;
35 } | {
36 $$material: {
37 cssVariables?: false;
38 cssVarPrefix?: string;
39 colorSchemes: Partial<Record<SupportedColorScheme, any>>;
40 colorSchemeSelector?: "media" | "class" | "data" | string;
41 };
42 } | undefined;
43 defaultMode?: "light" | "dark" | "system";
44 documentNode?: Document | null;
45 colorSchemeNode?: Element | null;
46 storageWindow?: Window | null;
47 disableNestedContext?: boolean;
48 disableStyleSheetGeneration?: boolean;
49}>) => React.JSX.Element;
50export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };