|
| 1 | +/******************************************************************************* |
| 2 | + * Charts Button Component |
| 3 | + * |
| 4 | + * Uses Build Canada design system styling with square corners and brand colors. |
| 5 | + ******************************************************************************/ |
| 6 | + |
1 | 7 | .charts-btn { |
2 | 8 | @include body-3-medium; |
3 | | - padding: 8.5px 24px; |
4 | | - border: 1px solid transparent; |
| 9 | + display: inline-flex; |
| 10 | + align-items: center; |
| 11 | + justify-content: center; |
| 12 | + gap: 8px; |
| 13 | + padding: 10px 24px; |
| 14 | + border: 2px solid transparent; |
5 | 15 | border-radius: 0; |
6 | 16 | text-align: center; |
7 | | - display: block; |
8 | 17 | cursor: pointer; |
| 18 | + transition: all 150ms ease; |
| 19 | + white-space: nowrap; |
| 20 | + text-transform: uppercase; |
| 21 | + letter-spacing: 0.05em; |
| 22 | + font-weight: 500; |
| 23 | + |
| 24 | + &:focus-visible { |
| 25 | + outline: 2px solid $auburn; |
| 26 | + outline-offset: 2px; |
| 27 | + } |
9 | 28 |
|
10 | 29 | &.charts-btn--icon-only { |
11 | | - padding: 4.5px 9px; |
| 30 | + padding: 8px; |
| 31 | + min-width: 40px; |
| 32 | + min-height: 40px; |
12 | 33 | } |
13 | 34 |
|
14 | | - &:disabled { |
15 | | - cursor: default; |
16 | | - |
17 | | - &.charts-btn--solid-blue, |
18 | | - &.charts-btn--solid-dark-blue, |
19 | | - &.charts-btn--solid-light-blue, |
20 | | - &.charts-btn--solid-vermillion { |
21 | | - color: $blue-50; |
22 | | - background-color: $blue-10; |
23 | | - } |
24 | | - |
25 | | - &.charts-btn--outline-vermillion, |
26 | | - &.charts-btn--outline-white { |
27 | | - color: $blue-40; |
28 | | - border-color: $blue-40; |
29 | | - } |
| 35 | + svg { |
| 36 | + font-size: 0.875em; |
| 37 | + transition: transform 150ms ease; |
30 | 38 | } |
31 | 39 |
|
32 | | - svg { |
33 | | - font-size: 0.75rem; |
| 40 | + // Animated arrow on hover |
| 41 | + &:hover:not(:disabled) svg.icon-right { |
| 42 | + transform: translateX(4px); |
34 | 43 | } |
35 | 44 | } |
36 | 45 |
|
| 46 | +/******************************************************************************* |
| 47 | + * Icon Position Modifiers |
| 48 | + ******************************************************************************/ |
| 49 | + |
37 | 50 | .charts-btn--icon-right { |
38 | | - margin-left: 0.5rem; |
| 51 | + margin-left: 8px; |
39 | 52 | } |
40 | 53 |
|
41 | 54 | .charts-btn--icon-left { |
42 | | - margin-right: 0.5rem; |
| 55 | + margin-right: 8px; |
43 | 56 | } |
44 | 57 |
|
| 58 | +/******************************************************************************* |
| 59 | + * Solid Variants |
| 60 | + ******************************************************************************/ |
| 61 | + |
| 62 | +.charts-btn--solid-auburn, |
45 | 63 | .charts-btn--solid-vermillion { |
46 | | - background-color: $vermillion; |
47 | | - color: #fff; |
| 64 | + background-color: $auburn; |
| 65 | + border-color: $auburn; |
| 66 | + color: $white; |
| 67 | + |
| 68 | + &:hover:not(:disabled) { |
| 69 | + background-color: $auburn-600; |
| 70 | + border-color: $auburn-600; |
| 71 | + } |
48 | 72 |
|
49 | | - &:hover { |
50 | | - background-color: $accent-vermillion; |
| 73 | + &:active:not(:disabled) { |
| 74 | + background-color: $auburn-700; |
| 75 | + border-color: $auburn-700; |
51 | 76 | } |
52 | 77 | } |
53 | 78 |
|
54 | | -.charts-btn--outline-vermillion { |
55 | | - border-color: $vermillion; |
56 | | - color: $vermillion; |
| 79 | +.charts-btn--solid-charcoal { |
| 80 | + background-color: $charcoal; |
| 81 | + border-color: $charcoal; |
| 82 | + color: $white; |
57 | 83 |
|
58 | | - &:hover { |
59 | | - border-color: $accent-vermillion; |
60 | | - color: $accent-vermillion; |
| 84 | + &:hover:not(:disabled) { |
| 85 | + background-color: $gray-70; |
| 86 | + border-color: $gray-70; |
| 87 | + } |
| 88 | + |
| 89 | + &:active:not(:disabled) { |
| 90 | + background-color: $gray-60; |
| 91 | + border-color: $gray-60; |
61 | 92 | } |
62 | 93 | } |
63 | 94 |
|
| 95 | +.charts-btn--solid-cerulean, |
64 | 96 | .charts-btn--solid-blue { |
65 | | - background-color: $blue-60; |
66 | | - color: #fff; |
| 97 | + background-color: $cerulean-500; |
| 98 | + border-color: $cerulean-500; |
| 99 | + color: $white; |
67 | 100 |
|
68 | | - &:hover { |
69 | | - background-color: $blue-90; |
| 101 | + &:hover:not(:disabled) { |
| 102 | + background-color: $cerulean-600; |
| 103 | + border-color: $cerulean-600; |
| 104 | + } |
| 105 | + |
| 106 | + &:active:not(:disabled) { |
| 107 | + background-color: $cerulean-700; |
| 108 | + border-color: $cerulean-700; |
70 | 109 | } |
71 | 110 | } |
72 | 111 |
|
73 | 112 | .charts-btn--solid-dark-blue { |
74 | | - background-color: $blue-95; |
75 | | - color: #fff; |
| 113 | + background-color: $cerulean-900; |
| 114 | + border-color: $cerulean-900; |
| 115 | + color: $white; |
76 | 116 |
|
77 | | - &:hover { |
78 | | - background-color: #164377; |
| 117 | + &:hover:not(:disabled) { |
| 118 | + background-color: $cerulean-950; |
| 119 | + border-color: $cerulean-950; |
79 | 120 | } |
80 | 121 | } |
81 | 122 |
|
82 | 123 | .charts-btn--solid-light-blue { |
83 | | - background-color: $blue-20; |
84 | | - color: $blue-90; |
| 124 | + background-color: $cerulean-100; |
| 125 | + border-color: $cerulean-100; |
| 126 | + color: $cerulean-900; |
| 127 | + |
| 128 | + &:hover:not(:disabled) { |
| 129 | + background-color: $cerulean-200; |
| 130 | + border-color: $cerulean-200; |
| 131 | + } |
| 132 | +} |
| 133 | + |
| 134 | +.charts-btn--solid-linen { |
| 135 | + background-color: $linen; |
| 136 | + border-color: $linen; |
| 137 | + color: $charcoal; |
| 138 | + |
| 139 | + &:hover:not(:disabled) { |
| 140 | + background-color: $gray-20; |
| 141 | + border-color: $gray-20; |
| 142 | + } |
85 | 143 |
|
86 | | - &:hover { |
87 | | - background-color: $blue-10; |
| 144 | + &:active:not(:disabled) { |
| 145 | + background-color: $gray-30; |
| 146 | + border-color: $gray-30; |
| 147 | + } |
| 148 | +} |
| 149 | + |
| 150 | +/******************************************************************************* |
| 151 | + * Outline Variants |
| 152 | + ******************************************************************************/ |
| 153 | + |
| 154 | +.charts-btn--outline-auburn, |
| 155 | +.charts-btn--outline-vermillion { |
| 156 | + background-color: transparent; |
| 157 | + border-color: $auburn; |
| 158 | + color: $auburn; |
| 159 | + |
| 160 | + &:hover:not(:disabled) { |
| 161 | + background-color: $auburn; |
| 162 | + color: $white; |
| 163 | + } |
| 164 | + |
| 165 | + &:active:not(:disabled) { |
| 166 | + background-color: $auburn-600; |
| 167 | + border-color: $auburn-600; |
| 168 | + color: $white; |
| 169 | + } |
| 170 | +} |
| 171 | + |
| 172 | +.charts-btn--outline-charcoal { |
| 173 | + background-color: transparent; |
| 174 | + border-color: $charcoal; |
| 175 | + color: $charcoal; |
| 176 | + |
| 177 | + &:hover:not(:disabled) { |
| 178 | + background-color: $charcoal; |
| 179 | + color: $white; |
| 180 | + } |
| 181 | + |
| 182 | + &:active:not(:disabled) { |
| 183 | + background-color: $gray-70; |
| 184 | + border-color: $gray-70; |
| 185 | + color: $white; |
88 | 186 | } |
89 | 187 | } |
90 | 188 |
|
|
93 | 191 | border-color: $white; |
94 | 192 | color: $white; |
95 | 193 |
|
96 | | - &:hover { |
| 194 | + &:hover:not(:disabled) { |
97 | 195 | background-color: $white; |
98 | | - color: $blue-90; |
| 196 | + color: $charcoal; |
| 197 | + } |
| 198 | + |
| 199 | + &:active:not(:disabled) { |
| 200 | + background-color: $gray-10; |
| 201 | + border-color: $gray-10; |
| 202 | + color: $charcoal; |
99 | 203 | } |
100 | 204 | } |
101 | 205 |
|
| 206 | +.charts-btn--outline-cerulean, |
102 | 207 | .charts-btn--outline-light-blue { |
103 | | - border-color: $blue-20; |
104 | | - color: $blue-90; |
| 208 | + background-color: transparent; |
| 209 | + border-color: $cerulean-500; |
| 210 | + color: $cerulean-700; |
105 | 211 |
|
106 | | - &:hover { |
107 | | - background-color: $white; |
108 | | - color: $blue-90; |
| 212 | + &:hover:not(:disabled) { |
| 213 | + background-color: $cerulean-500; |
| 214 | + color: $white; |
| 215 | + } |
| 216 | + |
| 217 | + &:active:not(:disabled) { |
| 218 | + background-color: $cerulean-600; |
| 219 | + border-color: $cerulean-600; |
| 220 | + color: $white; |
109 | 221 | } |
110 | 222 | } |
| 223 | + |
| 224 | +/******************************************************************************* |
| 225 | + * Disabled State |
| 226 | + ******************************************************************************/ |
| 227 | + |
| 228 | +.charts-btn:disabled { |
| 229 | + opacity: 0.5; |
| 230 | + cursor: not-allowed; |
| 231 | +} |
0 commit comments