Skip to content

Commit b8c1c5a

Browse files
committed
feat: add hover and active styling
1 parent bbbdc00 commit b8c1c5a

File tree

2 files changed

+165
-9
lines changed

2 files changed

+165
-9
lines changed

src/Shared/Components/Button/button.scss

Lines changed: 164 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,84 @@
1010
color: inherit;
1111
border: none;
1212
outline: inherit;
13+
text-decoration: none;
14+
text-transform: capitalize;
1315

14-
&:focus,
15-
&:active,
16-
&:hover {
17-
outline: unset;
18-
// border: unset;
19-
}
16+
// &:focus,
17+
// &:active,
18+
// &:hover {
19+
// outline: unset;
20+
// // border: unset;
21+
// }
22+
23+
// &:focus {
24+
// outline: auto;
25+
// }
2026

2127
&__primary {
2228
$border-color: transparent;
2329
$text-color: var(--N0);
2430

2531
&--default {
2632
@include button-variant-styles(var(--B500), $text-color, $border-color);
33+
34+
&:hover {
35+
background: var(--B600);
36+
}
37+
38+
&:active {
39+
background: var(--B700);
40+
}
2741
}
2842

2943
&--negative {
3044
@include button-variant-styles(var(--R500), $text-color, $border-color);
45+
46+
&:hover {
47+
background: var(--R600);
48+
}
49+
50+
&:active {
51+
background: var(--R700);
52+
}
3153
}
3254

3355
&--positive {
3456
@include button-variant-styles(var(--G500), $text-color, $border-color);
57+
58+
&:hover {
59+
background: var(--G600);
60+
}
61+
62+
&:active {
63+
background: var(--G700);
64+
}
3565
}
3666

3767
&--warning {
3868
$text-color: var(--N900);
3969

40-
@include button-variant-styles(var(--Y500), var(--N900), $border-color);
70+
@include button-variant-styles(var(--Y500), $text-color, $border-color);
71+
72+
&:hover {
73+
background: var(--Y600);
74+
}
75+
76+
&:active {
77+
background: var(--Y700);
78+
}
4179
}
4280

4381
&--neutral {
4482
@include button-variant-styles(var(--N500), $text-color, $border-color);
83+
84+
&:hover {
85+
background: var(--N600);
86+
}
87+
88+
&:active {
89+
background: var(--N700);
90+
}
4591
}
4692
}
4793

@@ -51,22 +97,62 @@
5197

5298
&--default {
5399
@include button-variant-styles($background, var(--B500), $border-color);
100+
101+
&:hover {
102+
background: var(--B100);
103+
}
104+
105+
&:active {
106+
background: var(--B200);
107+
}
54108
}
55109

56110
&--negative {
57111
@include button-variant-styles($background, var(--R600), $border-color);
112+
113+
&:hover {
114+
background: var(--R100);
115+
}
116+
117+
&:active {
118+
background: var(--R200);
119+
}
58120
}
59121

60122
&--positive {
61123
@include button-variant-styles($background, var(--G600), $border-color);
124+
125+
&:hover {
126+
background: var(--G100);
127+
}
128+
129+
&:active {
130+
background: var(--G200);
131+
}
62132
}
63133

64134
&--warning {
65135
@include button-variant-styles($background, var(--Y700), $border-color);
136+
137+
&:hover {
138+
background: var(--Y100);
139+
}
140+
141+
&:active {
142+
background: var(--Y200);
143+
}
66144
}
67145

68146
&--neutral {
69147
@include button-variant-styles($background, var(--N700), $border-color);
148+
149+
&:hover {
150+
background: var(--N100);
151+
}
152+
153+
&:active {
154+
background: var(--N200);
155+
}
70156
}
71157
}
72158

@@ -96,7 +182,77 @@
96182
}
97183
}
98184

185+
&__text {
186+
&--default {
187+
188+
&:hover {
189+
background: var(--B100);
190+
}
191+
192+
&:active {
193+
background: var(--B200);
194+
}
195+
}
196+
197+
&--negative {
198+
199+
&:hover {
200+
background: var(--R100);
201+
}
202+
203+
&:active {
204+
background: var(--R200);
205+
}
206+
}
207+
208+
&--positive {
209+
210+
&:hover {
211+
background: var(--G100);
212+
}
213+
214+
&:active {
215+
background: var(--G200);
216+
}
217+
}
218+
219+
&--warning {
220+
221+
&:hover {
222+
background: var(--Y100);
223+
}
224+
225+
&:active {
226+
background: var(--Y200);
227+
}
228+
}
229+
230+
&--neutral {
231+
232+
&:hover {
233+
background: var(--N100);
234+
}
235+
236+
&:active {
237+
background: var(--N200);
238+
}
239+
}
240+
}
241+
99242
&__link {
100-
padding: 0;
243+
244+
&--default,
245+
&--negative,
246+
&--positive,
247+
&--warning,
248+
&--neutral {
249+
padding: 0;
250+
min-width: 0;
251+
border: none;
252+
253+
&:hover {
254+
text-decoration: underline;
255+
}
256+
}
101257
}
102258
}

src/Shared/Components/Button/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { default as Button } from './Button.component'
2-
export type { ButtonProps, ButtonStyleType, ButtonVariantType } from './types'
2+
export * from './types'

0 commit comments

Comments
 (0)