-
Notifications
You must be signed in to change notification settings - Fork 14
/
coreTokens.ts
193 lines (175 loc) · 4.76 KB
/
coreTokens.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/**
* Halstack Color Palette
* @link http://localhost:3000/principles/color/#color-tokens-core-color-tokens
*/
const CoreColorTokens = {
// Color
// Absolutes
color_black: "#000000",
color_white: "#ffffff",
color_transparent: "transparent",
// Greyscale
// Solid variants
color_grey_50: "#fafafa",
color_grey_100: "#f2f2f2",
color_grey_200: "#e6e6e6",
color_grey_300: "#cccccc",
color_grey_400: "#bfbfbf",
color_grey_500: "#999999",
color_grey_600: "#808080",
color_grey_700: "#666666",
color_grey_800: "#4d4d4d",
color_grey_900: "#333333",
// Transparent variants
color_grey_50_a: "#00000005",
color_grey_100_a: "#0000000d",
color_grey_200_a: "#0000001a",
color_grey_300_a: "#00000033",
color_grey_400_a: "#0000004d",
color_grey_500_a: "#00000066",
color_grey_600_a: "#00000080",
color_grey_700_a: "#00000099",
color_grey_800_a: "#000000b3",
color_grey_900_a: "#000000cc",
// Purple
color_purple_50: "#faf7fd",
color_purple_100: "#f2eafa",
color_purple_200: "#e5d5f6",
color_purple_300: "#cbacec",
color_purple_400: "#b182e3",
color_purple_500: "#a46ede",
color_purple_600: "#7d2fd0",
color_purple_700: "#5f249f",
color_purple_800: "#4b1c7d",
color_purple_900: "#321353",
// Blue
color_blue_50: "#f5fbff",
color_blue_100: "#e6f4ff",
color_blue_200: "#cceaff",
color_blue_300: "#99d5ff",
color_blue_400: "#66bfff",
color_blue_500: "#33aaff",
color_blue_600: "#0095ff",
color_blue_700: "#0086e6",
color_blue_800: "#0067b3",
color_blue_900: "#003c66",
// Red
color_red_50: "#fff5f6",
color_red_100: "#ffe6e9",
color_red_200: "#ffccd3",
color_red_300: "#fe9aa7",
color_red_400: "#fe677b",
color_red_500: "#fe344f",
color_red_600: "#fe0123",
color_red_700: "#d0011b",
color_red_800: "#980115",
color_red_900: "#65010e",
// Green
color_green_50: "#f7fdf9",
color_green_100: "#eafaef",
color_green_200: "#d5f6df",
color_green_300: "#acecbe",
color_green_400: "#82e39e",
color_green_500: "#59d97d",
color_green_600: "#2fd05d",
color_green_700: "#24a148",
color_green_800: "#1c7d38",
color_green_900: "#135325",
// Yellow
color_yellow_50: "#fffdf5",
color_yellow_100: "#fef9e6",
color_yellow_200: "#fdf4ce",
color_yellow_300: "#fbe89d",
color_yellow_400: "#fadd6b",
color_yellow_500: "#f7cf2b",
color_yellow_600: "#f6c709",
color_yellow_700: "#c59f07",
color_yellow_800: "#947705",
color_yellow_900: "#624f04",
// Orange
color_orange_50: "#fefaf5",
color_orange_100: "#fef3e7",
color_orange_200: "#fce7cf",
color_orange_300: "#facf9e",
color_orange_400: "#f7b76e",
color_orange_500: "#f59f3d",
color_orange_600: "#f38f20",
color_orange_700: "#c26c0a",
color_orange_800: "#915108",
color_orange_900: "#613605",
};
export const getCoreColorToken = (key: CoreColorTokens) => CoreColorTokens[key];
export type CoreColorTokens = keyof typeof CoreColorTokens;
/**
* Halstack Spacing Principles
* @link https://developer.dxc.com/halstack/next/principles/spacing/
*/
const SpacingTokens = {
spacing_0: "0rem",
spacing_2: "0.125rem",
spacing_4: "0.25rem",
spacing_8: "0.5rem",
spacing_12: "0.75rem",
spacing_16: "1rem",
spacing_24: "1.5rem",
spacing_32: "2rem",
spacing_40: "2.5rem",
spacing_48: "3rem",
spacing_56: "3.5rem",
spacing_64: "4rem",
spacing_80: "5rem",
spacing_96: "6rem",
spacing_112: "7rem",
}
const CoreTokens = {
...CoreColorTokens,
...SpacingTokens,
inherit: "inherit",
// Typography
type_sans: "Open Sans, sans-serif",
type_scale_root: "16px",
type_scale_08: "3.75rem",
type_scale_07: "2.5rem",
type_scale_06: "2rem",
type_scale_05: "1.5rem",
type_scale_04: "1.25rem",
type_scale_03: "1rem",
type_scale_02: "0.875rem",
type_scale_01: "0.75rem",
type_light: "300",
type_regular: "400",
type_semibold: "600",
type_bold: "bold",
type_italic: "italic",
type_normal: "normal",
type_spacing_tight_02: "-0.05em",
type_spacing_tight_01: "-0.025em",
type_spacing_normal: "0em",
type_spacing_wide_01: "0.025em",
type_spacing_wide_02: "0.05em",
type_spacing_wide_03: "0.1em",
type_initial: "initial",
type_uppercase: "uppercase",
type_no_line: "none",
type_underline: "underline",
type_line_through: "line-through",
type_leading_compact_03: "1em",
type_leading_compact_02: "1.25em",
type_leading_compact_01: "1.365em",
type_leading_normal: "1.5em",
type_leading_loose_01: "1.715em",
type_leading_loose_02: "2em",
// Border
border_width_0: "0px",
border_width_1: "1px",
border_width_2: "2px",
border_width_4: "4px",
border_radius_none: "0rem",
border_radius_small: "0.125rem",
border_radius_medium: "0.25rem",
border_radius_large: "0.375rem",
border_solid: "solid",
border_dashed: "dashed",
border_none: "none",
};
export default CoreTokens;