diff --git a/docs/src/docs/theming/colors.mdx b/docs/src/docs/theming/colors.mdx index 5d9108b293f..365427701f4 100644 --- a/docs/src/docs/theming/colors.mdx +++ b/docs/src/docs/theming/colors.mdx @@ -124,20 +124,9 @@ separated with `.`, for example `pink.3`: ## Add custom colors types -TypeScript will only autocomplete Mantine's default colors when accessing the theme. To add your custom colors to the MantineColor type, you can use TypeScript module declaration: +TypeScript will only autocomplete Mantine's default colors when accessing the theme. To add your custom colors to the MantineColor type, you can use TypeScript module declaration. ```ts -import { Tuple } from '@mantine/core'; - -type CustomColors = 'primaryColorName' | 'secondaryColorName'; - -declare module '@mantine/core' { - export interface MantineThemeColorsOverride { - colors: Record>; - } -} - -// or if you want to "extend" standard colors import { Tuple, DefaultMantineColor } from '@mantine/core'; type ExtendedCustomColors = 'primaryColorName' | 'secondaryColorName' | DefaultMantineColor;