Update size token function and types

Co-Authored-By: Keith Simmons <keith@the-simmons.net>
This commit is contained in:
Nate Butler 2022-04-28 14:07:20 -04:00
parent 0cc5a3839d
commit 607719ed26

View file

@ -66,22 +66,8 @@ export const fontWeights = {
} }
// Standard size unit used for paddings, margins, borders, etc. // Standard size unit used for paddings, margins, borders, etc.
export type Size =
| "px"
| "xs"
| "sm"
| "md"
| "lg"
| "xl";
export const sizes = { export type Size = number
px: 1,
xs: 2,
sm: 4,
md: 6,
lg: 8,
xl: 12,
};
export type SizeToken = Token<Size, "size">; export type SizeToken = Token<Size, "size">;
function size(value: Size): SizeToken { function size(value: Size): SizeToken {
@ -91,6 +77,15 @@ function size(value: Size): SizeToken {
}; };
} }
export const sizes = {
px: size(1),
xs: size(2),
sm: size(4),
md: size(6),
lg: size(8),
xl: size(12),
};
export type Color = string; export type Color = string;
export interface ColorToken { export interface ColorToken {
value: Color, value: Color,