@@ -47,7 +47,7 @@ governing permissions and limitations under the License.
47
47
--spectrum-actionbutton-line-height : var (--spectrum-actionbutton-height );
48
48
49
49
--spectrum-actionbutton-text-to-visual : var (--spectrum-text-to-visual-100 );
50
- --spectrum-actionbutton-edge-to-hold-icon : var (--spectrum-action-button-edge-to-hold-icon-medium );
50
+ --spectrum-actionbutton-edge-to-hold-icon : var (--mod-actionbutton-edge-to-hold-icon , var ( -- spectrum-action-button-edge-to-hold-icon-medium) );
51
51
--spectrum-actionbutton-edge-to-visual : var (--spectrum-component-edge-to-visual-100 );
52
52
--spectrum-actionbutton-edge-to-text : var (--spectrum-component-edge-to-text-100 );
53
53
--spectrum-actionbutton-edge-to-visual-only : var (--spectrum-component-edge-to-visual-only-100 );
@@ -65,7 +65,7 @@ governing permissions and limitations under the License.
65
65
--spectrum-actionbutton-background-color-focus : var (--spectrum-gray-200 );
66
66
--spectrum-actionbutton-background-color-disabled : transparent;
67
67
68
- & : has ([aria-pressed = "true" ]) {
68
+ & : is ([aria-pressed = "true" ] , [ aria-expanded = "true" ]) {
69
69
--spectrum-actionbutton-background-color-disabled : var (--spectrum-disabled-background-color );
70
70
}
71
71
}
@@ -118,7 +118,8 @@ governing permissions and limitations under the License.
118
118
}
119
119
}
120
120
121
- & : has ([aria-pressed = "true" ]) {
121
+ /* expanded is specific to action menu when the menu is open */
122
+ & : is ([aria-pressed = "true" ], [aria-expanded = "true" ]) {
122
123
--mod-actionbutton-background-color-default : var (--mod-actionbutton-background-color-default-selected , var (--spectrum-neutral-background-color-selected-default ));
123
124
--mod-actionbutton-background-color-hover : var (--mod-actionbutton-background-color-hover-selected , var (--spectrum-neutral-background-color-selected-hover ));
124
125
--mod-actionbutton-background-color-down : var (--mod-actionbutton-background-color-down-selected , var (--spectrum-neutral-background-color-selected-down ));
@@ -178,7 +179,7 @@ governing permissions and limitations under the License.
178
179
--spectrum-actionbutton-icon-size : var (--spectrum-workflow-icon-size-50 );
179
180
--spectrum-actionbutton-font-size : var (--spectrum-font-size-50 );
180
181
--spectrum-actionbutton-text-to-visual : var (--spectrum-text-to-visual-50 );
181
- --spectrum-actionbutton-edge-to-hold-icon : var (--spectrum-action-button-edge-to-hold-icon-extra-small );
182
+ --spectrum-actionbutton-edge-to-hold-icon : var (--mod-actionbutton-edge-to-hold-icon , var ( -- spectrum-action-button-edge-to-hold-icon-extra-small) );
182
183
--spectrum-actionbutton-edge-to-visual : var (--spectrum-component-edge-to-visual-50 );
183
184
--spectrum-actionbutton-edge-to-text : var (--spectrum-component-edge-to-text-50 );
184
185
--spectrum-actionbutton-edge-to-visual-only : var (--spectrum-component-edge-to-visual-only-50 );
@@ -195,7 +196,7 @@ governing permissions and limitations under the License.
195
196
--spectrum-actionbutton-icon-size : var (--spectrum-workflow-icon-size-75 );
196
197
--spectrum-actionbutton-font-size : var (--spectrum-font-size-75 );
197
198
--spectrum-actionbutton-text-to-visual : var (--spectrum-text-to-visual-75 );
198
- --spectrum-actionbutton-edge-to-hold-icon : var (--spectrum-action-button-edge-to-hold-icon-small );
199
+ --spectrum-actionbutton-edge-to-hold-icon : var (--mod-actionbutton-edge-to-hold-icon , var ( -- spectrum-action-button-edge-to-hold-icon-small) );
199
200
--spectrum-actionbutton-edge-to-visual : var (--spectrum-component-edge-to-visual-75 );
200
201
--spectrum-actionbutton-edge-to-text : var (--spectrum-component-edge-to-text-75 );
201
202
--spectrum-actionbutton-edge-to-visual-only : var (--spectrum-component-edge-to-visual-only-75 );
@@ -212,7 +213,7 @@ governing permissions and limitations under the License.
212
213
--spectrum-actionbutton-icon-size : var (--spectrum-workflow-icon-size-200 );
213
214
--spectrum-actionbutton-font-size : var (--spectrum-font-size-200 );
214
215
--spectrum-actionbutton-text-to-visual : var (--spectrum-text-to-visual-200 );
215
- --spectrum-actionbutton-edge-to-hold-icon : var (--spectrum-action-button-edge-to-hold-icon-large );
216
+ --spectrum-actionbutton-edge-to-hold-icon : var (--mod-actionbutton-edge-to-hold-icon , var ( -- spectrum-action-button-edge-to-hold-icon-large) );
216
217
--spectrum-actionbutton-edge-to-visual : var (--spectrum-component-edge-to-visual-200 );
217
218
--spectrum-actionbutton-edge-to-text : var (--spectrum-component-edge-to-text-200 );
218
219
--spectrum-actionbutton-edge-to-visual-only : var (--spectrum-component-edge-to-visual-only-200 );
@@ -227,7 +228,7 @@ governing permissions and limitations under the License.
227
228
--spectrum-actionbutton-icon-size : var (--spectrum-workflow-icon-size-300 );
228
229
--spectrum-actionbutton-font-size : var (--spectrum-font-size-300 );
229
230
--spectrum-actionbutton-text-to-visual : var (--spectrum-text-to-visual-300 );
230
- --spectrum-actionbutton-edge-to-hold-icon : var (--spectrum-action-button-edge-to-hold-icon-extra-large );
231
+ --spectrum-actionbutton-edge-to-hold-icon : var (--mod-actionbutton-edge-to-hold-icon , var ( -- spectrum-action-button-edge-to-hold-icon-extra-large) );
231
232
--spectrum-actionbutton-edge-to-visual : var (--spectrum-component-edge-to-visual-300 );
232
233
--spectrum-actionbutton-edge-to-text : var (--spectrum-component-edge-to-text-300 );
233
234
--spectrum-actionbutton-edge-to-visual-only : var (--spectrum-component-edge-to-visual-only-300 );
@@ -252,6 +253,18 @@ governing permissions and limitations under the License.
252
253
background-color : var (--highcontrast-actionbutton-background-color-default , var (--mod-actionbutton-background-color-default , var (--spectrum-actionbutton-background-color-default )));
253
254
color : var (--highcontrast-actionbutton-content-color-default , var (--mod-actionbutton-content-color-default , var (--spectrum-actionbutton-content-color-default )));
254
255
256
+ transition : border-color var (--highcontrast-actionbutton-animation-duration , var (--mod-actionbutton-animation-duration , var (--spectrum-actionbutton-animation-duration ))) ease-in-out;
257
+
258
+ & ::after {
259
+ position : absolute;
260
+ inset : 0 ;
261
+ margin : calc ((var (--mod-actionbutton-focus-indicator-gap , var (--spectrum-actionbutton-focus-indicator-gap )) + var (--spectrum-actionbutton-border-width )) * -1 );
262
+ border-radius : var (--mod-actionbutton-focus-indicator-border-radius , var (--spectrum-actionbutton-focus-indicator-border-radius ));
263
+ transition : box-shadow var (--highcontrast-actionbutton-animation-duration , var (--mod-actionbutton-animation-duration , var (--spectrum-actionbutton-animation-duration ))) ease-in-out;
264
+ pointer-events : none;
265
+ content : "" ;
266
+ }
267
+
255
268
& : hover {
256
269
background-color : var (--highcontrast-actionbutton-background-color-default , var (--mod-actionbutton-background-color-hover , var (--spectrum-actionbutton-background-color-hover )));
257
270
color : var (--highcontrast-actionbutton-content-color-default , var (--mod-actionbutton-content-color-hover , var (--spectrum-actionbutton-content-color-hover )));
@@ -260,6 +273,13 @@ governing permissions and limitations under the License.
260
273
& : focus-visible {
261
274
background-color : var (--highcontrast-actionbutton-background-color-default , var (--mod-actionbutton-background-color-focus , var (--spectrum-actionbutton-background-color-focus )));
262
275
color : var (--highcontrast-actionbutton-content-color-default , var (--mod-actionbutton-content-color-focus , var (--spectrum-actionbutton-content-color-focus )));
276
+
277
+ box-shadow : none;
278
+ outline : none;
279
+
280
+ & ::after {
281
+ box-shadow : 0 0 0 var (--mod-actionbutton-focus-indicator-thickness , var (--spectrum-actionbutton-focus-indicator-thickness )) var (--highcontrast-actionbutton-focus-indicator-color , var (--mod-actionbutton-focus-indicator-color , var (--spectrum-actionbutton-focus-indicator-color )));
282
+ }
263
283
}
264
284
265
285
& : active {
@@ -268,8 +288,9 @@ governing permissions and limitations under the License.
268
288
transform : perspective (var (--spectrum-actionbutton-downstate-perspective )) translateZ (var (--spectrum-component-size-difference-down ));
269
289
}
270
290
271
- & : disabled ,
272
- & .is-disabled {
291
+ /* ideal when we want to disable the button but still allow it's content to be focused */
292
+ & : is (: disabled , .is-disabled , [aria-disabled = "true" ]) {
293
+ /* @todo: should pointer events be disabled? */
273
294
background-color : var (--highcontrast-actionbutton-background-color-disabled , var (--mod-actionbutton-background-color-disabled , var (--spectrum-actionbutton-background-color-disabled )));
274
295
color : var (--highcontrast-actionbutton-content-color-disabled , var (--mod-actionbutton-content-color-disabled , var (--spectrum-actionbutton-content-color-disabled )));
275
296
}
@@ -313,36 +334,13 @@ a.spectrum-ActionButton {
313
334
314
335
.spectrum-ActionButton-hold {
315
336
position : absolute;
316
- inset-inline-end : calc (var (--mod-actionbutton-edge-to-hold-icon , var (--spectrum-actionbutton-edge-to-hold-icon )) - var (--spectrum-actionbutton-border-width ));
317
- inset-block-end : calc (var (--mod-actionbutton-edge-to-hold-icon , var (--spectrum-actionbutton-edge-to-hold-icon )) - var (--spectrum-actionbutton-border-width ));
337
+ inset-inline-end : calc (var (--spectrum-actionbutton-edge-to-hold-icon ) - var (--spectrum-actionbutton-border-width ));
338
+ inset-block-end : calc (var (--spectrum-actionbutton-edge-to-hold-icon ) - var (--spectrum-actionbutton-border-width ));
339
+ display : block;
318
340
color : inherit;
319
341
transform : var (--spectrum-logical-rotation );
320
342
}
321
343
322
- /* Focus indicator */
323
- .spectrum-ActionButton {
324
- transition : border-color var (--highcontrast-actionbutton-animation-duration , var (--mod-actionbutton-animation-duration , var (--spectrum-actionbutton-animation-duration ))) ease-in-out;
325
-
326
- & ::after {
327
- position : absolute;
328
- inset : 0 ;
329
- margin : calc ((var (--mod-actionbutton-focus-indicator-gap , var (--spectrum-actionbutton-focus-indicator-gap )) + var (--spectrum-actionbutton-border-width )) * -1 );
330
- border-radius : var (--mod-actionbutton-focus-indicator-border-radius , var (--spectrum-actionbutton-focus-indicator-border-radius ));
331
- transition : box-shadow var (--highcontrast-actionbutton-animation-duration , var (--mod-actionbutton-animation-duration , var (--spectrum-actionbutton-animation-duration ))) ease-in-out;
332
- pointer-events : none;
333
- content : "" ;
334
- }
335
-
336
- & : focus-visible {
337
- box-shadow : none;
338
- outline : none;
339
-
340
- & ::after {
341
- box-shadow : 0 0 0 var (--mod-actionbutton-focus-indicator-thickness , var (--spectrum-actionbutton-focus-indicator-thickness )) var (--highcontrast-actionbutton-focus-indicator-color , var (--mod-actionbutton-focus-indicator-color , var (--spectrum-actionbutton-focus-indicator-color )));
342
- }
343
- }
344
- }
345
-
346
344
@media (forced-colors : active) {
347
345
.spectrum-ActionButton {
348
346
/**
@@ -388,7 +386,7 @@ a.spectrum-ActionButton {
388
386
--highcontrast-actionbutton-background-color-disabled : Canvas;
389
387
--highcontrast-actionbutton-content-color-default : CanvasText;
390
388
391
- & : disabled : not (: has ([aria-pressed = "true" ])) {
389
+ & : is ( : disabled , . is-disabled , [ aria-disabled = "true" ]) : not (: is ([aria-pressed = "true" ] , [ aria-expanded = "true" ])) {
392
390
--highcontrast-actionbutton-border-color : Canvas;
393
391
}
394
392
}
@@ -400,8 +398,7 @@ a.spectrum-ActionButton {
400
398
--highcontrast-actionbutton-border-color : Highlight;
401
399
}
402
400
403
- /* Selected always shows as a solid highlighted color. */
404
- & : has ([aria-pressed = "true" ]) {
401
+ & : is ([aria-pressed = "true" ], [aria-expanded = "true" ]) {
405
402
--highcontrast-actionbutton-border-color : Highlight;
406
403
--highcontrast-actionbutton-background-color-default : Highlight;
407
404
--highcontrast-actionbutton-content-color-default : HighlightText;
0 commit comments