feat: implement theme toggle switch

This commit is contained in:
Stevan Freeborn
2023-04-20 23:36:52 -05:00
parent 8eb224e018
commit 88d4c1c339
10 changed files with 138 additions and 70 deletions
+74 -22
View File
@@ -3,9 +3,9 @@
flex-direction: column;
height: 100%;
border-right: 1px solid #848586;
padding: 1rem;
padding: 0 1rem;
overflow: auto;
scrollbar-color: transparent #0b3766;
background-color: inherit;
}
@media screen and (max-width: 1000px) {
@@ -14,27 +14,20 @@
}
}
.container::-webkit-scrollbar {
background-color: transparent;
}
.container::-webkit-scrollbar-thumb {
background-color: transparent;
border-radius: 10px;
}
.container:hover::-webkit-scrollbar-thumb {
background-color: #0b3766;
}
.container::-webkit-scrollbar-corner {
background-color: transparent;
}
.link {
text-decoration: none;
}
.titleContainer {
position: sticky;
top: 0;
display: flex;
align-items: center;
justify-content: space-between;
background-color: inherit;
padding-top: 1rem;
}
.title {
font-size: 1rem;
white-space: nowrap;
@@ -43,7 +36,6 @@
.onspring {
font-weight: bold;
color: white;
}
.api {
@@ -73,11 +65,10 @@
.link,
.activeLink {
text-decoration: none;
color: #a3acb9;
}
.link:hover {
color: white;
color: #64adac;
}
.activeLink {
@@ -100,4 +91,65 @@
.chevron {
margin-left: 0.5rem;
}
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 20px;
margin-bottom: 1rem;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
text-align: center;
position: absolute;
content: "";
height: 12px;
width: 12px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked+.slider {
background-color: #05254a;
}
input:focus+.slider {
box-shadow: 0 0 1px #05254a;
}
input:checked+.slider:before {
-webkit-transform: translateX(40px);
-ms-transform: translateX(40px);
transform: translateX(40px);
}
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}