2 // Codex Design Tokens v1.3.5
3 // Design System for Wikimedia
4 // See https://doc.wikimedia.org/codex/latest/design-tokens/overview.html
6 @font-size-base: 14px; // This token is targeted exclusively for font-size derived calculations. Apply `font-size-medium` and similar for component font size property use.
7 @font-size-x-small: 0.8571429em; // `x` stands for extra. In this case extra small.
9 @font-size-medium: 1.1428571em;
10 @font-size-large: 1.2857143em;
11 @font-size-x-large: 1.4285714em;
12 @font-size-xx-large: 1.7142857em;
13 @font-size-xxx-large: 2em;
15 @color-base--hover: #404244; // Aimed to be replaced by `color.gray600` in future.
16 @color-emphasized: #000;
17 @color-subtle: #54595d;
18 @color-placeholder: #72777d;
19 @color-disabled: #72777d;
20 @color-inverted: #fff;
21 @color-progressive: #36c; // 'Progressive' Color and states
22 @color-progressive--hover: #447ff5;
23 @color-progressive--active: #2a4b8d;
24 @color-progressive--focus: #36c;
25 @color-destructive: #d73333; // 'Destructive' Color and states
26 @color-destructive--hover: #ff4242;
27 @color-destructive--active: #b32424;
28 @color-destructive--focus: #d73333;
29 @color-visited: #6b4ba1; // 'Visited' color. In combination with progressive. Used for default links.
30 @color-error: #d73333;
31 @color-warning: #edab00; // Note, this is only meant for warning icon for contrast reasons.
32 @color-success: #14866d; // Note, this needs to use a tone darker than Red and Yellow for contrast reasons with background White.
33 @color-notice: #202122;
34 @color-link-red: #d73333; // Red ('new') Link color and states
35 @color-link-red--hover: #ff4242;
36 @color-link-red--active: #b32424;
37 @color-link-red--focus: #d73333;
38 @color-link-red--visited: #a55858;
40 @opacity-medium: 0.65;
42 @opacity-transparent: 0;
43 @filter-invert-icon: 0;
44 @filter-invert-primary-button-icon: 1;
45 @background-position-base: center;
46 @background-size-search-figure: cover; // Use in TypeaheadSearch and Thumbnail components for the thumb container.
47 @z-index-bottom: -100; // Use descriptive `z-index` tokens for layout purposes.
49 @z-index-above-content: 1;
51 @z-index-dropdown: 50;
54 @z-index-off-canvas-backdrop: 300;
55 @z-index-off-canvas: 350;
56 @z-index-overlay-backdrop: 400;
57 @z-index-overlay: 450;
58 @z-index-tooltip: 800;
59 @z-index-toast-notification: 900;
61 @z-index-stacking-0: 0; // Use stacking-specific z-index tokens inside components to layer individual elements.
62 @z-index-stacking-1: 1;
63 @z-index-stacking-2: 2;
64 @z-index-stacking-3: 3;
65 @box-sizing-base: border-box;
68 @size-12: 0.1428571em;
69 @size-25: 0.2857143em;
70 @size-50: 0.5714286em;
71 @size-75: 0.8571429em;
72 @size-100: 1.1428571em;
73 @size-125: 1.4285714em;
74 @size-150: 1.7142857em;
75 @size-200: 2.2857143em;
76 @size-250: 2.8571429em;
77 @size-275: 3.1428571em;
78 @size-300: 3.4285714em;
79 @size-400: 4.5714286em;
80 @size-800: 9.1428571em;
81 @size-1600: 18.2857143em;
82 @size-2400: 27.4285714em;
84 @size-3200: 36.5714286em;
86 @size-viewport-width-full: 100vw;
87 @size-viewport-height-full: 100vh;
88 @size-absolute-1: 1px;
89 @size-absolute-9999: 9999px;
94 @size-search-figure: 2.8571429em; // Alias for use in TypeaheadSearch and Thumbnail components for the same purpose and for better code readability.
95 @size-icon-x-small: 0.8571429em;
96 @size-icon-small: 1.1428571em;
97 @size-icon-medium: 1.4285714em;
98 @max-width-base: none;
99 @max-width-breakpoint-mobile: calc( 640px - 1px ); // A mobile device's maximum available screen width. Many older feature phones have screens smaller than this value.
100 @max-width-breakpoint-tablet: calc( 1120px - 1px ); // A tablet device's maximum available screen width. Note, the size chosen is eager to be re-evaluated with Web team and Product Analytics.
101 @max-width-breakpoint-desktop: calc( 1680px - 1px ); // A desktop device's maximum available screen width.
102 @max-width-button: 32em; // Note, that this is a slight amendment from WikimediaUI Base from `28.75em` = `460px` to `448px` – `dimension.2800`
103 @border-style-base: solid;
104 @border-style-dashed: dashed;
105 @box-shadow-drop-small: 0 1px 1px rgba( 0, 0, 0, 0.2 ); // This features color as part of the theme token value.
106 @box-shadow-drop-medium: 0 2px 2px 0 rgba( 0, 0, 0, 0.2 ); // This features color as part of the theme token value.
107 @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.
108 @box-shadow-inset-small: inset 0 0 0 1px;
109 @box-shadow-inset-medium: inset 0 0 0 2px;
110 @box-shadow-inset-medium-vertical: inset 0 -2px 0 0;
111 @box-shadow-outset-small: 0 0 0 1px;
112 @box-shadow-outset-small-top: 0 -1px 0 0;
113 @box-shadow-outset-small-start: -1px 0 0 0;
114 @box-shadow-color-base: #000;
115 @box-shadow-color-progressive--active: #2a4b8d;
116 @box-shadow-color-progressive--focus: #36c;
117 @box-shadow-color-progressive-selected: #36c;
118 @box-shadow-color-progressive-selected--hover: #447ff5;
119 @box-shadow-color-progressive-selected--active: #2a4b8d;
120 @box-shadow-color-destructive--focus: #d73333;
121 @box-shadow-color-inverted: #fff;
122 @box-shadow-color-transparent: transparent;
123 @font-family-serif: 'Linux Libertine', 'Georgia', 'Times', 'Source Serif Pro', serif;
124 @font-family-monospace: 'Menlo', 'Consolas', 'Liberation Mono', 'Fira Code', 'Courier New', monospace;
125 @font-family-base: sans-serif; // Reference Vector's default fallback sans instead of the deprecated value `font-family-sans` in WikimediaUI Base.
126 @font-family-system-sans: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Inter', 'Helvetica', 'Arial', sans-serif;
127 @font-family-sans--fallback: sans-serif;
128 @font-family-serif--fallback: serif;
129 @font-family-monospace--fallback: monospace, monospace;
130 @font-family-heading-main: 'Linux Libertine', 'Georgia', 'Times', 'Source Serif Pro', serif; // Legacy value from WikimediaUI Base. Use for first heading special treatment.
131 @font-weight-hairline: 100;
132 @font-weight-light: 300;
133 @font-weight-normal: 400;
134 @font-weight-semi-bold: 600;
135 @font-weight-bold: 700;
136 @line-height-xxx-small: 1.25; // `x` stands for extra. In this case extra-extra-extra small.
137 @line-height-xx-small: 1.375;
138 @line-height-small: 1.5714285;
139 @line-height-medium: 1.6;
140 @text-decoration-none: none;
141 @text-decoration-line-through: line-through;
142 @text-decoration-underline: underline;
143 @text-overflow-clip: clip;
144 @text-overflow-ellipsis: ellipsis;
146 @transition-duration-base: 100ms;
147 @transition-duration-medium: 250ms;
148 @transition-property-base: background-color, color, border-color, box-shadow;
149 @transition-property-fade: opacity;
150 @transition-property-icon: color;
151 @transition-property-icon-css-only: background-color;
152 @transition-property-toggle-switch-grip: background-color, border-color, transform;
153 @transition-timing-function-system: ease;
154 @transition-timing-function-user: ease-out;
155 @animation-delay-none: 0ms;
156 @animation-delay-medium: -160ms;
157 @animation-delay-slow: -330ms;
158 @animation-duration-medium: 1600ms;
159 @animation-duration-slow: 2000ms;
160 @animation-timing-function-base: linear;
161 @animation-timing-function-bouncing: ease-in-out;
162 @animation-iteration-count-base: infinite;
163 @cursor-base: default;
164 @cursor-base--disabled: default;
165 @cursor-base--hover: pointer;
167 @cursor-grabbing: grabbing;
170 @cursor-not-allowed: not-allowed;
171 @cursor-resize-nesw: nesw-resize;
172 @cursor-resize-nwse: nwse-resize;
174 @cursor-zoom-in: zoom-in;
175 @cursor-zoom-out: zoom-out;
178 @accent-color-base: #36c;
179 @background-color-interactive: #eaecf0;
180 @background-color-interactive-subtle: #f8f9fa;
181 @background-color-disabled: #c8ccd1; // Components like Buttons, Checkboxes, Radios, ProgressBars….
182 @background-color-disabled-subtle: #eaecf0; // Components like TextInputs, Selects….
183 @background-color-progressive: #36c;
184 @background-color-progressive--hover: #447ff5;
185 @background-color-progressive--active: #2a4b8d;
186 @background-color-progressive--focus: #36c;
187 @background-color-progressive-subtle: #eaf3ff;
188 @background-color-destructive: #d73333;
189 @background-color-destructive--hover: #ff4242;
190 @background-color-destructive--active: #b32424;
191 @background-color-destructive--focus: #d73333;
192 @background-color-destructive-subtle: #fee7e6;
193 @background-color-error: #d73333;
194 @background-color-error--hover: #ff4242;
195 @background-color-error--active: #b32424;
196 @background-color-error-subtle: #fee7e6;
197 @background-color-warning-subtle: #fef6e7;
198 @background-color-success-subtle: #d5fdf4;
199 @background-color-notice-subtle: #eaecf0;
200 @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.
201 @background-color-backdrop-dark: rgba( 0, 0, 0, 0.65 );
202 @background-color-base: #fff; // Background Colors for static elements (for page layout, sections, etc.) from here on.
203 @background-color-neutral: #eaecf0;
204 @background-color-neutral-subtle: #f8f9fa;
205 @background-color-transparent: transparent;
206 @background-color-button-quiet--hover: rgba( 0, 24, 73, 0.027 );
207 @background-color-button-quiet--active: rgba( 0, 24, 73, 0.082 );
208 @background-color-input-binary--checked: #36c;
209 @background-color-tab-list-item-framed--hover: rgba( 255, 255, 255, 0.3 );
210 @background-color-tab-list-item-framed--active: rgba( 255, 255, 255, 0.65 );
211 @opacity-icon-base: 0.87;
212 @opacity-icon-base--hover: 0.74;
213 @opacity-icon-base--selected: 1;
214 @opacity-icon-base--disabled: 0.51;
215 @opacity-icon-placeholder: 0.51;
216 @opacity-icon-subtle: 0.67;
217 @min-size-interactive-pointer: 32px;
218 @min-size-interactive-touch: 44px;
219 @min-size-search-figure: 40px; // Alias for use in TypeaheadSearch and Thumbnail components for the same purpose and for better code readability.
220 @min-size-icon-x-small: 12px;
221 @min-size-icon-small: 16px;
222 @min-size-icon-medium: 20px;
223 @min-size-input-binary: 20px;
224 @min-size-toggle-switch-grip: 20px;
225 @min-width-medium: 256px;
226 @min-width-breakpoint-mobile: 320px; // A mobile device's minimum available screen width. Many older feature phones have screens smaller than this value.
227 @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.
228 @min-width-breakpoint-desktop: 1120px; // A desktop device's minimum available screen width.
229 @min-width-breakpoint-desktop-wide: 1680px; // A wider desktop's minimum available screen width.
230 @min-width-toggle-switch: 48px;
231 @position-offset-border-width-base: -1px;
232 @position-offset-input-radio--focus: -0.2857143em;
236 @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.
237 @spacing-35: 6px; // This token is an exception to the scale. Used as `padding` of the ToggleSwitch component.
247 @spacing-half: 50%; // From here on, spacing tokens which are used for positioning values.
249 @spacing-horizontal-button: 12px - 1px; // Padding should equal 12px of spacing minus the width of the border
250 @spacing-horizontal-button-icon-only: 6px - 1px; // Padding should equal 6px of spacing minus the width of the border
251 @spacing-horizontal-button-large: 16px - 1px; // Padding should equal 16px of spacing minus the width of the border
252 @spacing-horizontal-input-text-two-end-icons: calc( 8px * 2 + 1.1428571em ); // 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.
253 @spacing-start-typeahead-search-figure: 12px; // 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.
254 @spacing-start-typeahead-search-icon: calc( 12px + ( 40px - 20px ) / 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.
255 @spacing-typeahead-search-focus-addition: calc( ( 12px + 40px ) - ( 20px + 8px ) ); // 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.)
256 @border-width-base: 1px;
257 @border-width-thick: 2px;
258 @border-width-input-radio--checked: 6px;
259 @border-color-base: #a2a9b1;
260 @border-color-interactive: #72777d;
261 @border-color-disabled: #c8ccd1;
262 @border-color-subtle: #c8ccd1;
263 @border-color-muted: #eaecf0;
264 @border-color-inverted: #fff;
265 @border-color-progressive: #36c;
266 @border-color-progressive--hover: #447ff5;
267 @border-color-progressive--active: #2a4b8d;
268 @border-color-progressive--focus: #36c;
269 @border-color-destructive: #d73333;
270 @border-color-destructive--hover: #ff4242;
271 @border-color-destructive--active: #b32424;
272 @border-color-destructive--focus: #d73333;
273 @border-color-error: #b32424;
274 @border-color-error--hover: #ff4242;
275 @border-color-warning: #a66200;
276 @border-color-success: #096450;
277 @border-color-notice: #54595d;
278 @border-color-transparent: transparent;
279 @border-color-divider: #a2a9b1;
280 @border-color-input--hover: #72777d;
281 @border-color-input-binary: #72777d;
282 @border-color-input-binary--hover: #447ff5;
283 @border-color-input-binary--active: #2a4b8d;
284 @border-color-input-binary--focus: #36c;
285 @border-color-input-binary--checked: #36c;
286 @border-base: 1px solid #a2a9b1;
287 @border-subtle: 1px solid #c8ccd1;
288 @border-progressive: 1px solid #36c;
289 @border-destructive: 1px solid #d73333;
290 @border-radius-base: 2px;
291 @border-radius-sharp: 0;
292 @border-radius-pill: 9999px;
293 @border-radius-circle: 50%; // Use `50%` for circle or ellipsis. See https://stackoverflow.com/a/29966500
294 @outline-base--focus: 1px solid transparent; // Enable Windows high contrast mode on certain widgets, that have default outlines overridden.
295 @outline-color-progressive--focus: #36c; // Use in places where no more customized focus styles are provided, for example on generic `:focus`.
296 @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>' );
297 @min-height-text-area: 64px;
298 @min-height-table-header: 64px;
299 @min-height-table-footer: 64px;
302 // Warning: the following token name is deprecated (Use `color-subtle` instead. Note, that `color-subtle` is using `color.gray600` instead of `color.gray500` now.)
303 @color-base--subtle: #72777d;
304 // Warning: the following token name is deprecated (Use `font-family-sans--fallback` instead. See T247166.)
305 @font-family-sans: 'Helvetica Neue', 'Helvetica', 'Liberation Sans', 'Arial', sans-serif;
306 // Warning: the following token name is deprecated (Legacy line-height. Use `line-height-small` instead.)
307 @line-height-x-small: 1.4285714;
308 // Warning: the following token name is deprecated (No replacement for this token. Only used in non-Codex products and design decision is to need to rely on background for this state.)
309 @background-color-primary--hover: rgba( 51, 102, 204, 0.1 );
310 // Warning: the following token name is deprecated, use min-width-breakpoint-mobile instead. (Legacy breakpoint. Use `min-width`/`max-width` breakpoint token instead. A mobile device's screen width. Many older feature phones have screens smaller than this value.)
311 @width-breakpoint-mobile: 320px;
312 // Warning: the following token name is deprecated (Legacy breakpoint. Use `min-width`/`max-width` breakpoint token instead. A tablet device's screen width.)
313 @width-breakpoint-tablet: 720px;
314 // Warning: the following token name is deprecated (Legacy breakpoint. Use `min-width`/`max-width` breakpoint token instead. A desktop device's screen width.)
315 @width-breakpoint-desktop: 1000px;
316 // Warning: the following token name is deprecated (Legacy breakpoint. Use `min-width`/`max-width` breakpoint token instead. A wider desktop's screen width.)
317 @width-breakpoint-desktop-wide: 1200px;
318 // Warning: the following token name is deprecated (Legacy breakpoint. Use `min-width`/`max-width` breakpoint token instead. An extra wide desktop's screen width.)
319 @width-breakpoint-desktop-extrawide: 2000px;