Skip to content

Commit

Permalink
[material-next][theme] Move ref palette out of color schemes (#40341)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai authored Dec 29, 2023
1 parent cb3d718 commit bf891fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
13 changes: 2 additions & 11 deletions docs/pages/experiments/md3/buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,8 @@ function DemoComponents() {

// custom MD3 theme
const cssVarsTheme = extendTheme({
colorSchemes: {
light: {
ref: {
palette: customPalette,
},
},
dark: {
ref: {
palette: customPalette,
},
},
ref: {
palette: customPalette,
},
});

Expand Down
4 changes: 1 addition & 3 deletions packages/mui-material-next/src/styles/Theme.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export interface Motion {
export interface MD3CssVarsThemeOptions extends Omit<MD2CssVarsThemeOptions, 'colorSchemes'> {
ref?: {
typeface?: Partial<MD3Typeface>;
palette?: Partial<MD3Palettes>;
};
sys?: {
typescale?: Partial<MD3Typescale>;
Expand All @@ -250,9 +251,6 @@ export interface MD3CssVarsThemeOptions extends Omit<MD2CssVarsThemeOptions, 'co
}

export interface ColorSystemOptions extends MD2ColorSystemOptions {
ref?: {
palette?: Partial<MD3Palettes>;
};
sys?: {
color?: Partial<MD3ColorSchemeTokens>;
elevation?: string[];
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-material-next/src/styles/extendTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function extendTheme(options: CssVarsThemeOptions = {}, ...args:
ref: {
...input.ref,
typeface,
palette: deepmerge(md3CommonPalette, colorSchemesInput.light?.ref?.palette),
palette: deepmerge(md3CommonPalette, input.ref?.palette),
},
sys: {
...input.sys,
Expand Down Expand Up @@ -121,7 +121,7 @@ export default function extendTheme(options: CssVarsThemeOptions = {}, ...args:
ref: {
...input.ref,
typeface,
palette: deepmerge(md3CommonPalette, colorSchemesInput.dark?.ref?.palette),
palette: deepmerge(md3CommonPalette, input.ref?.palette),
},
sys: {
...input.sys,
Expand Down

0 comments on commit bf891fe

Please sign in to comment.