mirror of
https://github.com/nostalgic-css/NES.css.git
synced 2025-08-30 09:20:02 +02:00
🎉 checkboxesを追加
This commit is contained in:
@@ -3,3 +3,4 @@
|
||||
@import "buttons.scss";
|
||||
@import "containers.scss";
|
||||
@import "radios.scss";
|
||||
@import "checkboxes.scss";
|
||||
|
51
scss/elements/checkboxes.scss
Normal file
51
scss/elements/checkboxes.scss
Normal file
@@ -0,0 +1,51 @@
|
||||
.checkbox {
|
||||
// prettier-ignore
|
||||
$checkbox: (
|
||||
(1,1,1,1,1,1,1,1,0,0),
|
||||
(1,0,0,0,0,0,0,1,0,0),
|
||||
(1,0,0,0,0,0,0,1,0,0),
|
||||
(1,0,0,0,0,0,0,1,0,0),
|
||||
(1,0,0,0,0,0,0,1,0,0),
|
||||
(1,0,0,0,0,0,0,1,0,0),
|
||||
(1,0,0,0,0,0,0,1,0,0),
|
||||
(1,1,1,1,1,1,1,1,0,0),
|
||||
);
|
||||
|
||||
// prettier-ignore
|
||||
$checkbox-checked: (
|
||||
(1,1,1,1,1,1,1,0,1,1),
|
||||
(1,0,0,0,0,0,0,1,1,1),
|
||||
(1,0,0,0,0,0,1,1,0,0),
|
||||
(1,1,0,0,0,1,1,0,0,0),
|
||||
(1,1,1,0,1,1,0,1,0,0),
|
||||
(1,0,1,1,1,0,0,1,0,0),
|
||||
(1,0,0,1,0,0,0,1,0,0),
|
||||
(1,1,1,1,1,1,1,1,0,0)
|
||||
);
|
||||
$colors: ($base-color);
|
||||
|
||||
margin-left: 28px;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
|
||||
& + span {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
& + span::before,
|
||||
&:checked + span::before {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
left: -28px;
|
||||
content: "";
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
& + span::before { /* stylelint-disable-line no-descending-specificity */
|
||||
@include pixelize($checkbox, $colors, 2px);
|
||||
}
|
||||
|
||||
&:checked + span::before {
|
||||
@include pixelize($checkbox-checked, $colors, 2px);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user