Authored by ccbikai

代码格式化

... ... @@ -5,24 +5,26 @@
label {
padding-left: 33px;
&:before {
z-index: 8;
border: 2px solid $black;
content: "";
}
&:after {
position: absolute;
top: 6px;
left: 12px;
z-index: 9;
display: none;
content: "";
width: 8px;
height: 16px;
transform: rotate(45deg);
border: 2px solid $white;
border-top: 0;
border-left: 0;
content: "";
transform: rotate(45deg);
}
}
... ... @@ -34,6 +36,7 @@
width: 30px;
height: 30px;
}
input {
z-index: 10;
opacity: 0;
... ... @@ -44,6 +47,7 @@
~ label:before {
background: $black;
}
~ label:after {
display: block;
}
... ... @@ -54,9 +58,11 @@
~ label {
color: #ccc;
}
~ label:before {
border-color: #e4e4e4;
}
&:checked {
~ label:before {
background-color: #e4e4e4;
... ... @@ -69,50 +75,53 @@
label:before {
border-radius: 50%;
}
}
.switch {
display: inline-block;
input {
display: none;
&:checked ~ label {
border: 2px solid #4bd865;
box-shadow: inset 0 0 0 calc(20px) #4bd865;
box-shadow: inset 0 0 0 calc(56px / 2) #4bd865;
}
&:checked ~ label:after {
left: calc(80px - 40px);
left: calc(100px - 56px);
box-shadow: 0 5px 5px -1px rgba(0, 0, 0, 0.2), 0 0 0 2px #4bd865;
}
&:disabled ~ label {
opacity: 0.6;
}
&:disabled:checked ~ label {
opacity: 0.6;
}
}
label {
position: relative;
display: inline-block;
width: 80px;
height: 44px;
background-color: $white;
width: 100px;
height: 60px;
border: 2px solid #ddd;
border-radius: 99999px;
background-color: $white;
transition: 0.3s;
&:after {
content: "";
position: absolute;
left: 0;
width: 40px;
height: 40px;
width: 56px;
height: 56px;
border: none;
border-radius: 50%;
background-color: $white;
box-shadow: 0 5px 5px -1px rgba(0, 0, 0, 0.2), 0 0 0 2px #ddd;
content: "";
transition: 0.4s;
}
}
... ...