Skip to content

Commit 850fdf3

Browse files
committed
use color instead of opacity
1 parent a9b255e commit 850fdf3

File tree

1 file changed

+23
-1
lines changed
  • packages/stacks-classic/lib/components/button

1 file changed

+23
-1
lines changed

packages/stacks-classic/lib/components/button/button.less

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
--_bu-bg-focus: var(--black-150);
2626
--_bu-fc-focus: var(--black-600);
2727

28+
// Disabled
29+
--_bu-bg-disabled: var(--black-050);
30+
--_bu-fc-disabled: var(--black-300);
31+
// Filled + Disabled
32+
--_bu-filled-bg-disabled: var(--black-300);
33+
--_bu-filled-fc-disabled: var(--black-050);
34+
2835
// BASE SELECTED MODIFIER
2936
--_bu-bg-selected: linear-gradient(to bottom, var(--theme-secondary-100) 0%, var(--theme-secondary-100) 50%, color-mix(in srgb, var(--theme-secondary-100) 60%, white 40%) 50%, color-mix(in srgb, var(--theme-secondary-100) 60%, white 40%) 100%);
3037
--_bu-fc-selected: var(--theme-button-selected-color, var(--theme-secondary-600));
@@ -73,9 +80,16 @@
7380
fieldset[disabled] &,
7481
&[disabled],
7582
&[aria-disabled="true"] {
76-
opacity: var(--_o-disabled-static);
7783
pointer-events: none;
7884
text-decoration: none;
85+
86+
background-color: var(--_bu-bg-disabled);
87+
color: var(--_bu-fc-disabled);
88+
89+
&.s-btn__filled {
90+
background-color: var(--_bu-filled-bg-disabled);
91+
color: var(--_bu-filled-fc-disabled);
92+
}
7993
}
8094

8195
button &,
@@ -279,6 +293,10 @@
279293
--_bu-filled-fc-active: var(--_bu-filled-fc);
280294
--_bu-filled-fc-hover: var(--_bu-filled-fc);
281295
--_bu-filled-fc-selected: var(--_bu-filled-fc);
296+
--_bu-bg-disabled: var(--black-050);
297+
--_bu-fc-disabled: var(--red-200);
298+
--_bu-filled-bg-disabled: var(--red-200);
299+
--_bu-filled-fc-disabled: var(--black-050);
282300
--_bu-number-fc: var(--white);
283301
--_bu-number-fc-filled: var(--black);
284302
.highcontrast-mode({
@@ -310,6 +328,8 @@
310328
--_bu-filled-fc-hover: var(--_bu-filled-fc);
311329
--_bu-filled-fc-selected: var(--_bu-filled-fc);
312330
--_bu-filled-bg-focus: var(--purple-400);
331+
--_bu-filled-bg-disabled: var(--purple-200);
332+
--_bu-filled-fc-disabled: var(--black-050);
313333
--_bu-number-fc: var(--white);
314334
--_bu-number-fc-filled: var(--black);
315335
.dark-mode({
@@ -327,6 +347,8 @@
327347
--_bu-fc-active: var(--_bu-fc);
328348
--_bu-fc-hover: var(--theme-secondary-600);
329349
--_bu-fc-selected: var(--theme-secondary-600);
350+
--_bu-bg-disabled: var(--black-100);
351+
--_bu-fc-disabled: var(--black-300);
330352
--_bu-number-fc-filled: var(--white);
331353
--_bu-number-fc-selected: var(--white);
332354
--_bu-number-fc-focus: var(--theme-secondary-600);

0 commit comments

Comments
 (0)