|
1 | 1 | // Treeherder Bootstrap 5 Customization |
2 | 2 | // This file sets global variables before Bootstrap is imported |
| 3 | +// Using @use instead of deprecated @import (Dart Sass 3.0 compatibility) |
3 | 4 |
|
4 | | -// Typography - Use browser default 16px to match production |
5 | | -$font-size-root: null; // Use browser default 16px root font size |
6 | | -$font-size-base: 1rem; // 16px (match production) |
7 | | -$font-size-sm: 0.875rem; // 14px |
8 | | -$font-size-lg: 1.25rem; // 20px |
| 5 | +// Forward our customizations to Bootstrap using @use with configuration |
| 6 | +@use 'sass:map'; |
9 | 7 |
|
10 | | -// Font family - Match production |
11 | | -$font-family-sans-serif: 'Helvetica Neue', Helvetica, Arial, sans-serif; |
| 8 | +// Bootstrap 5 customization via @use ... with () |
| 9 | +@use '~bootstrap/scss/bootstrap' with ( |
| 10 | + // Typography - Use browser default 16px to match production |
| 11 | + $font-size-root: null, |
| 12 | + $font-size-base: 1rem, |
| 13 | + $font-size-sm: 0.875rem, |
| 14 | + $font-size-lg: 1.25rem, |
12 | 15 |
|
13 | | -// Line heights |
14 | | -$line-height-base: 1.42857143; // Match previous Treeherder line height (19.88px at 14px font) |
| 16 | + // Font family - Match production |
| 17 | + $font-family-sans-serif: ('Helvetica Neue', Helvetica, Arial, sans-serif), |
15 | 18 |
|
16 | | -// Spacing scale - maintain existing spacing |
17 | | -$spacer: 1rem; |
18 | | -$spacers: ( |
19 | | - 0: 0, |
20 | | - 1: $spacer * 0.25, |
21 | | - // 0.25rem = 4px |
22 | | - 2: $spacer * 0.5, |
23 | | - // 0.5rem = 8px |
24 | | - 3: $spacer * 0.75, |
25 | | - // 0.75rem = 12px |
26 | | - 4: $spacer, |
27 | | - // 1rem = 16px |
28 | | - 5: $spacer * 1.5, |
29 | | - // 1.5rem = 24px |
30 | | - 6: $spacer * 7.5, |
31 | | - // 7.5rem = 120px |
32 | | -); |
33 | | - |
34 | | -// Buttons - maintain original sizing |
35 | | -$btn-padding-y: 0.375rem; |
36 | | -$btn-padding-x: 0.75rem; |
37 | | -$btn-font-size: $font-size-base; |
38 | | -$btn-line-height: 1.5; |
39 | | - |
40 | | -$btn-padding-y-sm: 0.25rem; |
41 | | -$btn-padding-x-sm: 0.5rem; |
42 | | -$btn-font-size-sm: $font-size-sm; // 12px |
| 19 | + // Line heights |
| 20 | + $line-height-base: 1.42857143, |
43 | 21 |
|
44 | | -$btn-padding-y-lg: 0.5rem; |
45 | | -$btn-padding-x-lg: 1rem; |
46 | | -$btn-font-size-lg: $font-size-lg; // 16px |
| 22 | + // Spacing scale - maintain existing spacing |
| 23 | + $spacer: 1rem, |
| 24 | + $spacers: ( |
| 25 | + 0: 0, |
| 26 | + 1: 0.25rem, |
| 27 | + 2: 0.5rem, |
| 28 | + 3: 0.75rem, |
| 29 | + 4: 1rem, |
| 30 | + 5: 1.5rem, |
| 31 | + 6: 7.5rem, |
| 32 | + ), |
47 | 33 |
|
48 | | -// Form controls |
49 | | -$input-padding-y: 0.375rem; |
50 | | -$input-padding-x: 0.75rem; |
51 | | -$input-font-size: $font-size-base; |
52 | | -$input-line-height: 1.5; |
| 34 | + // Buttons - maintain original sizing |
| 35 | + $btn-padding-y: 0.375rem, |
| 36 | + $btn-padding-x: 0.75rem, |
| 37 | + $btn-font-size: 1rem, |
| 38 | + $btn-line-height: 1.5, |
| 39 | + $btn-padding-y-sm: 0.25rem, |
| 40 | + $btn-padding-x-sm: 0.5rem, |
| 41 | + $btn-font-size-sm: 0.875rem, |
| 42 | + $btn-padding-y-lg: 0.5rem, |
| 43 | + $btn-padding-x-lg: 1rem, |
| 44 | + $btn-font-size-lg: 1.25rem, |
53 | 45 |
|
54 | | -$input-padding-y-sm: 0.25rem; |
55 | | -$input-padding-x-sm: 0.5rem; |
56 | | -$input-font-size-sm: $font-size-sm; // 12px |
| 46 | + // Form controls |
| 47 | + $input-padding-y: 0.375rem, |
| 48 | + $input-padding-x: 0.75rem, |
| 49 | + $input-font-size: 1rem, |
| 50 | + $input-line-height: 1.5, |
| 51 | + $input-padding-y-sm: 0.25rem, |
| 52 | + $input-padding-x-sm: 0.5rem, |
| 53 | + $input-font-size-sm: 0.875rem, |
57 | 54 |
|
58 | | -// Links |
59 | | -$link-color: #337ab7; // Treeherder link color from treeherder-base.css |
60 | | -$link-decoration: none; |
61 | | -$link-hover-decoration: none; |
| 55 | + // Links |
| 56 | + $link-color: #337ab7, |
| 57 | + $link-decoration: none, |
| 58 | + $link-hover-decoration: none, |
62 | 59 |
|
63 | | -// Navbar |
64 | | -$navbar-dark-color: rgba(255, 255, 255, 0.75); |
65 | | -$navbar-dark-hover-color: rgba(255, 255, 255, 0.9); |
66 | | -$navbar-dark-active-color: #fff; |
67 | | -$navbar-padding-y: 0; |
68 | | -$navbar-padding-x: 0; |
| 60 | + // Navbar |
| 61 | + $navbar-dark-color: rgba(255, 255, 255, 0.75), |
| 62 | + $navbar-dark-hover-color: rgba(255, 255, 255, 0.9), |
| 63 | + $navbar-dark-active-color: #fff, |
| 64 | + $navbar-padding-y: 0, |
| 65 | + $navbar-padding-x: 0, |
69 | 66 |
|
70 | | -// Dropdowns |
71 | | -$dropdown-font-size: $font-size-base; |
72 | | -$dropdown-item-padding-y: 0.5rem; |
73 | | -$dropdown-item-padding-x: 1rem; |
74 | | - |
75 | | -// Import Bootstrap 5 with customizations |
76 | | -// Using @use would require restructuring the entire import |
77 | | -// For now, suppress the deprecation warning via sass-loader options |
78 | | -@import '~bootstrap/scss/bootstrap'; |
| 67 | + // Dropdowns |
| 68 | + $dropdown-font-size: 1rem, |
| 69 | + $dropdown-item-padding-y: 0.5rem, |
| 70 | + $dropdown-item-padding-x: 1rem |
| 71 | +); |
0 commit comments