UNPKG

11.7 kBSCSSView Raw
1@import 'functions';
2@import '../../dist/tokens/scss/tokens';
3
4// Layout
5$grid-size: px-to-rem(8px);
6$gl-spacing-scale-1: 0.25 * $grid-size;
7$gl-spacing-scale-2: 0.5 * $grid-size;
8$gl-spacing-scale-3: $grid-size;
9$gl-spacing-scale-4: 1.5 * $grid-size;
10$gl-spacing-scale-5: 2 * $grid-size;
11$gl-spacing-scale-6: 3 * $grid-size;
12$gl-spacing-scale-7: 4 * $grid-size;
13$gl-spacing-scale-8: 5 * $grid-size;
14$gl-spacing-scale-9: 6 * $grid-size;
15$gl-spacing-scale-10: 7 * $grid-size;
16$gl-spacing-scale-11: 8 * $grid-size;
17$gl-spacing-scale-11-5: 9 * $grid-size;
18$gl-spacing-scale-12: 10 * $grid-size;
19$gl-spacing-scale-13: 12 * $grid-size;
20$gl-spacing-scale-15: 15 * $grid-size;
21$gl-spacing-scale-18: 18 * $grid-size;
22$gl-spacing-scale-20: 20 * $grid-size;
23$gl-spacing-scale-26: 26 * $grid-size;
24$gl-spacing-scale-28: 28 * $grid-size;
25$gl-spacing-scale-30: 30 * $grid-size;
26$gl-spacing-scale-31: 31 * $grid-size;
27$gl-spacing-scale-33: 33 * $grid-size;
28$gl-spacing-scale-34: 34 * $grid-size;
29$gl-spacing-scale-37: 37 * $grid-size;
30$gl-spacing-scale-48: 48 * $grid-size;
31$gl-spacing-scale-62: 62 * $grid-size;
32$gl-spacing-scale-75: 75 * $grid-size;
33$gl-spacing-scale-80: 80 * $grid-size;
34$gl-spacing-scale-88: 88 * $grid-size;
35
36// Responsive breakpoints
37
38$breakpoint-sm: 576px;
39$breakpoint-md: 768px;
40$breakpoint-lg: 992px;
41$breakpoint-xl: 1200px;
42
43$breakpoints: (
44 xs: 0,
45 sm: $breakpoint-sm,
46 md: $breakpoint-md,
47 lg: $breakpoint-lg,
48 xl: $breakpoint-xl,
49);
50
51// Max widths
52$limited-layout-width: 990px !default;
53$container-xl: 1280px !default;
54
55// Color schema
56$black-normal: #333 !default;
57
58$white-contrast: #fff !default;
59$white-normal: #f0f0f0 !default;
60$white-dark: #eaeaea !default;
61$white-transparent: rgba(255, 255, 255, 0.8) !default;
62$transparent-rgba: rgba($white, 0);
63
64// Text
65$gl-text-color: $gray-900 !default;
66$gl-text-color-secondary: $gray-500 !default;
67$gl-text-color-disabled: $gray-400 !default;
68
69$gl-font-weight-light: 300;
70$gl-font-weight-normal: 400;
71$gl-font-weight-semibold: 500;
72$gl-font-weight-bold: 600;
73
74$gl-font-weights: (
75 'normal': $gl-font-weight-normal,
76 'bold': $gl-font-weight-bold,
77);
78
79// Fonts
80$gl-monospace-font: 'GitLab Mono', 'JetBrains Mono', 'Menlo', 'DejaVu Sans Mono', 'Liberation Mono',
81 'Consolas', 'Ubuntu Mono', 'Courier New', 'andale mono', 'lucida console', monospace !default;
82$gl-regular-font: 'GitLab Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans',
83 Ubuntu, Cantarell, 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
84 'Segoe UI Symbol', 'Noto Color Emoji' !default;
85
86$gl-fonts: (
87 'monospace': $gl-monospace-font,
88 'regular': $gl-regular-font,
89);
90
91// New UI type scale
92// Implements the type scale from https://gitlab.com/groups/gitlab-org/gitlab-services/-/epics/15
93// Old variables and styles need to be removed after intergration
94
95// Font size scale
96
97// fixed scale (compact markdown)
98$gl-font-sizes-fixed: (
99 100: px-to-rem(12px),
100 200: px-to-rem(13px),
101 300: px-to-rem(14px),
102 400: px-to-rem(16px),
103 500: px-to-rem(18px),
104 600: px-to-rem(21px),
105 700: px-to-rem(24px),
106 800: px-to-rem(28px),
107);
108
109// dynamic scale (default) resizes based on viewport width
110$gl-font-sizes: (
111 100: map-get($gl-font-sizes-fixed, 100),
112 200: map-get($gl-font-sizes-fixed, 200),
113 300: map-get($gl-font-sizes-fixed, 300),
114 400: map-get($gl-font-sizes-fixed, 400),
115 500: clamp-between(map-get($gl-font-sizes-fixed, 500), px-to-rem(20px)),
116 600: clamp-between(map-get($gl-font-sizes-fixed, 600), px-to-rem(25px)),
117 700: clamp-between(map-get($gl-font-sizes-fixed, 700), px-to-rem(30px)),
118 800: clamp-between(map-get($gl-font-sizes-fixed, 800), px-to-rem(36px)),
119);
120
121// Heading variables
122// Not all are currently used, but documented here to capture intent
123$gl-font-heading: $gl-regular-font;
124$gl-font-weight-heading: 600;
125$gl-letter-spacing-heading: inherit;
126$gl-letter-spacing-heading-reduced: -0.01em;
127$gl-line-height-heading: 1.25;
128$gl-line-height-heading-display: 1.125;
129$gl-mb-heading: $gl-spacing-scale-5;
130$gl-mb-heading-display: $gl-spacing-scale-6;
131$gl-text-color-heading: $gl-text-color;
132// Not yet supported, but we'll be ready
133$gl-text-wrap-heading: pretty;
134
135// END New UI type scale
136
137// UI typescale
138
139// default (min-width: 0)
140$gl-font-size: px-to-rem(14px);
141$gl-font-size-xs: px-to-rem(10px);
142$gl-font-size-sm: px-to-rem(12px);
143$gl-font-size-lg: px-to-rem(16px);
144
145$gl-font-size-h-display: px-to-rem(28px);
146$gl-font-size-h1: px-to-rem(23px);
147$gl-font-size-h2: px-to-rem(19px);
148
149// breakpoint (min-width: 768px)
150$gl-font-size-h-display-md: px-to-rem(31px);
151$gl-font-size-h1-md: px-to-rem(25px);
152$gl-font-size-h2-md: px-to-rem(20px);
153
154// breakpoint (min-width: 1200px)
155$gl-font-size-h-display-xl: px-to-rem(45px);
156$gl-font-size-h1-xl: px-to-rem(32px);
157$gl-font-size-h2-xl: px-to-rem(23px);
158
159// Markdown typescale
160
161// default (min-width: 0)
162$gl-font-size-markdown: px-to-rem(16px);
163$gl-font-size-markdown-sm: px-to-rem(14px);
164
165$gl-font-size-markdown-h1: px-to-rem(28px);
166$gl-font-size-markdown-h2: px-to-rem(23px);
167$gl-font-size-markdown-h3: px-to-rem(19px);
168
169// breakpoint (min-width: 768px)
170$gl-font-size-markdown-h1-md: px-to-rem(31px);
171$gl-font-size-markdown-h2-md: px-to-rem(25px);
172$gl-font-size-markdown-h3-md: px-to-rem(20px);
173
174// breakpoint (min-width: 1200px)
175$gl-font-size-markdown-h1-xl: px-to-rem(45px);
176$gl-font-size-markdown-h2-xl: px-to-rem(32px);
177$gl-font-size-markdown-h3-xl: px-to-rem(23px);
178
179// Compact markdown typescale
180
181// default (min-width: 0)
182$gl-font-size-compact-markdown-h1: px-to-rem(19px);
183
184// media-md: min-width: 768px
185$gl-font-size-compact-markdown-h1-md: px-to-rem(20px);
186
187// media xl (min-width: 1200px)
188$gl-font-size-compact-markdown-h1-xl: px-to-rem(23px);
189
190$border-color: $gray-100 !default;
191
192// use px for borders rather than rem
193// we don't want borders to scale with font size
194// 1px can end up being rounded to 0 after
195// conversion to/from rem
196$gl-border-size-1: 1px;
197$gl-border-size-2: 2px;
198$gl-border-size-3: 3px;
199$gl-border-size-4: 4px;
200$gl-border-size-5: 5px;
201$gl-border-size-8: 8px;
202
203// border roundness
204$gl-border-radius-small: $gl-spacing-scale-1;
205$gl-border-radius-base: $gl-spacing-scale-2;
206$gl-border-radius-large: $gl-spacing-scale-3;
207$gl-border-radius-6: $gl-spacing-scale-6;
208$gl-border-radius-7: $gl-spacing-scale-7;
209$gl-border-radius-full: 50%;
210
211// transition parameters
212$gl-transition-duration-slow: 0.4s;
213$gl-transition-duration-medium: 0.2s;
214$gl-transition-duration-fast: 0.1s;
215
216// Animation easings
217$gl-easing-linear: linear;
218$gl-easing-default: ease;
219$gl-easing-out-cubic: cubic-bezier(0.22, 0.61, 0.36, 1);
220
221// Focus ring
222$outline-offset: 1px;
223$outline-width: 2px;
224$outline: #{$outline-offset + $outline-width};
225$focus-ring: 0 0 0 $outline-offset $white, 0 0 0 #{$outline-offset + $outline-width} $blue-400;
226$focus-ring-inset: inset 0 0 0 #{$outline-width + $outline-offset} $white,
227 inset 0 0 0 $outline-offset $white;
228$focus-ring-dark: 0 0 0 $outline-offset rgba($black, 0.6),
229 0 0 0 #{$outline-offset + $outline-width} $blue-300;
230$focus-ring-outline: $outline-width solid $blue-400;
231
232// Toasts
233$toast-max-width: px-to-rem(586px);
234$toast-padding-right: px-to-rem(42px);
235$toast-background-color: #303030;
236
237// Chart tooltip
238$chart-tooltip-max-width: px-to-rem(512px);
239
240$gl-icon-chevron-left: 'data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 0 0 0 1.414l3 3a1 1 0 0 0 1.414-1.414L7.414 8l2.293-2.293a1 1 0 0 0-1.414-1.414l-3 3z"/></svg>';
241$gl-icon-chevron-right: 'data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path fill-rule="evenodd" d="M10.707 7.293a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 8 6.293 5.707a1 1 0 0 1 1.414-1.414l3 3z"/></svg>';
242$gl-icon-chevron-down: 'data:image/svg+xml;utf8,<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path fill-rule="evenodd" d="M7.293 10.707a1 1 0 0 0 1.414 0l3-3a1 1 0 0 0-1.414-1.414L8 8.586 5.707 6.293a1 1 0 0 0-1.414 1.414l3 3z"/></svg>';
243$gl-icon-select-chevron-down: 'data:image/svg+xml,%3Csvg width="8" height="5" viewBox="0 0 8 5" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill-rule="evenodd" clip-rule="evenodd" d="M0.21967 0.21967C0.512563 -0.0732232 0.987437 -0.0732232 1.28033 0.21967L4 2.93934L6.71967 0.21967C7.01256 -0.073223 7.48744 -0.0732229 7.78033 0.21967C8.07322 0.512563 8.07322 0.987437 7.78033 1.28033L4.53033 4.53033C4.23744 4.82322 3.76256 4.82322 3.46967 4.53033L0.21967 1.28033C-0.0732233 0.987437 -0.0732233 0.512563 0.21967 0.21967Z" fill="%23666666"/%3E%3C/svg%3E%0A';
244$gl-icon-check: 'data:image/svg+xml,%3Csvg width="10" height="8" viewBox="0 0 10 8" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M0.75 4.76289L3.15312 7.24678L9.25 1.1499" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E%0A';
245$gl-icon-indeterminate: 'data:image/svg+xml,%3Csvg width="10" height="2" viewBox="0 0 10 2" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M1.75 1H8.25" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E%0A';
246$gl-icon-radio: 'data:image/svg+xml,%3Csvg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Ccircle cx="3" cy="3" r="3" fill="white"/%3E%3C/svg%3E%0A';
247
248// Icons
249$default-icon-size: px-to-rem(16px);
250$gl-icon-sizes: 8 12 14 16 24 32 48 72;
251
252// Dropdowns
253$gl-dropdown-width: px-to-rem(240px);
254$gl-new-dropdown-min-width: px-to-rem(248px);
255$gl-new-dropdown-max-width: px-to-rem(456px);
256$gl-dropdown-width-narrow: px-to-rem(160px);
257$gl-dropdown-width-wide: px-to-rem(400px);
258$gl-max-dropdown-max-height: px-to-rem(312px);
259
260// Broadcast messages
261$gl-broadcast-message-notification-max-width: px-to-rem(300px);
262
263// Modal Widths
264$gl-modal-small-width: px-to-rem(512px);
265$gl-modal-medium-width: px-to-rem(768px);
266$gl-modal-large-width: px-to-rem(990px);
267
268// Modal bootstrap variables
269$modal-header-border-color: $gray-200;
270$modal-footer-border-color: $gray-200;
271$modal-title-line-height: $gl-line-height-20;
272$modal-backdrop-bg: #000;
273$modal-backdrop-opacity: 0.64;
274
275// Bootstrap overrides
276// these should ideally be moved further up in the file to the compoent-relevant sections
277// but they can wait here for now
278$body-color: $gl-text-color !default;
279$enable-validation-icons: false;
280
281$secondary: $gray-50;
282$success: $green-500;
283$info: $blue-500;
284$warning: $orange-500;
285$danger: $red-500;
286
287$font-weight-bold: $gl-font-weight-bold;
288
289$font-family-sans-serif: $gl-regular-font !default;
290$font-family-monospace: $gl-monospace-font !default;
291
292$h1-font-size: $gl-font-size * 2.5;
293$h2-font-size: $gl-font-size * 2;
294$h3-font-size: $gl-font-size * 1.75;
295$h4-font-size: $gl-font-size * 1.5;
296$h5-font-size: $gl-font-size * 1.25;
297$h6-font-size: $gl-font-size;
298
299$spacer: $grid-size;
300$spacers: (
301 1: $gl-spacing-scale-2,
302 2: $gl-spacing-scale-3,
303 3: $gl-spacing-scale-5,
304 4: $gl-spacing-scale-6,
305 5: $gl-spacing-scale-7,
306 6: $gl-spacing-scale-8,
307 7: $gl-spacing-scale-9,
308 8: $gl-spacing-scale-10,
309 9: $gl-spacing-scale-11,
310);
311
312$table-accent-bg: $gray-50;
313$card-border-color: $gray-100;
314$card-cap-bg: $gray-10 !default;
315
316// Form input sizes
317$gl-form-input-sizes: (
318 xs: $grid-size * 10,
319 sm: $grid-size * 20,
320 md: $grid-size * 30,
321 lg: $grid-size * 40,
322 xl: $grid-size * 70,
323);
324
325$popover-bg: $white !default;
326$popover-arrow-width: 0.5rem;
327$popover-arrow-height: 0.25rem;
328$popover-arrow-color: $popover-bg;
329$popover-arrow-outer-color: $gray-100;
330
331$tooltip-opacity: 1;