-
Notifications
You must be signed in to change notification settings - Fork 19
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
TypeScript theme definition #8
Comments
I hacked this up real quick for a side project I'm working on. It has some extra that's not standard so delete away! interface ThemeUiSpec {
borders?: { [name: string]: number }
borderStyles?: { [name: string]: number }
borderWidths?: { [name: string]: number }
colors?:
| { [name: string]: string }
| { "modes"?: { [name: string]: string } }
fonts?: { [name: string]: string }
fontSizes?: { [name: string]: number }
fontWeights?: { [name: string]: number }
letterSpacings?: { [name: string]: number }
lineHeights?: { [name: string]: number }
radii?: { [name: string]: number }
space?: { [name: string]: number }
sizes?: { [name: string]: number }
transitionDurations?: { [name: string]: number }
transitionTiming?: {
[name: string]: {
"x1": number,
"y1": number,
"x2": number,
"y2": number,
}
}
zIndices?: { [name: string]: number }
} |
An important question regarding this : Can a value be an alias of another value ? I mean :
|
@cyrilchapon currently values in the theme scales cannot self-reference, so |
@crswll very helpful, thanks! I am modifying it slightly for my use. I am using the 'styled-system' library, and I think the following interface is closer to what that library specifically uses (although I haven't tested it yet, and the library unfortunately isn't written in ts).
|
Would this be a good place to keep a TS definition for theme objects? This would be helpful when implementing a spec-compliant library and improve dev experience of existing libraries.
The text was updated successfully, but these errors were encountered: