buymymojo.net/node_modules/nes.css/scss/form/radios.scss
2021-07-02 19:29:34 +10:00

76 lines
1.5 KiB
SCSS

.nes-radio {
// prettier-ignore
$radio: (
(1,1,0,0,0,0),
(1,1,1,1,0,0),
(1,1,1,1,1,0),
(1,1,1,1,1,1),
(1,1,1,1,1,0),
(1,1,1,1,0,0),
(1,1,0,0,0,0),
);
// prettier-ignore
$radio-checked-focus: (
(2,2,0,0,0,0),
(2,2,2,2,0,0),
(2,2,2,2,2,0),
(2,2,2,2,2,2),
(2,2,2,2,2,0),
(2,2,2,2,0,0),
(2,2,0,0,0,0),
);
$colors: ($base-color, map-get($default-colors, "shadow"));
$colors-radio-dark: ($color-white, map-get($default-colors, "shadow"));
margin-right: 20px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
@include visually-hidden();
& + span {
position: relative;
cursor: $cursor-click-url, pointer;
}
&:checked + span::before {
position: absolute;
top: -2px;
left: -20px;
content: "";
@include pixelize(2px, $radio, $colors);
}
&:checked:hover,
&:checked:focus {
& + span::before {
animation: blink 1s infinite steps(1);
}
}
&:checked:focus + span::before {
@include pixelize(2px, $radio-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, $radio-checked-focus, $colors-radio-dark);
color: $color-white;
}
&:checked:focus + span::before {
@include pixelize(2px, $radio-checked-focus, $colors-radio-dark);
color: $color-white;
}
}
}