From 607719ed26d94b85867cfbc92276e36029f6e731 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 28 Apr 2022 14:07:20 -0400 Subject: [PATCH] Update size token function and types Co-Authored-By: Keith Simmons --- styles/src/tokens.ts | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/styles/src/tokens.ts b/styles/src/tokens.ts index bde1c0aa2c..69fc05ff63 100644 --- a/styles/src/tokens.ts +++ b/styles/src/tokens.ts @@ -66,22 +66,8 @@ export const fontWeights = { } // Standard size unit used for paddings, margins, borders, etc. -export type Size = - | "px" - | "xs" - | "sm" - | "md" - | "lg" - | "xl"; -export const sizes = { - px: 1, - xs: 2, - sm: 4, - md: 6, - lg: 8, - xl: 12, -}; +export type Size = number export type SizeToken = Token; 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 interface ColorToken { value: Color,