From aa3b261914a873ede6ade244cda5df8812aec71c Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Sun, 2 Oct 2022 12:25:55 +0400 Subject: [PATCH] [docs] Cleanup custom colors declaration logic --- docs/src/docs/theming/colors.mdx | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) 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;