|
18 | 18 | */
|
19 | 19 |
|
20 | 20 | .spectrum-Radio {
|
21 |
| - --spectrum-radio-button-background-color: var(--spectrum-gray-50); |
| 21 | + --spectrum-radio-button-background-color: var(--spectrum-gray-25); |
22 | 22 |
|
23 | 23 | /* state colors for all themes */
|
24 | 24 | --spectrum-radio-neutral-content-color: var(--spectrum-neutral-content-color-default);
|
|
36 | 36 | --spectrum-radio-disabled-border-color: var(--spectrum-disabled-content-color);
|
37 | 37 |
|
38 | 38 | /* emphasized state colors selection indicator all themes */
|
39 |
| - --spectrum-radio-emphasized-accent-color: var(--spectrum-accent-color-900); |
40 |
| - --spectrum-radio-emphasized-accent-color-hover: var(--spectrum-accent-color-1000); |
41 |
| - --spectrum-radio-emphasized-accent-color-down: var(--spectrum-accent-color-1100); |
42 |
| - --spectrum-radio-emphasized-accent-color-focus: var(--spectrum-accent-color-1000); |
43 |
| - |
44 |
| - /* unchecked selection indicator */ |
45 |
| - --spectrum-radio-button-border-color-default: var(--spectrum-gray-600); |
46 |
| - --spectrum-radio-button-border-color-hover: var(--spectrum-gray-700); |
47 |
| - --spectrum-radio-button-border-color-down: var(--spectrum-gray-800); |
48 |
| - --spectrum-radio-button-border-color-focus: var(--spectrum-gray-700); |
49 |
| - |
50 |
| - /* checked selection indicator */ |
51 |
| - --spectrum-radio-button-checked-border-color-default: var(--spectrum-neutral-background-color-selected-default); |
52 |
| - --spectrum-radio-button-checked-border-color-hover: var(--spectrum-neutral-background-color-selected-hover); |
53 |
| - --spectrum-radio-button-checked-border-color-down: var(--spectrum-neutral-background-color-selected-down); |
54 |
| - --spectrum-radio-button-checked-border-color-focus: var(--spectrum-neutral-background-color-selected-key-focus); |
| 39 | + --spectrum-radio-emphasized-accent-color: var(--spectrum-accent-content-color-default); |
| 40 | + --spectrum-radio-emphasized-accent-color-hover: var(--spectrum-accent-content-color-hover); |
| 41 | + --spectrum-radio-emphasized-accent-color-down: var(--spectrum-accent-content-color-down); |
| 42 | + --spectrum-radio-emphasized-accent-color-focus: var(--spectrum-accent-content-color-key-focus); |
| 43 | + |
| 44 | + /* radio checked/unchecked selection indicator */ |
| 45 | + --spectrum-radio-button-border-color-default: var(--spectrum-neutral-content-color-default); |
| 46 | + --spectrum-radio-button-border-color-hover: var(--spectrum-neutral-content-color-hover); |
| 47 | + --spectrum-radio-button-border-color-down: var(--spectrum-neutral-content-color-down); |
| 48 | + --spectrum-radio-button-border-color-focus: var(--spectrum-neutral-content-color-key-focus); |
55 | 49 |
|
56 | 50 | --spectrum-radio-line-height: var(--spectrum-line-height-100);
|
57 | 51 |
|
|
67 | 61 | --spectrum-radio-button-top-to-control: var(--spectrum-radio-button-top-to-control-medium);
|
68 | 62 |
|
69 | 63 | --spectrum-radio-font-size: var(--spectrum-font-size-100);
|
| 64 | + --spectrum-radio-border-width: var(--spectrum-border-width-200); |
| 65 | + --spectrum-radio-text-font-weight: var(--spectrum-regular-font-weight); |
| 66 | + --spectrum-radio-text-font-style: var(--spectrum-default-font-style); |
70 | 67 |
|
71 | 68 | /* CJK language support all themes */
|
72 | 69 | &:lang(ja),
|
|
112 | 109 | --spectrum-radio-font-size: var(--spectrum-font-size-300);
|
113 | 110 | }
|
114 | 111 |
|
115 |
| -/* windows high contrast mode */ |
116 |
| -@media (forced-colors: active) { |
117 |
| - .spectrum-Radio { |
118 |
| - --highcontrast-radio-button-background-color: ButtonFace; |
119 |
| - |
120 |
| - /* high contrast text */ |
121 |
| - --highcontrast-radio-neutral-content-color: CanvasText; |
122 |
| - --highcontrast-radio-neutral-content-color-hover: CanvasText; |
123 |
| - --highcontrast-radio-neutral-content-color-down: CanvasText; |
124 |
| - --highcontrast-radio-neutral-content-color-focus: CanvasText; |
125 |
| - |
126 |
| - /* high contrast selector */ |
127 |
| - --highcontrast-radio-button-border-color-default: ButtonText; |
128 |
| - --highcontrast-radio-button-border-color-hover: Highlight; |
129 |
| - --highcontrast-radio-button-border-color-down: ButtonText; |
130 |
| - --highcontrast-radio-button-border-color-focus: Highlight; |
131 |
| - |
132 |
| - /* high contrast emphasized selector */ |
133 |
| - --highcontrast-radio-emphasized-accent-color: ButtonText; |
134 |
| - --highcontrast-radio-emphasized-accent-color-hover: Highlight; |
135 |
| - --highcontrast-radio-emphasized-accent-color-down: ButtonText; |
136 |
| - --highcontrast-radio-emphasized-accent-color-focus: Highlight; |
137 |
| - |
138 |
| - /* high contrast checked selector */ |
139 |
| - --highcontrast-radio-button-checked-border-color-default: Highlight; |
140 |
| - --highcontrast-radio-button-checked-border-color-hover: Highlight; |
141 |
| - --highcontrast-radio-button-checked-border-color-down: Highlight; |
142 |
| - --highcontrast-radio-button-checked-border-color-focus: Highlight; |
143 |
| - |
144 |
| - /* high contrast disabled text */ |
145 |
| - --highcontrast-radio-disabled-content-color: GrayText; |
146 |
| - |
147 |
| - /* high contrast disabled selector */ |
148 |
| - --highcontrast-radio-disabled-border-color: GrayText; |
149 |
| - |
150 |
| - /* high contrast focus ring */ |
151 |
| - --highcontrast-radio-focus-indicator-color: CanvasText; |
152 |
| - |
153 |
| - /* ensure focus ring is visible if user agent has non-accessible system overrides */ |
154 |
| - .spectrum-Radio-button { |
155 |
| - &::after { |
156 |
| - forced-color-adjust: none; |
157 |
| - } |
158 |
| - } |
159 |
| - } |
160 |
| -} |
161 |
| - |
162 | 112 | .spectrum-Radio {
|
163 | 113 | display: inline-flex;
|
164 | 114 | align-items: flex-start;
|
|
176 | 126 |
|
177 | 127 | /* checked selection indicator hover */
|
178 | 128 | .spectrum-Radio-input:checked + .spectrum-Radio-button::before {
|
179 |
| - border-color: var(--highcontrast-radio-button-checked-border-color-hover, var(--mod-radio-button-checked-border-color-hover, var(--spectrum-radio-button-checked-border-color-hover))); |
| 129 | + border-color: var(--highcontrast-radio-button-checked-border-color-hover, var(--mod-radio-button-checked-border-color-hover, var(--spectrum-radio-button-border-color-hover))); |
180 | 130 | }
|
181 | 131 |
|
182 | 132 | .spectrum-Radio-label {
|
183 | 133 | color: var(--highcontrast-radio-neutral-content-color-hover, var(--mod-radio-neutral-content-color-hover, var(--spectrum-radio-neutral-content-color-hover)));
|
184 | 134 | }
|
185 | 135 | }
|
186 | 136 |
|
187 |
| - &:active { |
| 137 | + &:not(.is-readOnly):active { |
| 138 | + .spectrum-Radio-input:not(:disabled) + .spectrum-Radio-button { |
| 139 | + transform: perspective(var(--spectrum-component-size-minimum-perspective-down)) translateZ(var(--spectrum-component-size-difference-down)); |
| 140 | + } |
| 141 | + } |
| 142 | + |
| 143 | + &:active, |
| 144 | + &.is-active { |
188 | 145 | /* selection indicator active */
|
189 | 146 | .spectrum-Radio-button::before {
|
190 | 147 | border-color: var(--highcontrast-radio-button-border-color-down, var(--mod-radio-button-border-color-down, var(--spectrum-radio-button-border-color-down)));
|
191 | 148 | }
|
192 | 149 |
|
193 | 150 | /* checked selection indicator active */
|
194 | 151 | .spectrum-Radio-input:checked + .spectrum-Radio-button::before {
|
195 |
| - border-color: var(--highcontrast-radio-button-checked-border-color-down, var(--mod-radio-button-checked-border-color-down, var(--spectrum-radio-button-checked-border-color-down))); |
| 152 | + border-color: var(--highcontrast-radio-button-checked-border-color-down, var(--mod-radio-button-checked-border-color-down, var(--spectrum-radio-button-border-color-down))); |
196 | 153 | }
|
197 | 154 |
|
198 | 155 | .spectrum-Radio-label {
|
|
218 | 175 |
|
219 | 176 | /* selected selection indicator is focused state */
|
220 | 177 | .spectrum-Radio-input:checked + .spectrum-Radio-button::before {
|
221 |
| - border-color: var(--highcontrast-radio-button-checked-border-color-focus, var(--mod-radio-button-checked-border-color-focus, var(--spectrum-radio-button-checked-border-color-focus))); |
| 178 | + border-color: var(--highcontrast-radio-button-checked-border-color-focus, var(--mod-radio-button-checked-border-color-focus, var(--spectrum-radio-button-border-color-focus))); |
222 | 179 | }
|
223 | 180 |
|
224 | 181 | .spectrum-Radio-label {
|
|
311 | 268 | &::before {
|
312 | 269 | /* half of element width minus half of indicator width is checked border width */
|
313 | 270 | border-width: calc((var(--spectrum-radio-button-control-size) / 2) - (var(--spectrum-radio-button-selection-indicator) / 2));
|
314 |
| - border-color: var(--highcontrast-radio-button-checked-border-color-default, var(--mod-radio-button-checked-border-color-default, var(--spectrum-radio-button-checked-border-color-default))); |
| 271 | + border-color: var(--highcontrast-radio-button-checked-border-color-default, var(--mod-radio-button-checked-border-color-default, var(--spectrum-radio-button-border-color-default))); |
315 | 272 | }
|
316 | 273 | }
|
317 | 274 |
|
|
336 | 293 |
|
337 | 294 | font-size: var(--mod-radio-font-size, var(--spectrum-radio-font-size));
|
338 | 295 |
|
339 |
| - /* TODO: font weight and style tokens */ |
340 |
| - /* font-weight: var(--spectrum-radio-text-font-weight); **** missing token resolves to 400 ****/ |
341 |
| - /* font-style: var(--spectrum-radio-text-font-style); **** missing token resolves to normal ****/ |
| 296 | + font-weight: var(--spectrum-radio-text-font-weight); |
| 297 | + font-style: var(--spectrum-radio-text-font-style); |
342 | 298 | color: var(--highcontrast-radio-neutral-content-color, var(--mod-radio-neutral-content-color, var(--spectrum-radio-neutral-content-color)));
|
343 | 299 | line-height: var(--mod-radio-line-height, var(--spectrum-radio-line-height));
|
344 | 300 |
|
|
405 | 361 | }
|
406 | 362 | }
|
407 | 363 | }
|
| 364 | + |
| 365 | +/* windows high contrast mode */ |
| 366 | +@media (forced-colors: active) { |
| 367 | + .spectrum-Radio { |
| 368 | + /* high contrast text */ |
| 369 | + --highcontrast-radio-neutral-content-color: CanvasText; |
| 370 | + --highcontrast-radio-neutral-content-color-hover: CanvasText; |
| 371 | + --highcontrast-radio-neutral-content-color-down: CanvasText; |
| 372 | + --highcontrast-radio-neutral-content-color-focus: CanvasText; |
| 373 | + |
| 374 | + /* high contrast selector */ |
| 375 | + --highcontrast-radio-button-border-color-default: ButtonText; |
| 376 | + --highcontrast-radio-button-border-color-hover: Highlight; |
| 377 | + --highcontrast-radio-button-border-color-down: ButtonText; |
| 378 | + --highcontrast-radio-button-border-color-focus: Highlight; |
| 379 | + |
| 380 | + /* high contrast emphasized selector */ |
| 381 | + --highcontrast-radio-emphasized-accent-color: Highlight; |
| 382 | + --highcontrast-radio-emphasized-accent-color-hover: Highlight; |
| 383 | + --highcontrast-radio-emphasized-accent-color-down: ButtonText; |
| 384 | + --highcontrast-radio-emphasized-accent-color-focus: Highlight; |
| 385 | + |
| 386 | + /* high contrast checked selector */ |
| 387 | + --highcontrast-radio-button-checked-border-color-default: Highlight; |
| 388 | + --highcontrast-radio-button-checked-border-color-hover: Highlight; |
| 389 | + --highcontrast-radio-button-checked-border-color-down: Highlight; |
| 390 | + --highcontrast-radio-button-checked-border-color-focus: Highlight; |
| 391 | + |
| 392 | + /* high contrast disabled text */ |
| 393 | + --highcontrast-radio-disabled-content-color: GrayText; |
| 394 | + |
| 395 | + /* high contrast disabled selector */ |
| 396 | + --highcontrast-radio-disabled-border-color: GrayText; |
| 397 | + |
| 398 | + /* high contrast focus ring */ |
| 399 | + --highcontrast-radio-focus-indicator-color: CanvasText; |
| 400 | + |
| 401 | + /* ensure focus ring is visible if user agent has non-accessible system overrides */ |
| 402 | + .spectrum-Radio-button { |
| 403 | + &::after { |
| 404 | + forced-color-adjust: none; |
| 405 | + } |
| 406 | + } |
| 407 | + |
| 408 | + &.is-readOnly { |
| 409 | + .spectrum-Radio-input + .spectrum-Radio-button::before { |
| 410 | + border-color: var(--highcontrast-radio-button-border-color-default); |
| 411 | + } |
| 412 | + |
| 413 | + &:hover .spectrum-Radio-input + .spectrum-Radio-button::before { |
| 414 | + border-color: var(--highcontrast-radio-button-border-color-default); |
| 415 | + } |
| 416 | + } |
| 417 | + } |
| 418 | +} |
0 commit comments