Skip to content

Commit

Permalink
feat(checkbox): add dark mode to checkbox
Browse files Browse the repository at this point in the history
We need to add styles when the checkbox is on dark mode, currently, the
checkbox is not visible at all if the container is dark.
  • Loading branch information
Ilyeo committed Feb 6, 2019
1 parent e26de68 commit 9c4afae
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scss/form/checkboxes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
(2,2,2,2,2,2,2,2,0,0)
);
$colors: ($base-color, map-get($default-colors, "shadow"));
$colors-checkbox-dark: ($color-white, map-get($default-colors, "shadow"));

margin-left: 28px;
-webkit-appearance: none;
Expand Down Expand Up @@ -80,4 +81,24 @@
&:checked:focus + span::before {
@include pixelize(2px, $checkbox-checked-focus, $colors);
}
&.is-dark {
+ span {
color: $color-white;
}
// prettier-ignore
+ span::before { /* stylelint-disable-line no-descending-specificity */
color: $color-white;
}

&:checked + span::before {
@include pixelize(2px, $checkbox-checked-focus, $colors-checkbox-dark);

color: $color-white;
}
&:checked:focus + span::before {
@include pixelize(2px, $checkbox-checked-focus, $colors-checkbox-dark);

color: $color-white;
}
}
}

0 comments on commit 9c4afae

Please sign in to comment.