Authored by ccbikai

代码格式化

@@ -5,24 +5,26 @@ @@ -5,24 +5,26 @@
5 5
6 label { 6 label {
7 padding-left: 33px; 7 padding-left: 33px;
  8 +
8 &:before { 9 &:before {
9 z-index: 8; 10 z-index: 8;
10 border: 2px solid $black; 11 border: 2px solid $black;
11 content: ""; 12 content: "";
12 } 13 }
  14 +
13 &:after { 15 &:after {
14 position: absolute; 16 position: absolute;
15 top: 6px; 17 top: 6px;
16 left: 12px; 18 left: 12px;
17 z-index: 9; 19 z-index: 9;
18 display: none; 20 display: none;
19 - content: "";  
20 width: 8px; 21 width: 8px;
21 height: 16px; 22 height: 16px;
22 - transform: rotate(45deg);  
23 border: 2px solid $white; 23 border: 2px solid $white;
24 border-top: 0; 24 border-top: 0;
25 border-left: 0; 25 border-left: 0;
  26 + content: "";
  27 + transform: rotate(45deg);
26 } 28 }
27 } 29 }
28 30
@@ -34,6 +36,7 @@ @@ -34,6 +36,7 @@
34 width: 30px; 36 width: 30px;
35 height: 30px; 37 height: 30px;
36 } 38 }
  39 +
37 input { 40 input {
38 z-index: 10; 41 z-index: 10;
39 opacity: 0; 42 opacity: 0;
@@ -44,6 +47,7 @@ @@ -44,6 +47,7 @@
44 ~ label:before { 47 ~ label:before {
45 background: $black; 48 background: $black;
46 } 49 }
  50 +
47 ~ label:after { 51 ~ label:after {
48 display: block; 52 display: block;
49 } 53 }
@@ -54,9 +58,11 @@ @@ -54,9 +58,11 @@
54 ~ label { 58 ~ label {
55 color: #ccc; 59 color: #ccc;
56 } 60 }
  61 +
57 ~ label:before { 62 ~ label:before {
58 border-color: #e4e4e4; 63 border-color: #e4e4e4;
59 } 64 }
  65 +
60 &:checked { 66 &:checked {
61 ~ label:before { 67 ~ label:before {
62 background-color: #e4e4e4; 68 background-color: #e4e4e4;
@@ -69,50 +75,53 @@ @@ -69,50 +75,53 @@
69 label:before { 75 label:before {
70 border-radius: 50%; 76 border-radius: 50%;
71 } 77 }
72 -  
73 } 78 }
74 79
75 .switch { 80 .switch {
76 display: inline-block; 81 display: inline-block;
  82 +
77 input { 83 input {
78 display: none; 84 display: none;
  85 +
79 &:checked ~ label { 86 &:checked ~ label {
80 border: 2px solid #4bd865; 87 border: 2px solid #4bd865;
81 - box-shadow: inset 0 0 0 calc(20px) #4bd865; 88 + box-shadow: inset 0 0 0 calc(56px / 2) #4bd865;
82 } 89 }
  90 +
83 &:checked ~ label:after { 91 &:checked ~ label:after {
84 - left: calc(80px - 40px); 92 + left: calc(100px - 56px);
85 box-shadow: 0 5px 5px -1px rgba(0, 0, 0, 0.2), 0 0 0 2px #4bd865; 93 box-shadow: 0 5px 5px -1px rgba(0, 0, 0, 0.2), 0 0 0 2px #4bd865;
86 } 94 }
87 95
88 &:disabled ~ label { 96 &:disabled ~ label {
89 opacity: 0.6; 97 opacity: 0.6;
90 } 98 }
  99 +
91 &:disabled:checked ~ label { 100 &:disabled:checked ~ label {
92 opacity: 0.6; 101 opacity: 0.6;
93 } 102 }
94 -  
95 } 103 }
  104 +
96 label { 105 label {
97 position: relative; 106 position: relative;
98 display: inline-block; 107 display: inline-block;
99 - width: 80px;  
100 - height: 44px;  
101 - background-color: $white; 108 + width: 100px;
  109 + height: 60px;
102 border: 2px solid #ddd; 110 border: 2px solid #ddd;
103 border-radius: 99999px; 111 border-radius: 99999px;
  112 + background-color: $white;
104 transition: 0.3s; 113 transition: 0.3s;
105 114
106 &:after { 115 &:after {
107 - content: "";  
108 position: absolute; 116 position: absolute;
109 left: 0; 117 left: 0;
110 - width: 40px;  
111 - height: 40px; 118 + width: 56px;
  119 + height: 56px;
112 border: none; 120 border: none;
113 border-radius: 50%; 121 border-radius: 50%;
114 background-color: $white; 122 background-color: $white;
115 box-shadow: 0 5px 5px -1px rgba(0, 0, 0, 0.2), 0 0 0 2px #ddd; 123 box-shadow: 0 5px 5px -1px rgba(0, 0, 0, 0.2), 0 0 0 2px #ddd;
  124 + content: "";
116 transition: 0.4s; 125 transition: 0.4s;
117 } 126 }
118 } 127 }