Skip to content

Commit c52a643

Browse files
authored
refactor: radio and checkbox simplification and correction (#446)
* refactor: code simplification * fix: background-color change on hover is only supposed work if unchecked and enabled
1 parent 665c6e4 commit c52a643

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

source/_patterns/01-elements/checkbox/checkbox.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@
3636
}
3737
}
3838

39-
&:not(:disabled) {
39+
&:enabled {
4040
&:hover {
4141
background-color: rgba(40, 45, 55, 0.14);
42-
}
4342

44-
&:checked {
45-
&:hover {
43+
&:checked {
4644
background-color: $checkbox-hover-checked-backgroundColor;
4745
}
4846
}

source/_patterns/01-elements/radio/radio.scss

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@
2323
vertical-align: sub;
2424
}
2525

26-
&:hover {
27-
background-color: rgba(40, 45, 55, 0.14);
28-
}
26+
&:enabled {
27+
&:hover {
28+
&:not(:checked) {
29+
background-color: rgba(40, 45, 55, 0.14);
30+
}
31+
}
2932

30-
&:active {
31-
background-color: rgba(40, 45, 55, 0.3);
33+
&:active {
34+
background-color: rgba(40, 45, 55, 0.3);
35+
}
3236
}
3337

3438
&:checked {

0 commit comments

Comments
 (0)