|
1 | 1 | .switch { |
2 | 2 | all: unset; |
3 | | - |
4 | | - display: inline-block; |
5 | | - color: currentColor; |
| 3 | + background: transparent; |
| 4 | + border: none; |
6 | 5 | border-radius: 50%; |
7 | | - border: 1.6px dashed currentColor; |
| 6 | + color: currentColor; |
8 | 7 | cursor: pointer; |
| 8 | + display: inline-block; |
9 | 9 | --size: 24px; |
10 | 10 | height: var(--size); |
11 | 11 | width: var(--size); |
12 | | - background: transparent; |
13 | 12 | transition: all 0.3s ease-in-out 0s !important; |
14 | 13 | } |
15 | 14 |
|
16 | 15 | .system-icon, .light-icon { |
17 | | - display: flex; |
18 | 16 | align-items: center; |
19 | | - justify-content: center; |
| 17 | + display: flex; |
20 | 18 | height: 100%; |
| 19 | + justify-content: center; |
21 | 20 | width: 100%; |
22 | 21 | } |
23 | 22 |
|
24 | 23 | .system-icon svg, .light-icon svg{ |
25 | | - width: 100%; |
26 | 24 | height: 100%; |
| 25 | + width: 100%; |
27 | 26 | } |
28 | 27 |
|
29 | 28 | [data-mode="system"] .switch::after{ |
30 | | - content: url(data:image/svg+xml,%3Csvg%20%0A%20%20viewBox%3D%220%200%2024%2024%22%20%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%0A%20%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%20%0A%20%20%3E%20%0A%20%20%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%2216%22%20height%3D%2212%22%20rx%3D%222%22%20stroke%3D%22grey%22%20fill%3D%22none%22%20%3E%3C%2Frect%3E%0A%20%20%3Crect%20x%3D%226%22%20y%3D%2218%22%20width%3D%2212%22%20height%3D%222%22%20rx%3D%221%22%20stroke%3D%22grey%22%3E%3C%2Frect%3E%20%0A%3C%2Fsvg%3E); |
| 29 | + content: url(data:image/svg+xml,%3Csvg%20%20%20%20%20%20viewBox%3D%220%200%2024%2024%22%20%20%20%20%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20%20%20%20%20fill%3D%22none%22%20%20%20%20%20%20strokeWidth%3D%222%22%20%20%20%20%20%20strokeLinecap%3D%22round%22%20%20%20%20%20%20strokeLinejoin%3D%22round%22%20%20%20%20%3E%3Crect%20x%3D%224%22%20y%3D%224%22%20width%3D%2216%22%20height%3D%2212%22%20rx%3D%222%22%20stroke%3D%22%236b7280%22%20fill%3D%22none%22%3E%3C%2Frect%3E%3Crect%20x%3D%226%22%20y%3D%2218%22%20width%3D%2212%22%20height%3D%222%22%20rx%3D%221%22%20stroke%3D%22%236b7280%22%3E%3C%2Frect%3E%3C%2Fsvg%3E); |
31 | 30 | } |
32 | 31 |
|
33 | 32 | [data-mode="system"] .switch:hover { |
34 | | - border: 1.5px solid #1e1b4b; |
| 33 | + background-color: #d4d4d4; |
35 | 34 | box-shadow: 0 0 10px 0px grey; |
36 | | - |
37 | 35 | } |
38 | 36 |
|
39 | 37 | [data-mode="dark"] .switch { |
| 38 | + animation: n linear 0.5s; |
40 | 39 | box-shadow: calc(var(--size) / 4) calc(var(--size) / -4) calc(var(--size) / 8) |
41 | 40 | inset #fff; |
42 | | - border: none; |
43 | | - background: transparent; |
44 | | - animation: n linear 0.5s; |
45 | 41 | } |
46 | 42 |
|
47 | 43 | [data-mode="dark"] .switch:hover { |
48 | | - border: 1.5px solid #1e1b4b; |
49 | 44 | box-shadow: 0 0 5px 5px orange; |
50 | | - |
51 | 45 | } |
52 | 46 |
|
53 | 47 | [data-mode="light"] .switch { |
54 | | - box-shadow: 0 0 30px 10px yellow; |
55 | | - border: none; |
56 | 48 | background-image: url(data:image/svg+xml,%3Csvg%20%0A%20%20viewBox%3D%220%200%2024%2024%22%20%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20fill%3D%22none%22%20%0A%20%20%0A%20%20strokeWidth%3D%222%22%20%0A%20%20strokeLinecap%3D%22round%22%20%0A%20%20strokeLinejoin%3D%22round%22%3E%0A%0A%20%20%3Cpath%20d%3D%22M12%202v3M18.66%205.344l-1.656%201.656M22.005%2012.004h-3M18.66%2018.664l-1.656-1.656M12%2022.01V19M5.34%2018.664l1.67-1.67M2.995%2012.004h3M5%205l1.67%201.67%22%20%20stroke%3D%22%23FFBE03%22%3E%3C%2Fpath%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%20stroke%3D%22%23FFBE03%22%20%2F%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%222.5%22%20stroke%3D%22%23FFCB03%22%20%2F%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%222%22%20stroke%3D%22%23FFD303%22%20%2F%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%221.5%22%20stroke%3D%22%23FFDB03%22%20%2F%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%221%22%20stroke%3D%22%23FFE403%22%20%2F%3E%0A%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%220.5%22%20fill%3D%22%23FFF003%22%20%2F%3E%0A%3C%2Fsvg%3E); |
| 49 | + box-shadow: 0 0 30px 10px yellow; |
57 | 50 | } |
58 | 51 |
|
59 | 52 | [data-mode="light"] .switch:hover { |
60 | | - border: none; |
61 | | - box-shadow: 0 0 40px 10px white; |
62 | 53 | background-color: #fef9e7; |
| 54 | + box-shadow: 0 0 40px 10px white; |
63 | 55 | transition: all 0s; |
64 | 56 | } |
65 | 57 |
|
|
0 commit comments