generated from react18-tools/turborepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4124e4d
commit 5fc733b
Showing
4 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,52 @@ | ||
.switch { | ||
/* create your container styles here */ | ||
} | ||
all: unset; | ||
position: relative; | ||
color: currentColor; | ||
border-radius: 50%; | ||
border: 1px dashed currentColor; | ||
cursor: pointer; | ||
--size: 24px; | ||
height: var(--size); | ||
width: var(--size); | ||
transition: all 0.3s ease-in-out 0s !important; | ||
} | ||
|
||
[data-m="system"] .switch::after { | ||
position: absolute; | ||
height: 100%; | ||
width: 100%; | ||
top: 0; | ||
left: 0; | ||
font-weight: 600; | ||
font-size: calc(var(--size) / 2); | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
content: "A"; | ||
} | ||
|
||
[data-rm="light"] .switch { | ||
box-shadow: 0 0 50px 10px yellow; | ||
background-color: yellow; | ||
border: 1px solid orangered; | ||
} | ||
|
||
[data-rm="dark"] .switch { | ||
box-shadow: calc(var(--size) / 4) calc(var(--size) / -4) calc(var(--size) / 8) inset #fff; | ||
border: none; | ||
background: transparent; | ||
animation: swing linear 0.5s; | ||
} | ||
|
||
@keyframes swing { | ||
40% { | ||
transform: rotate(-15deg); | ||
} | ||
80% { | ||
transform: rotate(10deg); | ||
} | ||
0%, | ||
100% { | ||
transform: rotate(0deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters