Skip to content

Commit a262d2e

Browse files
authored
refactor: removed the disabled grey/transparent background "color" (#290)
* refactor: removed the disabled grey/transparent background "color" * refactor: adapted the correct alpha values * fix: we want to set the alpha value and that for need the long form hex code
1 parent 4ab96be commit a262d2e

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

source/_patterns/01-elements/buttons/_button.variables.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
@import "../../00-base/icons/icons.variables";
33
@import "../../00-base/icons/icons.helpers";
44

5-
$button---color: #fff !default;
5+
// We want to set the alpha value and that for need the long form hex code
6+
// stylelint-disable color-hex-length
7+
$button---color: #ffffff !default;
8+
// stylelint-enable color-hex-length
69

710
$button---minHeight: to-rem(
811
$pxValue: 44

source/_patterns/01-elements/buttons/button.scss

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
&%variant-brand-primary {
4646
background-color: $button-brand-primary--backgroundColor;
4747

48+
&:disabled {
49+
background-color: unquote(
50+
$button-brand-primary--backgroundColor + "40"
51+
);
52+
}
53+
4854
&:not(:disabled) {
4955
&:hover {
5056
// TODO: This could probably get simplified later on e.g. via CSS variables
@@ -60,6 +66,10 @@
6066
&%variant-primary {
6167
background-color: $button-primary--backgroundColor;
6268

69+
&:disabled {
70+
background-color: unquote($button-primary--backgroundColor + "40");
71+
}
72+
6373
&:not(:disabled) {
6474
&:hover {
6575
// TODO: This could probably get simplified later on e.g. via CSS variables
@@ -79,18 +89,18 @@
7989
border-color: $db-color-cool-gray-700;
8090
color: $db-color-cool-gray-700;
8191

92+
&:disabled {
93+
color: unquote($db-color-cool-gray-700 + "80");
94+
border-color: unquote($db-color-cool-gray-700 + "40");
95+
}
96+
8297
&:not(:disabled) {
8398
&:hover {
8499
// TODO: This could probably get simplified later on e.g. via CSS variables
85100
background-color: $button-secondaryOutline-hover-backgroundColor;
86101
}
87102
}
88103

89-
&:disabled {
90-
background-color: transparent;
91-
color: $db-color-cool-gray-700;
92-
}
93-
94104
&:active {
95105
background-color: $button-secondaryOutline-active-backgroundColor;
96106
}
@@ -100,6 +110,13 @@
100110
background-color: $button-secondarySolid--backgroundColor;
101111
color: $db-color-cool-gray-700;
102112

113+
&:disabled {
114+
color: unquote($db-color-cool-gray-700 + "80");
115+
background-color: unquote(
116+
$button-secondarySolid--backgroundColor + "40"
117+
);
118+
}
119+
103120
&:not(:disabled) {
104121
&:hover {
105122
// TODO: This could probably get simplified later on e.g. via CSS variables
@@ -117,17 +134,17 @@
117134
border: 2px solid transparent;
118135
color: $db-color-cool-gray-700;
119136

137+
&:disabled {
138+
color: unquote($db-color-cool-gray-700 + "80");
139+
}
140+
120141
&:not(:disabled) {
121142
&:hover {
122143
// TODO: This could probably get simplified later on e.g. via CSS variables
123144
background-color: $button-secondaryOutline-hover-backgroundColor;
124145
}
125146
}
126147

127-
&:disabled {
128-
background-color: transparent; // shame.css
129-
}
130-
131148
&:active {
132149
background-color: $button-secondaryOutline-active-backgroundColor;
133150
}
@@ -197,8 +214,6 @@
197214
}
198215

199216
&:disabled {
200-
background-color: $db-color-cool-gray-200;
201-
color: $db-color-cool-gray-700;
202-
opacity: 0.5;
217+
color: unquote($button---color + "80");
203218
}
204219
}

0 commit comments

Comments
 (0)