Skip to content

Commit

Permalink
Move colors scale to separate interface
Browse files Browse the repository at this point in the history
  • Loading branch information
hasparus committed May 10, 2020
1 parent 8060350 commit 4311f24
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/css/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,16 @@ export interface ColorMode {
[k: string]: CSS.ColorProperty | ObjectOrArray<CSS.ColorProperty>
}

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<string>
mediaQueries?: { [size: string]: string }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4311f24

Please sign in to comment.