Skip to content

Commit

Permalink
feat: support DEFAULT type in colors
Browse files Browse the repository at this point in the history
  • Loading branch information
MellowCo committed May 13, 2023
1 parent 39a3fa5 commit 2d03992
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/theme/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ export const colors: Theme['colors'] = {

// assign default color, and color shortcuts
Object.values(colors).forEach((color) => {
if (typeof color !== 'string') {
color.DEFAULT = color.DEFAULT || color[400]
if (typeof color !== 'string' && color !== undefined) {
color.DEFAULT = color.DEFAULT || color[400] as string

Object.keys(color).forEach((key) => {
const short = +key / 100
Expand Down
4 changes: 4 additions & 0 deletions src/theme/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export interface ThemeAnimation {
counts?: Record<string, string | number>
}

export interface Colors {
[key: string]: Colors & { DEFAULT?: string } | string
}

export interface Theme {
width?: Record<string, string>
height?: Record<string, string>
Expand Down

0 comments on commit 2d03992

Please sign in to comment.