Skip to content

Commit 16d4bd1

Browse files
committed
refactor: added further relevant styles
1 parent ea913d7 commit 16d4bd1

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@import "../../00-base/colors/colors.variables";
44

55
$checkbox---backgroundColor: rgba(255, 255, 255, 0.1) !default;
6-
$checkbox---borderColor: $db-color-cool-gray-700 !default;
6+
$checkbox---borderColor: currentColor !default;
77
$checkbox---color: $db-color-cool-gray-700 !default;
88

99
$checkbox--checked-backgroundColor: $db-color-cool-gray-700 !default;

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

+18-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
align-content: center;
99

1010
appearance: none;
11-
background-color: $checkbox---backgroundColor;
11+
@media (prefers-color-scheme: light) {
12+
background-color: $checkbox---backgroundColor;
13+
}
1214
border: #{to-rem($pxValue: 1)} solid $checkbox---borderColor;
1315
border-radius: 4px;
14-
color: $checkbox---color;
16+
@media (prefers-color-scheme: light) {
17+
color: $checkbox---color;
18+
}
1519

1620
display: inline-flex;
1721
height: to-rem($pxValue: 24);
@@ -24,21 +28,29 @@
2428

2529
&::before {
2630
--icon-font-size: 1.375rem;
31+
color: inherit;
2732
margin-right: 0;
2833
}
2934

3035
&:checked {
3136
background-color: $checkbox--checked-backgroundColor;
37+
color: $checkbox--checked-color;
38+
@media (prefers-color-scheme: dark) {
39+
color: $checkbox---color;
40+
background-color: $db-color-white;
41+
}
3242

3343
&::before {
34-
color: $checkbox--checked-color;
3544
content: glyph(done);
3645
}
3746
}
3847

3948
&:enabled {
4049
&:hover {
4150
background-color: rgba(40, 45, 55, 0.14);
51+
@media (prefers-color-scheme: dark) {
52+
background-color: rgba(255, 255, 255, 0.03);
53+
}
4254

4355
&:checked {
4456
background-color: $checkbox-hover-checked-backgroundColor;
@@ -47,6 +59,9 @@
4759

4860
&:active {
4961
background-color: rgba(40, 45, 55, 0.14);
62+
@media (prefers-color-scheme: dark) {
63+
background-color: rgba(255, 255, 255, 0.06);
64+
}
5065
}
5166
}
5267

0 commit comments

Comments
 (0)