Skip to content

Commit

Permalink
Add module augmentation for Theme & ThemeOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorVelarde committed Oct 28, 2022
1 parent 08602da commit a7a19d3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/react-ui/src/theme/carto-theme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,24 @@ export type CartoTheme = Modify<
}
>;

// Check https://mui.com/material-ui/customization/theming/#custom-variables
declare module '@mui/material/styles' {
interface Theme {
palette: CustomPalette;
spacingValue: number;
}
// allow configuration using `createTheme`
interface ThemeOptions {
palette?: CustomPalette;
spacingValue?: number;
}
interface TypographyVariants {
overlineDelicate: React.CSSProperties;
code1: React.CSSProperties;
code2: React.CSSProperties;
code3: React.CSSProperties;
}

// allow configuration using `createTheme`
interface TypographyVariantsOptions {
overlineDelicate?: React.CSSProperties;
code1?: React.CSSProperties;
Expand Down

0 comments on commit a7a19d3

Please sign in to comment.