-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support dynamic value #3146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support dynamic value #3146
Changes from 6 commits
94483fa
cde4175
bc31fed
0d553be
2ab577f
cc913db
8869037
27b03d8
2fb22d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,18 +7,23 @@ import * as CSS from 'csstype' | |
| export { RegisteredCache, SerializedStyles } | ||
|
|
||
| export type CSSProperties = CSS.PropertiesFallback<number | string> | ||
| export type CSSPropertiesWithMultiValues = { | ||
| export type CSSPropertiesWithMultiValues<Props = unknown> = { | ||
| [K in keyof CSSProperties]: | ||
| | CSSProperties[K] | ||
| | ReadonlyArray<Extract<CSSProperties[K], string>> | ||
| | (( | ||
| props: Props | ||
| ) => CSSProperties[K] | ReadonlyArray<Extract<CSSProperties[K], string>>) | ||
siriwatknp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| export type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject } | ||
| export type CSSPseudos<Props = unknown> = { | ||
| [K in CSS.Pseudos]?: CSSObject<Props> | ||
| } | ||
|
|
||
| export interface ArrayCSSInterpolation | ||
| extends ReadonlyArray<CSSInterpolation> {} | ||
| export interface ArrayCSSInterpolation<Props = unknown> | ||
| extends ReadonlyArray<CSSInterpolation<Props>> {} | ||
|
|
||
| export type InterpolationPrimitive = | ||
| export type InterpolationPrimitive<Props = unknown> = | ||
| | null | ||
| | undefined | ||
| | boolean | ||
|
|
@@ -27,18 +32,22 @@ export type InterpolationPrimitive = | |
| | ComponentSelector | ||
| | Keyframes | ||
| | SerializedStyles | ||
| | CSSObject | ||
| | CSSObject<Props> | ||
|
|
||
| export type CSSInterpolation = InterpolationPrimitive | ArrayCSSInterpolation | ||
| export type CSSInterpolation<Props = unknown> = | ||
|
||
| | InterpolationPrimitive<Props> | ||
| | ArrayCSSInterpolation<Props> | ||
|
|
||
| export interface CSSOthersObject { | ||
| [propertiesName: string]: CSSInterpolation | ||
| export interface CSSOthersObject<Props = unknown> { | ||
| [propertiesName: string]: | ||
| | CSSInterpolation<Props> | ||
| | ((props: Props) => CSSInterpolation<Props>) | ||
| } | ||
|
|
||
| export interface CSSObject | ||
| extends CSSPropertiesWithMultiValues, | ||
| CSSPseudos, | ||
| CSSOthersObject {} | ||
| export interface CSSObject<Props = unknown> | ||
siriwatknp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| extends CSSPropertiesWithMultiValues<Props>, | ||
| CSSPseudos<Props>, | ||
| CSSOthersObject<Props> {} | ||
|
|
||
| export interface ComponentSelector { | ||
| __emotion_styles: any | ||
|
|
@@ -59,7 +68,7 @@ export interface FunctionInterpolation<Props> { | |
| } | ||
|
|
||
| export type Interpolation<Props> = | ||
| | InterpolationPrimitive | ||
| | InterpolationPrimitive<Props> | ||
| | ArrayInterpolation<Props> | ||
| | FunctionInterpolation<Props> | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.