|
11 | 11 | * governing permissions and limitations under the License.
|
12 | 12 | */
|
13 | 13 |
|
| 14 | +@media (forced-colors: active) { |
| 15 | + .spectrum-ActionButton { |
| 16 | + /* force a more visible focus indicator color */ |
| 17 | + --highcontrast-actionbutton-focus-indicator-color: ButtonText; |
| 18 | + |
| 19 | + &::after { |
| 20 | + /* make sure focus indicator renders */ |
| 21 | + forced-color-adjust: none; |
| 22 | + } |
| 23 | + |
| 24 | + &.is-selected { |
| 25 | + --highcontrast-actionbutton-background-color-default: Highlight; |
| 26 | + --highcontrast-actionbutton-background-color-hover: Highlight; |
| 27 | + --highcontrast-actionbutton-background-color-focus: Highlight; |
| 28 | + --highcontrast-actionbutton-background-color-down: Highlight; |
| 29 | + --highcontrast-actionbutton-background-color-disabled: ButtonFace; |
| 30 | + |
| 31 | + --highcontrast-actionbutton-border-color-default: HighlightText; |
| 32 | + --highcontrast-actionbutton-border-color-hover: HighlightText; |
| 33 | + --highcontrast-actionbutton-border-color-focus: HighlightText; |
| 34 | + --highcontrast-actionbutton-border-color-down: HighlightText; |
| 35 | + --highcontrast-actionbutton-border-color-disabled: GrayText; |
| 36 | + |
| 37 | + --highcontrast-actionbutton-content-color-default: HighlightText; |
| 38 | + --highcontrast-actionbutton-content-color-hover: HighlightText; |
| 39 | + --highcontrast-actionbutton-content-color-focus: HighlightText; |
| 40 | + --highcontrast-actionbutton-content-color-down: HighlightText; |
| 41 | + --highcontrast-actionbutton-content-color-disabled: GrayText; |
| 42 | + |
| 43 | + .spectrum-ActionButton-icon, |
| 44 | + .spectrum-ActionButton-hold, |
| 45 | + .spectrum-ActionButton-label { |
| 46 | + /* ensure custom text colors from above get applied */ |
| 47 | + /* it seems like this shouldn't have to be done, but colors are wrong without it */ |
| 48 | + forced-color-adjust: none; |
| 49 | + } |
| 50 | + } |
| 51 | + } |
| 52 | +} |
| 53 | + |
14 | 54 | .spectrum-ActionButton {
|
15 | 55 | --spectrum-actionbutton-background-color-default: var(--highcontrast-actionbutton-background-color-default, var(--mod-actionbutton-background-color-default, var(--spectrum-gray-50)));
|
16 | 56 | --spectrum-actionbutton-background-color-hover: var(--highcontrast-actionbutton-background-color-hover, var(--mod-actionbutton-background-color-hover, var(--spectrum-gray-100)));
|
|
63 | 103 | }
|
64 | 104 |
|
65 | 105 | &.spectrum-ActionButton--quiet {
|
66 |
| - --mod-actionbutton-border-color-default: transparent; |
67 |
| - |
68 | 106 | --mod-actionbutton-background-color-default: transparent;
|
69 | 107 | --mod-actionbutton-background-color-hover: var(--spectrum-gray-100);
|
70 | 108 | --mod-actionbutton-background-color-down: var(--spectrum-gray-200);
|
71 | 109 | --mod-actionbutton-background-color-focus: var(--spectrum-gray-100);
|
72 |
| - |
73 |
| - &:disabled:not(.is-selected), |
74 |
| - &.is-disabled:not(.is-selected) { |
75 |
| - --mod-actionbutton-border-color-disabled: transparent; |
76 |
| - --mod-actionbutton-background-color-disabled: transparent; |
77 |
| - } |
78 | 110 | }
|
79 | 111 |
|
80 | 112 | &.spectrum-ActionButton--staticBlack {
|
81 |
| - --mod-actionbutton-background-color-default: transparent; |
| 113 | + --mod-actionbutton-border-color-default: var(--spectrum-transparent-black-500); |
| 114 | + --mod-actionbutton-border-color-hover: var(--spectrum-transparent-black-600); |
| 115 | + --mod-actionbutton-border-color-down: var(--spectrum-transparent-black-700); |
| 116 | + --mod-actionbutton-border-color-focus: var(--spectrum-transparent-black-600); |
82 | 117 |
|
83 | 118 | --mod-actionbutton-border-color-default: var(--spectrum-transparent-black-500);
|
84 | 119 | --mod-actionbutton-border-color-hover: var(--spectrum-transparent-black-600);
|
|
97 | 132 | }
|
98 | 133 |
|
99 | 134 | &.spectrum-ActionButton--quiet {
|
100 |
| - --mod-actionbutton-border-color-default: transparent; |
| 135 | + --mod-actionbutton-background-color-default: transparent; |
| 136 | + --mod-actionbutton-background-color-hover: var(--spectrum-transparent-black-400); |
| 137 | + --mod-actionbutton-background-color-down: var(--spectrum-transparent-black-500); |
| 138 | + --mod-actionbutton-background-color-focus: var(--spectrum-transparent-black-400); |
101 | 139 | }
|
102 | 140 | }
|
103 | 141 |
|
104 | 142 | &.spectrum-ActionButton--staticWhite {
|
105 |
| - --mod-actionbutton-background-color-default: transparent; |
| 143 | + --mod-actionbutton-border-color-default: var(--spectrum-transparent-white-500); |
| 144 | + --mod-actionbutton-border-color-hover: var(--spectrum-transparent-white-600); |
| 145 | + --mod-actionbutton-border-color-down: var(--spectrum-transparent-white-700); |
| 146 | + --mod-actionbutton-border-color-focus: var(--spectrum-transparent-white-600); |
106 | 147 |
|
107 | 148 | --mod-actionbutton-border-color-default: var(--spectrum-transparent-white-500);
|
108 | 149 | --mod-actionbutton-border-color-hover: var(--spectrum-transparent-white-600);
|
|
121 | 162 | }
|
122 | 163 |
|
123 | 164 | &.spectrum-ActionButton--quiet {
|
124 |
| - --mod-actionbutton-border-color-default: transparent; |
| 165 | + --mod-actionbutton-background-color-default: transparent; |
| 166 | + --mod-actionbutton-background-color-hover: var(--spectrum-transparent-white-400); |
| 167 | + --mod-actionbutton-background-color-down: var(--spectrum-transparent-white-500); |
| 168 | + --mod-actionbutton-background-color-focus: var(--spectrum-transparent-white-400); |
125 | 169 | }
|
126 | 170 | }
|
127 | 171 |
|
|
269 | 313 | /* stylelint-disable-next-line property-no-vendor-prefix -- Correct the inability to style clickable types in iOS and Safari (normalize). */
|
270 | 314 | -webkit-appearance: button;
|
271 | 315 |
|
272 |
| - border-style: solid; |
273 |
| - |
274 | 316 | transition:
|
275 | 317 | background var(--mod-button-animation-duration, var(--spectrum-animation-duration-100)) ease-out,
|
276 | 318 | border-color var(--mod-actionbutton-animation-duration, var(--spectrum-animation-duration-100)) ease-in-out,
|
@@ -422,40 +464,3 @@ a.spectrum-ActionButton {
|
422 | 464 | /* Augment the margin correction for the icon only scenario */
|
423 | 465 | margin-inline-start: calc(var(--spectrum-actionbutton-edge-to-visual-only) - var(--spectrum-actionbutton-edge-to-text));
|
424 | 466 | }
|
425 |
| - |
426 |
| -@media (forced-colors: active) { |
427 |
| - .spectrum-ActionButton { |
428 |
| - &::after { |
429 |
| - /* make sure focus indicator renders */ |
430 |
| - forced-color-adjust: none; |
431 |
| - } |
432 |
| - |
433 |
| - &.is-selected { |
434 |
| - --highcontrast-actionbutton-background-color-default: Highlight; |
435 |
| - --highcontrast-actionbutton-background-color-hover: Highlight; |
436 |
| - --highcontrast-actionbutton-background-color-focus: Highlight; |
437 |
| - --highcontrast-actionbutton-background-color-down: Highlight; |
438 |
| - --highcontrast-actionbutton-background-color-disabled: ButtonFace; |
439 |
| - |
440 |
| - --highcontrast-actionbutton-border-color-default: HighlightText; |
441 |
| - --highcontrast-actionbutton-border-color-hover: HighlightText; |
442 |
| - --highcontrast-actionbutton-border-color-focus: HighlightText; |
443 |
| - --highcontrast-actionbutton-border-color-down: HighlightText; |
444 |
| - --highcontrast-actionbutton-border-color-disabled: GrayText; |
445 |
| - |
446 |
| - --highcontrast-actionbutton-content-color-default: HighlightText; |
447 |
| - --highcontrast-actionbutton-content-color-hover: HighlightText; |
448 |
| - --highcontrast-actionbutton-content-color-focus: HighlightText; |
449 |
| - --highcontrast-actionbutton-content-color-down: HighlightText; |
450 |
| - --highcontrast-actionbutton-content-color-disabled: GrayText; |
451 |
| - |
452 |
| - .spectrum-ActionButton-icon, |
453 |
| - .spectrum-ActionButton-hold, |
454 |
| - .spectrum-ActionButton-label { |
455 |
| - /* ensure custom text colors from above get applied */ |
456 |
| - /* it seems like this shouldn't have to be done, but colors are wrong without it */ |
457 |
| - forced-color-adjust: none; |
458 |
| - } |
459 |
| - } |
460 |
| - } |
461 |
| -} |
|
0 commit comments