Skip to content

Commit e592b54

Browse files
Michael JordanLFDanLu
andauthored
fix(#5691): [WHCM] ActionButton restore border for isQuiet and isQuiet + isDisabled states (#5705)
* fix(#5691): [WHCM] ActionButton remove border for isQuiet, isDisabled state * fix(#5691): [WHCM] ActionButton restore border for isQuiet states * fix(#5691): [WHCM] ActionButton fix border for staticColor and selected states * fix(#5691): [WHCM] ActionButton fix chromatic regression improve selected + disabled styles * fix(#5691): [WHCM] ActionButton fix chromatic regressions --------- Co-authored-by: Daniel Lu <dl1644@gmail.com>
1 parent 6d4f463 commit e592b54

File tree

1 file changed

+44
-34
lines changed
  • packages/@adobe/spectrum-css-temp/components/button

1 file changed

+44
-34
lines changed

packages/@adobe/spectrum-css-temp/components/button/skin.css

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ governing permissions and limitations under the License.
2020
--spectrum-actionbutton-background-color-selected-hover: var(--spectrum-alias-toggle-color-selected-hover);
2121
--spectrum-actionbutton-background-color-selected-key-focus: var(--spectrum-alias-toggle-color-selected-key-focus);
2222
--spectrum-actionbutton-background-color-selected-down: var(--spectrum-alias-toggle-color-selected-down);
23-
--spectrum-actionbutton-border-color-selected: var(--spectrum-actionbutton-background-color-selected);
24-
--spectrum-actionbutton-border-color-selected-hover: var(--spectrum-actionbutton-background-color-selected-hover);
25-
--spectrum-actionbutton-border-color-selected-key-focus: var(--spectrum-actionbutton-background-color-selected-key-focus);
26-
--spectrum-actionbutton-border-color-selected-down: var(--spectrum-actionbutton-background-color-selected-down);
23+
--spectrum-actionbutton-border-color-selected: var(--spectrum-alias-toggle-color-selected);
24+
--spectrum-actionbutton-border-color-selected-hover: var(--spectrum-alias-toggle-color-selected-hover);
25+
--spectrum-actionbutton-border-color-selected-key-focus: var(--spectrum-alias-toggle-color-selected-key-focus);
26+
--spectrum-actionbutton-border-color-selected-down: var(--spectrum-alias-toggle-color-selected-down);
2727
--spectrum-actionbutton-text-color-selected: var(--spectrum-gray-50);
2828
--spectrum-actionbutton-text-color-selected-hover: var(--spectrum-gray-50);
2929
--spectrum-actionbutton-text-color-selected-key-focus: var(--spectrum-gray-50);
@@ -37,10 +37,10 @@ governing permissions and limitations under the License.
3737
--spectrum-actionbutton-emphasized-background-color-selected-hover: var(--spectrum-accent-background-color-hover);
3838
--spectrum-actionbutton-emphasized-background-color-selected-key-focus: var(--spectrum-accent-background-color-key-focus);
3939
--spectrum-actionbutton-emphasized-background-color-selected-down: var(--spectrum-accent-background-color-down);
40-
--spectrum-actionbutton-emphasized-border-color-selected: var(--spectrum-actionbutton-emphasized-background-color-selected);
41-
--spectrum-actionbutton-emphasized-border-color-selected-hover: var(--spectrum-actionbutton-emphasized-background-color-selected-hover);
42-
--spectrum-actionbutton-emphasized-border-color-selected-key-focus: var(--spectrum-actionbutton-emphasized-background-color-selected-key-focus);
43-
--spectrum-actionbutton-emphasized-border-color-selected-down: var(--spectrum-actionbutton-emphasized-background-color-selected-down);
40+
--spectrum-actionbutton-emphasized-border-color-selected: var(--spectrum-accent-background-color-default);
41+
--spectrum-actionbutton-emphasized-border-color-selected-hover: var(--spectrum-accent-background-color-hover);
42+
--spectrum-actionbutton-emphasized-border-color-selected-key-focus: var(--spectrum-accent-background-color-key-focus);
43+
--spectrum-actionbutton-emphasized-border-color-selected-down: var(--spectrum-accent-background-color-down);
4444

4545
/* TBD on new tokens. This passes contrast for now. */
4646
--spectrum-logicbutton-and-background-color: var(--spectrum-global-color-static-blue-600);
@@ -534,12 +534,12 @@ governing permissions and limitations under the License.
534534

535535
&:disabled,
536536
&.is-disabled {
537-
background-color: xvar(--spectrum-high-contrast-button-face, var(--spectrum-actionbutton-background-color-selected-disabled));
537+
background-color: xvar(--spectrum-high-contrast-gray-text, var(--spectrum-actionbutton-background-color-selected-disabled));
538538
border-color: xvar(--spectrum-high-contrast-gray-text, var(--spectrum-actionbutton-border-color-selected-disabled));
539-
color: xvar(--spectrum-high-contrast-gray-text, var(--spectrum-actionbutton-text-color-selected-disabled));
539+
color: xvar(--spectrum-high-contrast-button-face, var(--spectrum-actionbutton-text-color-selected-disabled));
540540

541541
.spectrum-Icon {
542-
fill: xvar(--spectrum-high-contrast-gray-text, var(--spectrum-actionbutton-icon-color-selected-disabled));
542+
fill: xvar(--spectrum-high-contrast-button-face, var(--spectrum-actionbutton-icon-color-selected-disabled));
543543
}
544544
}
545545
}
@@ -588,20 +588,20 @@ governing permissions and limitations under the License.
588588

589589
&:disabled,
590590
&.is-disabled {
591-
background-color: xvar(--spectrum-high-contrast-button-face, var(--spectrum-actionbutton-emphasized-background-color-selected-disabled));
591+
background-color: xvar(--spectrum-high-contrast-gray-text, var(--spectrum-actionbutton-emphasized-background-color-selected-disabled));
592592
border-color: xvar(--spectrum-high-contrast-gray-text, var(--spectrum-actionbutton-emphasized-border-color-selected-disabled));
593-
color: xvar(--spectrum-high-contrast-gray-text, var(--spectrum-actionbutton-emphasized-text-color-selected-disabled));
593+
color: xvar(--spectrum-high-contrast-button-face, var(--spectrum-actionbutton-emphasized-text-color-selected-disabled));
594594

595595
.spectrum-Icon {
596-
fill: xvar(--spectrum-high-contrast-gray-text, var(--spectrum-actionbutton-emphasized-icon-color-selected-disabled));
596+
fill: xvar(--spectrum-high-contrast-button-face, var(--spectrum-actionbutton-emphasized-icon-color-selected-disabled));
597597
}
598598
}
599599
}
600600
}
601601

