2 // Codex Design Tokens v1.18.0
3 // Design System for Wikimedia
4 // See https://doc.wikimedia.org/codex/latest/design-tokens/overview.html
6 @size-tooltip: max-content;
7 @background-image-input-checkbox--checked: url( 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="%23fff" d="M7 14.17L2.83 10l-1.41 1.41L7 17 19 5l-1.41-1.42z"/></svg>' );
8 @color-base: var( --color-base, #202122 );
9 @color-base-fixed: var( --color-base-fixed, #202122 );
10 @color-base--hover: var( --color-base--hover, #404244 );
11 @color-emphasized: var( --color-emphasized, #101418 );
12 @color-subtle: var( --color-subtle, #54595d );
13 @color-placeholder: var( --color-placeholder, #72777d );
14 @color-disabled: var( --color-disabled, #a2a9b1 );
15 @color-disabled-emphasized: var( --color-disabled-emphasized, #a2a9b1 );
16 @color-inverted: var( --color-inverted, #fff );
17 @color-inverted-fixed: var( --color-inverted-fixed, #fff ); // The same as color-inverted in light mode, but does not change in dark mode. Use this for things that should be white in both modes.
18 @color-progressive: var( --color-progressive, #36c ); // 'Progressive' Color and states
19 @color-progressive--hover: var( --color-progressive--hover, #3056a9 );
20 @color-progressive--active: var( --color-progressive--active, #233566 );
21 @color-progressive--focus: var( --color-progressive--focus, #36c );
22 @color-destructive: var( --color-destructive, #bf3c2c ); // 'Destructive' Color and states
23 @color-destructive--hover: var( --color-destructive--hover, #9f3526 );
24 @color-destructive--active: var( --color-destructive--active, #612419 );
25 @color-destructive--focus: var( --color-destructive--focus, #36c );
26 @color-visited: var( --color-visited, #6a60b0 ); // 'Visited' color. In combination with progressive. Used for default links.
27 @color-visited--hover: var( --color-visited--hover, #534fa3 );
28 @color-visited--active: var( --color-visited--active, #353262 );
29 @color-destructive--visited: var( --color-destructive--visited, #9f5555 ); // Red link 'Visited' color. Used for visited red links.
30 @color-destructive--visited--hover: var( --color-destructive--visited--hover, #854848 );
31 @color-destructive--visited--active: var( --color-destructive--visited--active, #512e2e );
32 @color-error: var( --color-error, #bf3c2c );
33 @color-error--hover: var( --color-error--hover, #9f3526 );
34 @color-error--active: var( --color-error--active, #612419 );
35 @color-warning: var( --color-warning, #886425 );
36 @color-success: var( --color-success, #177860 );
37 @color-notice: var( --color-notice, #404244 );
38 @color-icon-error: var( --color-icon-error, #f54739 );
39 @color-icon-warning: var( --color-icon-warning, #ab7f2a );
40 @color-icon-success: var( --color-icon-success, #099979 );
41 @color-icon-notice: var( --color-icon-notice, #72777d );
42 @color-content-added: var( --color-content-added, #006400 );
43 @color-content-removed: var( --color-content-removed, #8b0000 );
45 @opacity-medium: 0.65;
47 @opacity-transparent: 0;
48 @filter-invert-icon: var( --filter-invert-icon, 0 );
49 @filter-invert-primary-button-icon: var( --filter-invert-primary-button-icon, 1 );
50 @background-position-base: center;
51 @background-size-search-figure: cover; // Use in TypeaheadSearch and Thumbnail components for the thumb container.
52 @z-index-bottom: -100; // Use descriptive `z-index` tokens for layout purposes.
54 @z-index-above-content: 1;
56 @z-index-dropdown: 50;
59 @z-index-off-canvas-backdrop: 300;
60 @z-index-off-canvas: 350;
61 @z-index-overlay-backdrop: 400;
62 @z-index-overlay: 450;
63 @z-index-tooltip: 800;
64 @z-index-toast-notification: 900;
66 @z-index-stacking-0: 0; // Use stacking-specific z-index tokens inside components to layer individual elements.
67 @z-index-stacking-1: 1;
68 @z-index-stacking-2: 2;
69 @z-index-stacking-3: 3;
70 @box-sizing-base: border-box;
92 @size-viewport-width-full: 100vw;
93 @size-viewport-height-full: 100vh;
94 @size-absolute-1: 1px;
95 @size-absolute-9999: 9999px;
100 @size-search-figure: 2.5rem; // Alias for use in TypeaheadSearch and Thumbnail components for the same purpose and for better code readability.
101 @size-icon-x-small: 0.75rem;
102 @size-icon-small: 1rem;
103 @size-icon-medium: 1.25rem;
104 @max-width-base: none;
105 @max-width-breakpoint-mobile: calc( 640px - @size-absolute-1 ); // A mobile device's maximum available screen width. Many older feature phones have screens smaller than this value.
106 @max-width-breakpoint-tablet: calc( 1120px - @size-absolute-1 ); // A tablet device's maximum available screen width. Note, the size chosen is eager to be re-evaluated with Web team and Product Analytics.
107 @max-width-breakpoint-desktop: calc( 1680px - @size-absolute-1 ); // A desktop device's maximum available screen width.
108 @max-width-button: 28rem; // Note, that this is a slight amendment from WikimediaUI Base from `28.75em` = `460px` to `448px` – `dimension.2800`
109 @border-style-base: solid;
110 @border-style-dashed: dashed;
111 @box-shadow-drop-small: 0 1px 1px rgba( 0, 0, 0, 0.2 ); // This features color as part of the theme token value.
112 @box-shadow-drop-medium: 0 2px 2px 0 rgba( 0, 0, 0, 0.2 ); // This features color as part of the theme token value.
113 @box-shadow-drop-xx-large: 0 20px 48px 0 rgba( 0, 0, 0, 0.2 ); // This features color as part of the theme token value.
114 @box-shadow-inset-small: inset 0 0 0 1px;
115 @box-shadow-inset-medium: inset 0 0 0 2px;
116 @box-shadow-inset-medium-vertical: inset 0 -2px 0 0;
117 @box-shadow-outset-small: 0 0 0 1px;
118 @box-shadow-outset-small-top: 0 -1px 0 0;
119 @box-shadow-outset-small-start: -1px 0 0 0;
120 @box-shadow-color-base: var( --box-shadow-color-base, #000 );
121 @box-shadow-color-progressive--active: var( --box-shadow-color-progressive--active, #233566 );
122 @box-shadow-color-progressive--focus: var( --box-shadow-color-progressive--focus, #36c );
123 @box-shadow-color-progressive-selected: var( --box-shadow-color-progressive-selected, #36c );
124 @box-shadow-color-progressive-selected--hover: var( --box-shadow-color-progressive-selected--hover, #3056a9 );
125 @box-shadow-color-progressive-selected--active: var( --box-shadow-color-progressive-selected--active, #233566 );
126 @box-shadow-color-destructive--focus: var( --box-shadow-color-destructive--focus, #36c );
127 @box-shadow-color-inverted: var( --box-shadow-color-inverted, #fff );
128 @box-shadow-color-transparent: var( --box-shadow-color-transparent, transparent );
129 @font-family-base: sans-serif; // Reference Vector's default fallback sans instead of the deprecated value `font-family-sans` in WikimediaUI Base.
130 @font-family-system-sans: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Inter', 'Helvetica', 'Arial', sans-serif;
131 @font-family-sans--fallback: sans-serif;
132 @font-family-serif: 'Linux Libertine', 'Georgia', 'Times', 'Source Serif Pro', serif;
133 @font-family-serif--fallback: serif;
134 @font-family-monospace: 'Menlo', 'Consolas', 'Liberation Mono', 'Fira Code', 'Courier New', monospace;
135 @font-family-monospace--fallback: monospace, monospace;
136 @font-family-heading-main: 'Linux Libertine', 'Georgia', 'Times', 'Source Serif Pro', serif; // Legacy value from WikimediaUI Base. Use for first heading special treatment.
137 @font-size-x-small: 0.75rem; // `x` stands for extra. In this case extra small.
138 @font-size-small: 0.875rem;
139 @font-size-medium: 1rem;
140 @font-size-large: 1.125rem;
141 @font-size-x-large: 1.25rem;
142 @font-size-xx-large: 1.5rem;
143 @font-size-xxx-large: 1.75rem;
144 @font-weight-hairline: 100;
145 @font-weight-light: 300;
146 @font-weight-normal: 400;
147 @font-weight-semi-bold: 600;
148 @font-weight-bold: 700;
149 @line-height-xxx-small: 1.25; // `x` stands for extra. In this case extra-extra-extra small.
150 @line-height-xx-small: 1.375;
151 @line-height-small: 1.5714285;
152 @line-height-medium: 1.6;
153 @text-decoration-none: none;
154 @text-decoration-line-through: line-through;
155 @text-decoration-underline: underline;
156 @text-overflow-clip: clip;
157 @text-overflow-ellipsis: ellipsis;
159 @transition-duration-base: 100ms;
160 @transition-duration-medium: 250ms;
161 @transition-property-base: background-color, color, border-color, box-shadow;
162 @transition-property-fade: opacity;
163 @transition-property-icon: color;
164 @transition-property-icon-css-only: background-color;
165 @transition-property-toggle-switch-grip: background-color, border-color, transform;
166 @transition-timing-function-system: ease;
167 @transition-timing-function-user: ease-out;
168 @animation-delay-none: 0ms;
169 @animation-delay-medium: -160ms;
170 @animation-delay-slow: -330ms;
171 @animation-duration-medium: 1600ms;
172 @animation-duration-slow: 2000ms;
173 @animation-timing-function-base: linear;
174 @animation-timing-function-bouncing: ease-in-out;
175 @animation-iteration-count-base: infinite;
176 @cursor-base: default;
177 @cursor-base--disabled: default;
178 @cursor-base--hover: pointer;
180 @cursor-grabbing: grabbing;
183 @cursor-not-allowed: not-allowed;
184 @cursor-resize-nesw: nesw-resize;
185 @cursor-resize-nwse: nwse-resize;
187 @cursor-zoom-in: zoom-in;
188 @cursor-zoom-out: zoom-out;
189 @mix-blend-mode-base: var( --mix-blend-mode-base, normal );
190 @mix-blend-mode-blend: var( --mix-blend-mode-blend, multiply );
191 @background-color-base: var( --background-color-base, #fff ); // Background Colors for static elements (for page layout, sections, etc.) from here on.
192 @background-color-base-fixed: var( --background-color-base-fixed, #fff ); // The same as background-color-base in light mode, but does not change in dark mode. Use this for things that should be white in both modes.
193 @background-color-neutral: var( --background-color-neutral, #eaecf0 );
194 @background-color-neutral-subtle: var( --background-color-neutral-subtle, #f8f9fa );
195 @background-color-interactive: var( --background-color-interactive, #eaecf0 );
196 @background-color-interactive--hover: var( --background-color-interactive--hover, #dadde3 );
197 @background-color-interactive--active: var( --background-color-interactive--active, #c8ccd1 );
198 @background-color-interactive-subtle: var( --background-color-interactive-subtle, #f8f9fa );
199 @background-color-interactive-subtle--hover: var( --background-color-interactive-subtle--hover, #eaecf0 );
200 @background-color-interactive-subtle--active: var( --background-color-interactive-subtle--active, #dadde3 );
201 @background-color-disabled: var( --background-color-disabled, #dadde3 ); // Components like Buttons, Checkboxes, Radios, ProgressBars….
202 @background-color-disabled-subtle: var( --background-color-disabled-subtle, #eaecf0 ); // Components like TextInputs, Selects….
203 @background-color-inverted: var( --background-color-inverted, #101418 );
204 @background-color-progressive: var( --background-color-progressive, #36c );
205 @background-color-progressive--hover: var( --background-color-progressive--hover, #3056a9 );
206 @background-color-progressive--active: var( --background-color-progressive--active, #233566 );
207 @background-color-progressive--focus: var( --background-color-progressive--focus, #36c );
208 @background-color-progressive-subtle: var( --background-color-progressive-subtle, #f1f4fd );
209 @background-color-progressive-subtle--hover: var( --background-color-progressive-subtle--hover, #dce3f9 );
210 @background-color-progressive-subtle--active: var( --background-color-progressive-subtle--active, #cbd6f6 );
211 @background-color-destructive: var( --background-color-destructive, #bf3c2c );
212 @background-color-destructive--hover: var( --background-color-destructive--hover, #9f3526 );
213 @background-color-destructive--active: var( --background-color-destructive--active, #612419 );
214 @background-color-destructive--focus: var( --background-color-destructive--focus, #36c );
215 @background-color-destructive-subtle: var( --background-color-destructive-subtle, #ffe9e5 );
216 @background-color-destructive-subtle--hover: var( --background-color-destructive-subtle--hover, #ffdad3 );
217 @background-color-destructive-subtle--active: var( --background-color-destructive-subtle--active, #ffc8bd );
218 @background-color-error: var( --background-color-error, #f54739 );
219 @background-color-error--hover: var( --background-color-error--hover, #d74032 );
220 @background-color-error--active: var( --background-color-error--active, #bf3c2c );
221 @background-color-error-subtle: var( --background-color-error-subtle, #ffe9e5 );
222 @background-color-error-subtle--hover: var( --background-color-error-subtle--hover, #ffdad3 );
223 @background-color-error-subtle--active: var( --background-color-error-subtle--active, #ffc8bd );
224 @background-color-warning-subtle: var( --background-color-warning-subtle, #fdf2d5 );
225 @background-color-success-subtle: var( --background-color-success-subtle, #dff2eb );
226 @background-color-notice-subtle: var( --background-color-notice-subtle, #eaecf0 );
227 @background-color-content-added: var( --background-color-content-added, #a3d3ff );
228 @background-color-content-removed: var( --background-color-content-removed, #ffe49c );
229 @background-color-transparent: var( --background-color-transparent, transparent );
230 @background-color-backdrop-light: var( --background-color-backdrop-light, rgba( 255, 255, 255, 0.65 ) ); // Backdrop is the term used by CSS Fullscreen API and is used to dim the background when a modal Dialog is open. Also known as overlay mask.
231 @background-color-backdrop-dark: var( --background-color-backdrop-dark, rgba( 0, 0, 0, 0.65 ) );
232 @background-color-button-quiet--hover: var( --background-color-button-quiet--hover, rgba( 0, 24, 73, 0.027 ) );
233 @background-color-button-quiet--active: var( --background-color-button-quiet--active, rgba( 0, 24, 73, 0.082 ) );
234 @background-color-input-binary--checked: var( --background-color-input-binary--checked, #36c );
235 @background-color-tab-list-item-framed--hover: var( --background-color-tab-list-item-framed--hover, rgba( 255, 255, 255, 0.3 ) );
236 @background-color-tab-list-item-framed--active: var( --background-color-tab-list-item-framed--active, rgba( 255, 255, 255, 0.65 ) );
237 @opacity-icon-base: var( --opacity-icon-base, 0.87 );
238 @opacity-icon-base--hover: var( --opacity-icon-base--hover, 0.74 );
239 @opacity-icon-base--selected: var( --opacity-icon-base--selected, 1 );
240 @opacity-icon-base--disabled: var( --opacity-icon-base--disabled, 0.51 );
241 @opacity-icon-placeholder: var( --opacity-icon-placeholder, 0.51 );
242 @opacity-icon-subtle: var( --opacity-icon-subtle, 0.67 );
243 @min-size-interactive-pointer: 32px;
244 @min-size-interactive-touch: 44px;
245 @min-size-search-figure: 40px; // Alias for use in TypeaheadSearch and Thumbnail components for the same purpose and for better code readability.
246 @min-size-icon-x-small: 12px;
247 @min-size-icon-small: 16px;
248 @min-size-icon-medium: 20px;
249 @min-size-input-binary: 20px;
250 @min-size-toggle-switch-grip: 20px;
251 @min-width-medium: 256px;
252 @min-width-breakpoint-mobile: 320px; // A mobile device's minimum available screen width. Many older feature phones have screens smaller than this value.
253 @min-width-breakpoint-tablet: 640px; // A tablet device's minimum available screen width. Note: the size chosen is eager to be re-evaluated with Web team and Product Analytics.
254 @min-width-breakpoint-desktop: 1120px; // A desktop device's minimum available screen width.
255 @min-width-breakpoint-desktop-wide: 1680px; // A wider desktop's minimum available screen width.
256 @min-width-toggle-switch: 48px;
260 @spacing-30: 5px; // This token is an exception to the scale. Used as vertical `padding` in inputs and controls to achieve the default 32px component height.
261 @spacing-35: 6px; // This token is an exception to the scale. Used as `padding` of the ToggleSwitch component.
271 @spacing-half: 50%; // From here on, spacing tokens which are used for positioning values.
273 @border-width-base: 1px;
274 @border-width-thick: 2px;
275 @border-width-input-radio--checked: 6px;
276 @border-color-base: var( --border-color-base, #a2a9b1 );
277 @border-color-subtle: var( --border-color-subtle, #c8ccd1 );
278 @border-color-muted: var( --border-color-muted, #dadde3 );
279 @border-color-interactive: var( --border-color-interactive, #72777d );
280 @border-color-interactive--hover: var( --border-color-interactive--hover, #27292d );
281 @border-color-interactive--active: var( --border-color-interactive--active, #202122 );
282 @border-color-disabled: var( --border-color-disabled, #c8ccd1 );
283 @border-color-inverted: var( --border-color-inverted, #fff );
284 @border-color-progressive: var( --border-color-progressive, #6485d1 );
285 @border-color-progressive--hover: var( --border-color-progressive--hover, #3056a9 );
286 @border-color-progressive--active: var( --border-color-progressive--active, #233566 );
287 @border-color-progressive--focus: var( --border-color-progressive--focus, #36c );
288 @border-color-destructive: var( --border-color-destructive, #f54739 );
289 @border-color-destructive--hover: var( --border-color-destructive--hover, #9f3526 );
290 @border-color-destructive--active: var( --border-color-destructive--active, #612419 );
291 @border-color-destructive--focus: var( --border-color-destructive--focus, #36c );
292 @border-color-error: var( --border-color-error, #f54739 );
293 @border-color-error--hover: var( --border-color-error--hover, #9f3526 );
294 @border-color-error--active: var( --border-color-error--active, #612419 );
295 @border-color-warning: var( --border-color-warning, #ab7f2a );
296 @border-color-success: var( --border-color-success, #099979 );
297 @border-color-notice: var( --border-color-notice, #72777d );
298 @border-color-content-added: var( --border-color-content-added, #a3d3ff );
299 @border-color-content-removed: var( --border-color-content-removed, #ffe49c );
300 @border-color-transparent: var( --border-color-transparent, transparent );
301 @border-color-divider: var( --border-color-divider, #a2a9b1 );
302 @border-radius-base: 2px;
303 @border-radius-sharp: 0;
304 @border-radius-pill: 9999px;
305 @border-radius-circle: 50%; // Use `50%` for circle or ellipsis. See https://stackoverflow.com/a/29966500
306 @outline-color-progressive--focus: var( --outline-color-progressive--focus, #36c ); // Use in places where no more customized focus styles are provided, for example on generic `:focus`.
307 @min-height-text-area: 64px;
308 @min-height-table-header: 64px;
309 @min-height-table-footer: 64px;
310 @color-link-red: @color-destructive; // Red ('new') Link color and states
311 @color-link-red--hover: @color-destructive--hover;
312 @color-link-red--active: @color-destructive--active;
313 @color-link-red--focus: @color-destructive--focus;
314 @color-link-red--visited: @color-destructive--visited;
315 @color-link-red--visited--hover: @color-destructive--visited--hover;
316 @color-link-red--visited--active: @color-destructive--visited--active;
317 @accent-color-base: #36c;
318 @position-offset-border-width-base: -@border-width-base;
319 @spacing-horizontal-button: @spacing-75 - @border-width-base; // Padding should equal 12px of spacing minus the width of the border
320 @spacing-horizontal-button-icon-only: @spacing-35 - @border-width-base; // Padding should equal 6px of spacing minus the width of the border
321 @spacing-horizontal-button-large: @spacing-100 - @border-width-base; // Padding should equal 16px of spacing minus the width of the border
322 @spacing-horizontal-input-text-two-end-icons: calc( @spacing-50 * 2 + @size-icon-small ); // Rely on `calc()` to make token output usable in all formats. When there are two end icons, (i.e. a clear icon and an end icon), we need to double the horizontal padding and account for the size of the extra icon. This token can be used to calculate the horizontal position of the clear icon and the padding-end of the text input.
323 @spacing-start-typeahead-search-figure: @spacing-75; // The amount of space between the TypeaheadSearch figure's parent component and the TypeaheadSearch figure (input icon container, search result thumbnail, and footer icon container). We want this space to be uniform so that the figures vertically line up nicely. We use the same horizontal padding as the MenuItem.
324 @border-color-input--hover: @border-color-interactive;
325 @border-color-input-binary: @border-color-interactive;
326 @border-color-input-binary--hover: @border-color-progressive--hover;
327 @border-color-input-binary--active: @border-color-progressive--active;
328 @border-color-input-binary--focus: @border-color-progressive--focus;
329 @border-color-input-binary--checked: @border-color-progressive;
330 @border-base: @border-width-base @border-style-base @border-color-base;
331 @border-subtle: @border-width-base @border-style-base @border-color-subtle;
332 @border-progressive: @border-width-base @border-style-base @border-color-progressive;
333 @border-destructive: @border-width-base @border-style-base @border-color-destructive;
334 @outline-base--focus: @border-width-base solid transparent; // Enable Windows high contrast mode on certain widgets, that have default outlines overridden.
335 @spacing-start-typeahead-search-icon: calc( @spacing-start-typeahead-search-figure + ( @min-size-search-figure - @min-size-icon-medium ) / 2 ); // The padding required for the icon to center align with the menu item thumbnail. We calculate the difference in size and add it to the expected spacing.
336 @spacing-typeahead-search-focus-addition: calc( ( @spacing-start-typeahead-search-figure + @min-size-search-figure ) - ( @min-size-icon-medium + @spacing-50 ) ); // The amount the width of the input increases when it is focused to allow for the extra spacing around the search figures. The caret position should remain static. This calculates the padding-left of the input when expanded minus the padding-left of the input when not expanded. (Note that both padding values actually include `@spacing-50` as well, but it was left out of the calculation for simplicity's sake.)
339 // Warning: the following token name is deprecated (Use `color-subtle` instead. Note, that `color-subtle` is using `color.gray600` instead of `color.gray500` now.)
340 @color-base--subtle: var( --color-base--subtle, #54595d );
341 // Warning: the following token name is deprecated (Use `font-family-sans--fallback` instead. See T247166.)
342 @font-family-sans: 'Helvetica Neue', 'Helvetica', 'Liberation Sans', 'Arial', sans-serif;
343 // Warning: the following token name is deprecated (Legacy line-height. Use `line-height-small` instead.)
344 @line-height-x-small: 1.4285714;