From 4311f240a44d8f376212b47b698b2d6770741ae5 Mon Sep 17 00:00:00 2001 From: hasparus Date: Sun, 10 May 2020 18:57:14 +0200 Subject: [PATCH] Move colors scale to separate interface --- packages/css/src/types.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/css/src/types.ts b/packages/css/src/types.ts index c4c6806f0..f8505468b 100644 --- a/packages/css/src/types.ts +++ b/packages/css/src/types.ts @@ -514,6 +514,16 @@ export interface ColorMode { [k: string]: CSS.ColorProperty | ObjectOrArray } +interface ColorModesScale extends ColorMode { + /** + * Nested color modes can provide overrides when used in conjunction with + * `Theme.initialColorModeName and `useColorMode()` + */ + modes?: { + [k: string]: ColorMode + } +} + export interface Theme { breakpoints?: Array mediaQueries?: { [size: string]: string } @@ -571,15 +581,7 @@ export interface Theme { /** * Define the colors that are available through this theme */ - colors?: ColorMode & { - /** - * Nested color modes can provide overrides when used in conjunction with - * `Theme.initialColorModeName and `useColorMode()` - */ - modes?: { - [k: string]: ColorMode - } - } + colors?: ColorModesScale /** * Styles for elements rendered in MDX can be added to the theme.styles