Skip to content

Commit 357ed0d

Browse files
committed
feat: add negative grey variant
1 parent 0fa5660 commit 357ed0d

File tree

2 files changed

+45
-9
lines changed

2 files changed

+45
-9
lines changed

src/Shared/Components/Button/button.scss

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
@mixin svg-styles($color) {
2+
svg *[stroke^="#"] {
3+
stroke: $color;
4+
}
5+
6+
svg *[fill^="#"] {
7+
fill: $color;
8+
}
9+
}
10+
111
@mixin button-variant-styles($background, $text-color, $border-color) {
212
background: $background;
313
color: $text-color;
@@ -7,13 +17,7 @@
717
color: $text-color;
818
}
919

10-
svg *[stroke^="#"] {
11-
stroke: $text-color;
12-
}
13-
14-
svg *[fill^="#"] {
15-
fill: $text-color;
16-
}
20+
@include svg-styles($text-color);
1721

1822
// Custom state for loader
1923
// Added using css to ensure using the respective text-color
@@ -29,7 +33,7 @@
2933
}
3034
}
3135

32-
@mixin pseudo-states($hover-bg-color, $active-bg-color, $hover-border-color: null) {
36+
@mixin pseudo-states($hover-bg-color, $active-bg-color, $hover-border-color: null, $color: null) {
3337
$parent-selector: &;
3438

3539
&:hover:not([disabled]) {
@@ -38,10 +42,22 @@
3842
@if ($hover-border-color) {
3943
border-color: $hover-border-color;
4044
}
45+
46+
@if ($color) {
47+
color: $color;
48+
49+
@include svg-styles($color);
50+
}
4151
}
4252

4353
&:active:not([disabled]) {
4454
background: $active-bg-color;
55+
56+
@if ($color) {
57+
color: $color;
58+
59+
@include svg-styles($color);
60+
}
4561
}
4662
}
4763

@@ -67,6 +83,11 @@
6783
@include pseudo-states(var(--R600), var(--R700));
6884
}
6985

86+
&--negative-grey {
87+
@include button-variant-styles(var(--N600), $text-color, $border-color);
88+
@include pseudo-states(var(--R600), var(--R700), null, $text-color);
89+
}
90+
7091
&--positive {
7192
@include button-variant-styles(var(--G500), $text-color, $border-color);
7293
@include pseudo-states(var(--G600), var(--G700));
@@ -94,7 +115,12 @@
94115

95116
&--negative {
96117
@include button-variant-styles($background, var(--R600), $border-color);
97-
@include pseudo-states(var(--R100), var(--R200), var(--R600));
118+
@include pseudo-states(var(--R100), var(--R200), var(--R600), var(--R600));
119+
}
120+
121+
&--negative-grey {
122+
@include button-variant-styles($background, var(--N700), $border-color);
123+
@include pseudo-states(var(--R100), var(--R200), var(--R600), var(--R600));
98124
}
99125

100126
&--positive {
@@ -127,6 +153,10 @@
127153
@include button-variant-styles($background, var(--R600), $border-color);
128154
}
129155

156+
&--negative-grey {
157+
@include button-variant-styles($background, var(--N700), $border-color);
158+
}
159+
130160
&--positive {
131161
@include button-variant-styles($background, var(--G600), $border-color);
132162
}
@@ -150,6 +180,10 @@
150180
@include pseudo-states(var(--R100), var(--R200));
151181
}
152182

183+
&--negative-grey {
184+
@include pseudo-states(var(--R100), var(--R200), null, var(--R500));
185+
}
186+
153187
&--positive {
154188
@include pseudo-states(var(--G100), var(--G200));
155189
}
@@ -168,6 +202,7 @@
168202

169203
&--default,
170204
&--negative,
205+
&--negative-grey,
171206
&--positive,
172207
&--warning,
173208
&--neutral {

src/Shared/Components/Button/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export enum ButtonVariantType {
1414
export enum ButtonStyleType {
1515
default = 'default',
1616
negative = 'negative',
17+
negativeGrey = 'negative-grey',
1718
positive = 'positive',
1819
warning = 'warning',
1920
neutral = 'neutral',

0 commit comments

Comments
 (0)