UI: simplify theme transition to clean crossfade
This commit is contained in:
parent
26148786d9
commit
31a3cbea85
@ -214,36 +214,17 @@ body {
|
|||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Theme transition */
|
/* Theme transition - clean crossfade */
|
||||||
@keyframes theme-circle-transition {
|
::view-transition-old(root),
|
||||||
0% {
|
::view-transition-new(root) {
|
||||||
clip-path: circle(0% at var(--theme-switch-x, 50%) var(--theme-switch-y, 50%));
|
animation-duration: 0.15s;
|
||||||
}
|
animation-timing-function: ease-out;
|
||||||
100% {
|
|
||||||
clip-path: circle(150% at var(--theme-switch-x, 50%) var(--theme-switch-y, 50%));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
html.theme-transition {
|
|
||||||
view-transition-name: theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
html.theme-transition::view-transition-old(theme) {
|
|
||||||
mix-blend-mode: normal;
|
|
||||||
animation: none;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
html.theme-transition::view-transition-new(theme) {
|
|
||||||
mix-blend-mode: normal;
|
|
||||||
z-index: 2;
|
|
||||||
animation: theme-circle-transition 0.4s var(--ease-out) forwards;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
html.theme-transition::view-transition-old(theme),
|
::view-transition-old(root),
|
||||||
html.theme-transition::view-transition-new(theme) {
|
::view-transition-new(root) {
|
||||||
animation: none !important;
|
animation: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user