602602
.spectrum-ActionButton--quiet {
603603
background-color: xvar(--spectrum-high-contrast-button-face, var(--spectrum-actionbutton-quiet-background-color));
604-
border-color: xvar(--spectrum-high-contrast-button-face, var(--spectrum-actionbutton-quiet-border-color));
604+
border-color: xvar(--spectrum-high-contrast-button-text, var(--spectrum-actionbutton-quiet-border-color));
605605
color: xvar(--spectrum-high-contrast-button-text, var(--spectrum-actionbutton-quiet-text-color));
606606

607607
&:hover {
@@ -645,18 +645,21 @@ governing permissions and limitations under the License.
645645
--spectrum-actionbutton-static-border-color: var(--spectrum-actionbutton-static-white-border-color);
646646
--spectrum-actionbutton-static-border-color-hover: var(--spectrum-actionbutton-static-white-border-color-hover);
647647
--spectrum-actionbutton-static-border-color-active: var(--spectrum-actionbutton-static-white-border-color-down);
648+
--spectrum-actionbutton-static-border-color-selected: var(--spectrum-actionbutton-static-background-color-selected);
648649
--spectrum-actionbutton-static-border-color-focus: var(--spectrum-actionbutton-static-white-border-color-key-focus);
649-
--spectrum-actionbutton-static-border-disabled: var(--spectrum-actionbutton-static-white-border-color-disabled);
650+
--spectrum-actionbutton-static-border-color-disabled: var(--spectrum-actionbutton-static-white-border-color-disabled);
650651
--spectrum-actionbutton-static-border-color-selected-disabled: var(--spectrum-actionbutton-static-white-border-color-selected-disabled);
651652
--spectrum-actionbutton-static-color: white;
652653
--spectrum-actionbutton-static-color-selected: black; /* becomes the background of the parent element due to mix-blend-mode */
653654
--spectrum-actionbutton-static-color-disabled: rgba(255, 255, 255, 0.55);
655+
--spectrum-actionbutton-static-color-selected-disabled: var(--spectrum-actionbutton-static-color-disabled);
654656
}
655657

656658
.spectrum-ActionButton--staticWhite.spectrum-ActionButton--quiet {
657659
--spectrum-actionbutton-static-border-color: transparent;
658660
--spectrum-actionbutton-static-border-color-hover: transparent;
659661
--spectrum-actionbutton-static-border-color-active: transparent;
662+
--spectrum-actionbutton-static-border-color-selected: transparent;
660663
}
661664

662665
.spectrum-ActionButton--staticBlack {
@@ -674,18 +677,21 @@ governing permissions and limitations under the License.
674677
--spectrum-actionbutton-static-border-color: var(--spectrum-actionbutton-static-black-border-color);
675678
--spectrum-actionbutton-static-border-color-hover: var(--spectrum-actionbutton-static-black-border-color-hover);
676679
--spectrum-actionbutton-static-border-color-active: var(--spectrum-actionbutton-static-black-border-color-down);
680+
--spectrum-actionbutton-static-border-color-selected: var(--spectrum-actionbutton-static-background-color-selected);
677681
--spectrum-actionbutton-static-border-color-focus: var(--spectrum-actionbutton-static-black-border-color-key-focus);
678-
--spectrum-actionbutton-static-border-disabled: var(--spectrum-actionbutton-static-black-border-color-disabled);
682+
--spectrum-actionbutton-static-border-color-disabled: var(--spectrum-actionbutton-static-black-border-color-disabled);
679683
--spectrum-actionbutton-static-border-color-selected-disabled: var(--spectrum-actionbutton-static-black-border-color-selected-disabled);
680684
--spectrum-actionbutton-static-color: black;
681685
--spectrum-actionbutton-static-color-selected: white; /* becomes the background of the parent element due to mix-blend-mode */
682686
--spectrum-actionbutton-static-color-disabled: rgba(0, 0, 0, 0.55);
687+
--spectrum-actionbutton-static-color-selected-disabled: var(--spectrum-actionbutton-static-color-disabled);
683688
}
684689

685690
.spectrum-ActionButton--staticBlack.spectrum-ActionButton--quiet {
686691
--spectrum-actionbutton-static-border-color: transparent;
687692
--spectrum-actionbutton-static-border-color-hover: transparent;
688693
--spectrum-actionbutton-static-border-color-active: transparent;
694+
--spectrum-actionbutton-static-border-color-selected: transparent;
689695
}
690696

691697
.spectrum-ActionButton--staticColor {
@@ -748,7 +754,7 @@ governing permissions and limitations under the License.
748754
&:disabled,
749755
&.is-disabled {
750756
background-color: var(--spectrum-actionbutton-static-background-color-disabled);
751-
border-color: var(--spectrum-actionbutton-static-border-disabled);
757+
border-color: var(--spectrum-actionbutton-static-border-color-disabled);
752758
color: var(--spectrum-actionbutton-static-color-disabled);
753759

754760
.spectrum-Icon {
@@ -763,7 +769,7 @@ governing permissions and limitations under the License.
763769
&.spectrum-ActionButton--quiet.is-selected,
764770
&.is-selected {
765771
background-color: var(--spectrum-actionbutton-static-background-color-selected);
766-
border-color: var(--spectrum-actionbutton-static-background-color-selected);
772+
border-color: var(--spectrum-actionbutton-static-border-color-selected);
767773
color: var(--spectrum-actionbutton-static-color-selected);
768774

769775
.spectrum-Icon {
@@ -796,10 +802,10 @@ governing permissions and limitations under the License.
796802
&.is-disabled {
797803
background-color: var(--spectrum-actionbutton-static-background-color-selected-disabled);
798804
border-color: var(--spectrum-actionbutton-static-border-color-selected-disabled);
799-
color: var(--spectrum-actionbutton-static-color-disabled);
805+
color: var(--spectrum-actionbutton-static-color-selected-disabled);
800806

801807
.spectrum-Icon {
802-
fill: var(--spectrum-actionbutton-static-color-disabled);
808+
fill: var(--spectrum-actionbutton-static-color-selected-disabled);
803809
}
804810

805811
.spectrum-ActionButton-hold {
@@ -812,17 +818,12 @@ governing permissions and limitations under the License.
812818
/* Quiet action buttons always have transparent backgrounds, in both Spectrum and Express */
813819
--spectrum-actionbutton-static-background-color: transparent;
814820
--spectrum-actionbutton-static-background-color-disabled: transparent;
815-
816-
&,
817-
&:hover,
818-
&.is-active,
819-
&:disabled,
820-
&.is-disabled {
821-
&,
822-
&.is-selected {
823-
border-color: transparent;
824-
}
825-
}
821+
--spectrum-actionbutton-static-border-color: transparent;
822+
--spectrum-actionbutton-static-border-color-disabled: transparent;
823+
--spectrum-actionbutton-static-border-color-selected-hover: transparent;
824+
--spectrum-actionbutton-static-border-color-focus: transparent;
825+
--spectrum-actionbutton-static-border-color-active: transparent;
826+
--spectrum-actionbutton-static-border-color-selected-disabled: transparent;
826827
}
827828
}
828829

@@ -1034,24 +1035,33 @@ governing permissions and limitations under the License.
10341035
--spectrum-button-over-background-color: ButtonText;
10351036
}
10361037

1038+
.spectrum-ActionButton--staticColor,
10371039
.spectrum-ActionButton--staticWhite,
1038-
.spectrum-ActionButton--staticBlack {
1040+
.spectrum-ActionButton--staticBlack,
1041+
.spectrum-ActionButton--staticWhite.spectrum-ActionButton--quiet,
1042+
.spectrum-ActionButton--staticBlack.spectrum-ActionButton--quiet {
10391043
/* For some reason, making this a var doesn't work, the value is inlined in the css */
10401044
mix-blend-mode: normal;
1045+
--spectrum-actionbutton-static-background-color: ButtonFace;
1046+
--spectrum-actionbutton-static-background-color-disabled: var(--spectrum-high-contrast-transparent);
1047+
--spectrum-actionbutton-static-background-color-selected-disabled: GrayText;
10411048
--spectrum-actionbutton-static-background-color-hover: ButtonFace;
10421049
--spectrum-actionbutton-static-background-color-focus: ButtonFace;
10431050
--spectrum-actionbutton-static-background-color-active: ButtonFace;
10441051
--spectrum-actionbutton-static-background-color-selected: Highlight;
10451052
--spectrum-actionbutton-static-background-color-selected-hover: Highlight;
10461053
--spectrum-actionbutton-static-background-color-selected-focus: Highlight;
10471054
--spectrum-actionbutton-static-background-color-selected-active: Highlight;
1055+
--spectrum-actionbutton-static-background-color-selected-disabled: GrayText;
10481056
--spectrum-actionbutton-static-border-color: ButtonText;
10491057
--spectrum-actionbutton-static-border-color-hover: Highlight;
10501058
--spectrum-actionbutton-static-border-color-active: ButtonText;
10511059
--spectrum-actionbutton-static-border-color-focus: CanvasText;
1052-
--spectrum-actionbutton-static-border-disabled: GrayText;
1060+
--spectrum-actionbutton-static-border-color-disabled: GrayText;
1061+
--spectrum-actionbutton-static-border-color-selected-disabled: GrayText;
10531062
--spectrum-actionbutton-static-color: ButtonText;
10541063
--spectrum-actionbutton-static-color-selected: HighlightText; /* becomes the background of the parent element due to mix-blend-mode */
10551064
--spectrum-actionbutton-static-color-disabled: GrayText;
1065+
--spectrum-actionbutton-static-color-selected-disabled: ButtonFace;
10561066
}
10571067
}

0 commit comments

Comments
 (0)