From a7a19d3cc4f4e51ccd2afa2d993e27b3825c16e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Velarde?= Date: Fri, 28 Oct 2022 19:26:20 +0200 Subject: [PATCH] Add module augmentation for Theme & ThemeOptions --- packages/react-ui/src/theme/carto-theme.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/react-ui/src/theme/carto-theme.d.ts b/packages/react-ui/src/theme/carto-theme.d.ts index 910d7e284..257d703d0 100644 --- a/packages/react-ui/src/theme/carto-theme.d.ts +++ b/packages/react-ui/src/theme/carto-theme.d.ts @@ -78,7 +78,17 @@ 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; @@ -86,7 +96,6 @@ declare module '@mui/material/styles' { code3: React.CSSProperties; } - // allow configuration using `createTheme` interface TypographyVariantsOptions { overlineDelicate?: React.CSSProperties; code1?: React.CSSProperties;