1
0
mirror of https://github.com/nostalgic-css/NES.css.git synced 2025-09-03 11:02:43 +02:00

🎉 radiosを追加

This commit is contained in:
BcRikko
2018-11-26 09:01:32 +09:00
parent f1e9ebc8e3
commit 1a34fe4bff
12 changed files with 131 additions and 17 deletions

View File

@@ -2,3 +2,4 @@
@import "buttons.scss";
@import "containers.scss";
@import "radios.scss";

32
scss/elements/radios.scss Normal file
View File

@@ -0,0 +1,32 @@
.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),
);
$colors: ($base-color);
margin-right: 20px;
-webkit-appearance: none;
appearance: none;
& + span {
position: relative;
}
&:checked + span::before {
position: absolute;
top: -2px;
left: -20px;
content: "";
@include pixelize($radio, $colors, 2px);
animation: blink 1s infinite steps(1);
}
}

View File

@@ -5,4 +5,5 @@
*/
@import "base/_index.scss";
@import "utilities/_index.scss";
@import "elements/_index.scss";

View File

@@ -0,0 +1,4 @@
@charset "utf-8";
@import "animations.scss";
@import "icon-mixin.scss";

View File

@@ -0,0 +1,9 @@
@keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
}

View File

@@ -0,0 +1,24 @@
@mixin pixelize($matrix, $colors, $size) {
$ret: "";
@for $i from 1 through length($matrix) {
$row: nth($matrix, $i);
@for $j from 1 through length($row) {
$dot: nth($row, $j);
@if $dot != 0 {
@if $ret != "" {
$ret: $ret + ",";
}
$color: nth($colors, $dot);
$ret: $ret + ($j * $size) + " " + ($i * $size) + " " + $color;
}
}
}
width: $size;
height: $size;
box-shadow: unquote($ret + ";");
}