Skip to content

Commit

Permalink
fix: loosen CSS type util
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Jul 29, 2021
1 parent 2b77b6f commit 33ad101
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 38 deletions.
19 changes: 1 addition & 18 deletions packages/core/types/css-util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,7 @@ export type CSS<
}
// unknown css declaration styles
& {
[K in string]: (
K extends Util.Prefixed<'@', keyof Media>
? unknown
: K extends keyof CSSProperties
? unknown
: K extends keyof Utils
? unknown
: K extends keyof ThemeMap
? unknown
: K extends keyof { variants: unknown; defaultVariants: unknown; compoundVariants: unknown }
? unknown
: (
| CSS<Media, Theme, ThemeMap, Utils>
| CSS.Globals
| Util.Index
| any[]
)
)
[K in string]: number | string | CSS<Media, Theme, ThemeMap, Utils> | {}
}
)

Expand Down
7 changes: 6 additions & 1 deletion packages/core/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export type CSS<
theme?: {}
themeMap?: {}
utils?: {}
} = {}
} = {
media: {},
theme: {},
themeMap: {},
utils: {}
}
> = CSSUtil.CSS<
Config['media'],
Config['theme'],
Expand Down
19 changes: 1 addition & 18 deletions packages/react/types/css-util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,7 @@ export type CSS<
}
// unknown css declaration styles
& {
[K in string]: (
K extends Util.Prefixed<'@', keyof Media>
? unknown
: K extends keyof CSSProperties
? unknown
: K extends keyof Utils
? unknown
: K extends keyof ThemeMap
? unknown
: K extends keyof { variants: unknown; defaultVariants: unknown; compoundVariants: unknown }
? unknown
: (
| CSS<Media, Theme, ThemeMap, Utils>
| CSS.Globals
| Util.Index
| any[]
)
)
[K in string]: number | string | CSS<Media, Theme, ThemeMap, Utils> | {}
}
)

Expand Down
7 changes: 6 additions & 1 deletion packages/react/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export type CSS<
theme?: {}
themeMap?: {}
utils?: {}
} = {}
} = {
media: {},
theme: {},
themeMap: {},
utils: {}
}
> = CSSUtil.CSS<
Config['media'],
Config['theme'],
Expand Down

0 comments on commit 33ad101

Please sign in to comment.