|
1 | 1 | // Copyright (c) Microsoft Corporation. |
2 | 2 | // Licensed under the MIT License. |
3 | 3 |
|
4 | | -import {DesignToken} from '@microsoft/fast-foundation'; |
5 | | - |
6 | | -const {create} = DesignToken; |
| 4 | +import {create} from './utilities/design-tokens/create'; |
7 | 5 |
|
8 | 6 | /** |
9 | 7 | * Global design tokens. |
10 | 8 | */ |
11 | | -export const designUnit = create<number>('design-unit').withDefault(4); |
| 9 | + |
12 | 10 | export const borderWidth = create<number>('border-width').withDefault(1); |
13 | | -export const contrastActiveBorder = create<string>( |
14 | | - 'contrast-active-border' |
15 | | -).withDefault('#f38518'); |
16 | | -export const contrastBorder = |
17 | | - create<string>('contrast-border').withDefault('#6fc3df'); |
| 11 | +export const contrastActiveBorder = create<string>('contrast-active-border', '--vscode-contrastActiveBorder').withDefault('#f38518'); |
| 12 | +export const contrastBorder = create<string>('contrast-border', '--vscode-contrastBorder').withDefault('#6fc3df'); |
18 | 13 | export const cornerRadius = create<number>('corner-radius').withDefault(0); |
19 | | -export const disabledOpacity = |
20 | | - create<number>('disabled-opacity').withDefault(0.4); |
21 | | -export const focusBorder = |
22 | | - create<string>('focus-border').withDefault('#007fd4'); |
23 | | -export const foreground = create<string>('foreground').withDefault('#cccccc'); |
24 | | -export const fontFamily = create<string>('font-family').withDefault( |
| 14 | +export const designUnit = create<number>('design-unit').withDefault(4); |
| 15 | +export const disabledOpacity = create<number>('disabled-opacity').withDefault(0.4); |
| 16 | +export const focusBorder = create<string>('focus-border', '--vscode-focusBorder').withDefault('#007fd4'); |
| 17 | +export const fontFamily = create<string>('font-family', '--vscode-font-family').withDefault( |
25 | 18 | '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol' |
26 | 19 | ); |
27 | | -export const fontWeight = create<string>('font-weight').withDefault('400'); |
| 20 | +export const fontWeight = create<string>('font-weight', '--vscode-font-weight').withDefault('400'); |
| 21 | +export const foreground = create<string>('foreground', '--vscode-foreground').withDefault('#cccccc'); |
28 | 22 | export const inputHeight = create<string>('input-height').withDefault('26'); |
29 | | -export const inputMinWidth = |
30 | | - create<string>('input-min-width').withDefault('100px'); |
31 | | - |
32 | | -/** |
33 | | - * Type-ramp font-size and line-height design tokens. |
34 | | - */ |
35 | | -export const typeRampBaseFontSize = create<string>( |
36 | | - 'type-ramp-base-font-size' |
37 | | -).withDefault('13px'); |
38 | | -export const typeRampBaseLineHeight = create<string>( |
39 | | - 'type-ramp-base-line-height' |
40 | | -).withDefault('normal'); |
41 | | -export const typeRampMinus1FontSize = create<string>( |
42 | | - 'type-ramp-minus1-font-size' |
43 | | -).withDefault('11px'); |
44 | | -export const typeRampMinus1LineHeight = create<string>( |
45 | | - 'type-ramp-minus1-line-height' |
46 | | -).withDefault('16px'); |
47 | | -export const typeRampMinus2FontSize = create<string>( |
48 | | - 'type-ramp-minus2-font-size' |
49 | | -).withDefault('9px'); |
50 | | -export const typeRampMinus2LineHeight = create<string>( |
51 | | - 'type-ramp-minus2-line-height' |
52 | | -).withDefault('16px'); |
53 | | -export const typeRampPlus1FontSize = create<string>( |
54 | | - 'type-ramp-plus1-font-size' |
55 | | -).withDefault('16px'); |
56 | | -export const typeRampPlus1LineHeight = create<string>( |
57 | | - 'type-ramp-plus1-line-height' |
58 | | -).withDefault('24px'); |
| 23 | +export const inputMinWidth = create<string>('input-min-width').withDefault('100px'); |
| 24 | +export const typeRampBaseFontSize = create<string>('type-ramp-base-font-size', '--vscode-font-size').withDefault('13px'); |
| 25 | +export const typeRampBaseLineHeight = create<string>('type-ramp-base-line-height').withDefault('normal'); |
| 26 | +export const typeRampMinus1FontSize = create<string>('type-ramp-minus1-font-size').withDefault('11px'); |
| 27 | +export const typeRampMinus1LineHeight = create<string>('type-ramp-minus1-line-height').withDefault('16px'); |
| 28 | +export const typeRampMinus2FontSize = create<string>('type-ramp-minus2-font-size').withDefault('9px'); |
| 29 | +export const typeRampMinus2LineHeight = create<string>('type-ramp-minus2-line-height').withDefault('16px'); |
| 30 | +export const typeRampPlus1FontSize = create<string>('type-ramp-plus1-font-size').withDefault('16px'); |
| 31 | +export const typeRampPlus1LineHeight = create<string>('type-ramp-plus1-line-height').withDefault('24px'); |
59 | 32 |
|
60 | 33 | /** |
61 | 34 | * Badge design tokens. |
62 | 35 | */ |
63 | | -export const badgeForeground = |
64 | | - create<string>('badge-foreground').withDefault('#ffffff'); |
65 | | -export const badgeBackground = |
66 | | - create<string>('badge-background').withDefault('#4d4d4d'); |
| 36 | + |
| 37 | +export const badgeBackground = create<string>('badge-background', '--vscode-badge-background').withDefault('#4d4d4d'); |
| 38 | +export const badgeForeground = create<string>('badge-foreground', '--vscode-badge-foreground').withDefault('#ffffff'); |
67 | 39 |
|
68 | 40 | /** |
69 | 41 | * Button design tokens. |
70 | 42 | */ |
71 | | -export const buttonPrimaryForeground = create<string>( |
72 | | - 'button-primary-foreground' |
73 | | -).withDefault('#ffffff'); |
74 | | -export const buttonPrimaryBackground = create<string>( |
75 | | - 'button-primary-background' |
76 | | -).withDefault('#0e639c'); |
77 | | -export const buttonPrimaryHoverBackground = create<string>( |
78 | | - 'button-primary-hover-background' |
79 | | -).withDefault('#1177bb'); |
80 | | -export const buttonSecondaryForeground = create<string>( |
81 | | - 'button-secondary-foreground' |
82 | | -).withDefault('#ffffff'); |
83 | | -export const buttonSecondaryBackground = create<string>( |
84 | | - 'button-secondary-background' |
85 | | -).withDefault('#3a3d41'); |
86 | | -export const buttonSecondaryHoverBackground = create<string>( |
87 | | - 'button-secondary-hover-background' |
88 | | -).withDefault('#45494e'); |
89 | | -export const buttonPaddingHorizontal = create<string>( |
90 | | - 'button-padding-horizontal' |
91 | | -).withDefault('11px'); |
92 | | -export const buttonPaddingVertical = create<string>( |
93 | | - 'button-padding-vertical' |
94 | | -).withDefault('6px'); |
95 | | -export const buttonIconBackground = create<string>( |
96 | | - 'button-icon-background' |
97 | | -).withDefault('transparent'); |
98 | | -export const buttonIconHoverBackground = create<string>( |
99 | | - 'button-icon-hover-background' |
100 | | -).withDefault('rgba(90, 93, 94, 0.31)'); |
101 | | -export const buttonIconPadding = create<string>( |
102 | | - 'button-icon-padding' |
103 | | -).withDefault('3px'); |
104 | | -export const buttonIconCornerRadius = create<string>( |
105 | | - 'button-icon-corner-radius' |
106 | | -).withDefault('5px'); |
107 | | -export const buttonIconFocusBorderOffset = create<number>( |
108 | | - 'button-icon-outline-offset' |
109 | | -).withDefault(0); |
110 | | -// Note: Button Border is used only for high contrast themes and should be |
111 | | -// left as transparent otherwise. |
112 | | -export const buttonBorder = |
113 | | - create<string>('button-border').withDefault('transparent'); |
| 43 | + |
| 44 | +// Note: Button border is used only for high contrast themes and should be left as transparent otherwise. |
| 45 | +export const buttonBorder = create<string>('button-border', '--vscode-button-border').withDefault('transparent'); |
| 46 | +export const buttonIconBackground = create<string>('button-icon-background').withDefault('transparent'); |
| 47 | +export const buttonIconCornerRadius = create<string>('button-icon-corner-radius').withDefault('5px'); |
| 48 | +export const buttonIconFocusBorderOffset = create<number>('button-icon-outline-offset').withDefault(0); |
| 49 | +export const buttonIconHoverBackground = create<string>('button-icon-hover-background').withDefault('rgba(90, 93, 94, 0.31)'); |
| 50 | +export const buttonIconPadding = create<string>('button-icon-padding').withDefault('3px'); |
| 51 | +export const buttonPrimaryBackground = create<string>('button-primary-background', '--vscode-button-background').withDefault('#0e639c'); |
| 52 | +export const buttonPrimaryForeground = create<string>('button-primary-foreground', '--vscode-button-foreground').withDefault('#ffffff'); |
| 53 | +export const buttonPrimaryHoverBackground = create<string>('button-primary-hover-background', '--vscode-button-hoverBackground').withDefault('#1177bb'); |
| 54 | +export const buttonSecondaryBackground = create<string>('button-secondary-background', '--vscode-button-secondaryBackground').withDefault('#3a3d41'); |
| 55 | +export const buttonSecondaryForeground = create<string>('button-secondary-foreground', '--vscode-button-secondaryForeground').withDefault('#ffffff'); |
| 56 | +export const buttonSecondaryHoverBackground = create<string>('button-secondary-hover-background', '--vscode-button-secondaryHoverBackground').withDefault('#45494e'); |
| 57 | +export const buttonPaddingHorizontal = create<string>('button-padding-horizontal').withDefault('11px'); |
| 58 | +export const buttonPaddingVertical = create<string>('button-padding-vertical').withDefault('6px'); |
114 | 59 |
|
115 | 60 | /** |
116 | 61 | * Checkbox design tokens. |
117 | 62 | */ |
118 | | -export const checkboxBackground = create<string>( |
119 | | - 'checkbox-background' |
120 | | -).withDefault('#3c3c3c'); |
121 | | -export const checkboxForeground = create<string>( |
122 | | - 'checkbox-foreground' |
123 | | -).withDefault('#f0f0f0'); |
124 | | -export const checkboxBorder = |
125 | | - create<string>('checkbox-border').withDefault('#3c3c3c'); |
126 | | -export const checkboxCornerRadius = create<number>( |
127 | | - 'checkbox-corner-radius' |
128 | | -).withDefault(3); |
| 63 | + |
| 64 | +export const checkboxBackground = create<string>('checkbox-background', '--vscode-checkbox-background').withDefault('#3c3c3c'); |
| 65 | +export const checkboxBorder = create<string>('checkbox-border', '--vscode-checkbox-border').withDefault('#3c3c3c'); |
| 66 | +export const checkboxCornerRadius = create<number>('checkbox-corner-radius').withDefault(3); |
| 67 | +export const checkboxForeground = create<string>('checkbox-foreground', '--vscode-checkbox-foreground').withDefault('#f0f0f0'); |
129 | 68 |
|
130 | 69 | /** |
131 | 70 | * Data Grid design tokens |
132 | 71 | */ |
133 | | -export const listActiveSelectionBackground = create<string>( |
134 | | - 'list-active-selection-background' |
135 | | -).withDefault('#094771'); |
136 | | -export const listActiveSelectionForeground = create<string>( |
137 | | - 'list-active-selection-foreground' |
138 | | -).withDefault('#ffffff'); |
139 | | -export const listHoverBackground = create<string>( |
140 | | - 'list-hover-background' |
141 | | -).withDefault('#2a2d2e'); |
142 | | -export const quickInputBackground = create<string>( |
143 | | - 'quick-input-background' |
144 | | -).withDefault('#252526'); |
| 72 | + |
| 73 | +export const listActiveSelectionBackground = create<string>('list-active-selection-background', '--vscode-list-activeSelectionBackground').withDefault('#094771'); |
| 74 | +export const listActiveSelectionForeground = create<string>('list-active-selection-foreground', '--vscode-list-activeSelectionForeground').withDefault('#ffffff'); |
| 75 | +export const listHoverBackground = create<string>('list-hover-background', '--vscode-list-hoverBackground').withDefault('#2a2d2e'); |
| 76 | +export const quickInputBackground = create<string>('quick-input-background', '--vscode-quickInput-background').withDefault('#252526'); |
145 | 77 |
|
146 | 78 | /** |
147 | 79 | * Divider design tokens. |
148 | 80 | */ |
149 | | -export const dividerBackground = |
150 | | - create<string>('divider-background').withDefault('#454545'); |
| 81 | + |
| 82 | +export const dividerBackground = create<string>('divider-background', '--vscode-settings-dropdownListBorder').withDefault('#454545'); |
151 | 83 |
|
152 | 84 | /** |
153 | 85 | * Dropdown design tokens. |
154 | 86 | */ |
155 | | -export const dropdownBackground = create<string>( |
156 | | - 'dropdown-background' |
157 | | -).withDefault('#3c3c3c'); |
158 | | -export const dropdownForeground = create<string>( |
159 | | - 'dropdown-foreground' |
160 | | -).withDefault('#f0f0f0'); |
161 | | -export const dropdownBorder = |
162 | | - create<string>('dropdown-border').withDefault('#3c3c3c'); |
163 | | -export const dropdownListMaxHeight = create<string>( |
164 | | - 'dropdown-list-max-height' |
165 | | -).withDefault('200px'); |
| 87 | + |
| 88 | +export const dropdownBackground = create<string>('dropdown-background', '--vscode-dropdown-background').withDefault('#3c3c3c'); |
| 89 | +export const dropdownBorder = create<string>('dropdown-border', '--vscode-dropdown-border').withDefault('#3c3c3c'); |
| 90 | +export const dropdownForeground = create<string>('dropdown-foreground', '--vscode-dropdown-foreground').withDefault('#f0f0f0'); |
| 91 | +export const dropdownListMaxHeight = create<string>('dropdown-list-max-height').withDefault('200px'); |
166 | 92 |
|
167 | 93 | /** |
168 | 94 | * Text Field & Area design tokens. |
169 | 95 | */ |
170 | | -export const inputBackground = |
171 | | - create<string>('input-background').withDefault('#3c3c3c'); |
172 | | -export const inputForeground = |
173 | | - create<string>('input-foreground').withDefault('#cccccc'); |
174 | | -export const inputPlaceholderForeground = create<string>( |
175 | | - 'input-placeholder-foreground' |
176 | | -).withDefault('#cccccc'); |
| 96 | + |
| 97 | +export const inputBackground = create<string>('input-background', '--vscode-input-background').withDefault('#3c3c3c'); |
| 98 | +export const inputForeground = create<string>('input-foreground', '--vscode-input-foreground').withDefault('#cccccc'); |
| 99 | +export const inputPlaceholderForeground = create<string>('input-placeholder-foreground', '--vscode-input-placeholderForeground').withDefault('#cccccc'); |
177 | 100 |
|
178 | 101 | /** |
179 | 102 | * Link design tokens. |
180 | 103 | */ |
181 | | -export const linkForeground = create<string>( |
182 | | - 'link-active-foreground' |
183 | | -).withDefault('#3794ff'); |
184 | | -export const linkActiveForeground = |
185 | | - create<string>('link-foreground').withDefault('#3794ff'); |
| 104 | + |
| 105 | +export const linkActiveForeground = create<string>('link-foreground', '--vscode-textLink-activeForeground').withDefault('#3794ff'); |
| 106 | +export const linkForeground = create<string>('link-active-foreground', '--vscode-textLink-foreground').withDefault('#3794ff'); |
186 | 107 |
|
187 | 108 | /** |
188 | | - * Progress Bar & Ring design tokens. |
| 109 | + * Progress ring design tokens. |
189 | 110 | */ |
190 | | -export const progressBackground = create<string>( |
191 | | - 'progress-background' |
192 | | -).withDefault('#0e70c0'); |
| 111 | + |
| 112 | +export const progressBackground = create<string>('progress-background', '--vscode-progressBar-background').withDefault('#0e70c0'); |
193 | 113 |
|
194 | 114 | /** |
195 | 115 | * Panels design tokens. |
196 | 116 | */ |
197 | | -export const panelViewBackground = create<string>( |
198 | | - 'panel-view-background' |
199 | | -).withDefault('#1e1e1e'); |
200 | | -export const panelViewBorder = |
201 | | - create<string>('panel-view-border').withDefault('#80808059'); |
202 | | -export const panelTabForeground = create<string>( |
203 | | - 'panel-tab-foreground' |
204 | | -).withDefault('#e7e7e799'); |
205 | | -export const panelTabActiveForeground = create<string>( |
206 | | - 'panel-tab-active-foreground' |
207 | | -).withDefault('#e7e7e7'); |
208 | | -export const panelTabActiveBorder = create<string>( |
209 | | - 'panel-tab-active-border' |
210 | | -).withDefault('#e7e7e7'); |
| 117 | + |
| 118 | +export const panelTabActiveBorder = create<string>('panel-tab-active-border', '--vscode-panelTitle-activeBorder').withDefault('#e7e7e7'); |
| 119 | +export const panelTabActiveForeground = create<string>('panel-tab-active-foreground', '--vscode-panelTitle-activeForeground').withDefault('#e7e7e7'); |
| 120 | +export const panelTabForeground = create<string>('panel-tab-foreground', '--vscode-panelTitle-inactiveForeground').withDefault('#e7e7e799'); |
| 121 | +export const panelViewBackground = create<string>('panel-view-background', '--vscode-panel-background').withDefault('#1e1e1e'); |
| 122 | +export const panelViewBorder = create<string>('panel-view-border', '--vscode-panel-border').withDefault('#80808059'); |
211 | 123 |
|
212 | 124 | /** |
213 | 125 | * Tag design tokens. |
214 | 126 | */ |
215 | | -export const tagCornerRadius = |
216 | | - create<string>('tag-corner-radius').withDefault('2px'); |
| 127 | + |
| 128 | +export const tagCornerRadius = create<string>('tag-corner-radius').withDefault('2px'); |
0 commit comments