-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
73 lines (64 loc) · 1.39 KB
/
style.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@import url('https://fonts.googleapis.com/css2?family=Berkshire+Swash&display=swap');
:root {
--light-theme: linear-gradient(#2980B9, #6DD5FA, #FFFFFF);
--dark-theme: linear-gradient(#2c3e50 10%, #000 74%);
}
body {
background: var(--light-theme);
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
flex-direction: column;
gap: 2rem;
font-family: 'Berkshire Swash', cursive;
font-size: 2em;
text-shadow: 5px 5px 2px #2980B9;
transition: .5s linear;
}
body.dark {
background: var(--dark-theme);
text-shadow: 5px 5px 2px #2c3e50;
color: #fff;
background-attachment: fixed;
transition: .5s linear;
}
.checkbox {
opacity: 0;
position: absolute;
}
.label {
width: 90px;
height: 30px;
background: var(--light-theme);
display: flex;
border-radius: 50px;
align-items: center;
justify-content: space-between;
padding: 5px;
position: relative;
transform: scale(1.5);
cursor: pointer;
}
.ball {
width: 30px;
height: 30px;
background-color: white;
position: absolute;
top: 5px;
left: 4px;
border-radius: 50%;
transition: transform 0.2s linear;
}
.moon,
.sun {
height: 25px;
margin: 2px;
}
.label.dark {
background: var(--dark-theme);
}
.checkbox:checked+.label .ball {
transform: translateX(60px);
}