improve theme toggle transition (#5387)
This commit is contained in:
parent
8e6ef69716
commit
5a630fc5c8
5 changed files with 7 additions and 7 deletions
|
|
@ -79,7 +79,7 @@ html {
|
|||
}
|
||||
|
||||
html.no-transitions * {
|
||||
transition-duration: 0ms !important;
|
||||
transition: none !important;
|
||||
}
|
||||
|
||||
body {
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ function updateTheme() {
|
|||
const $html = document.querySelector("html");
|
||||
$html.classList.add("no-transitions");
|
||||
$html.classList.toggle("dark", theme === THEME_DARK);
|
||||
window.requestAnimationFrame(function () {
|
||||
window.setTimeout(function () {
|
||||
$html.classList.remove("no-transitions");
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
|
||||
export function watchThemeChanges() {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
dist/index.html
vendored
4
dist/index.html
vendored
|
|
@ -20,8 +20,8 @@
|
|||
<meta name="theme-color" content="#020318" />
|
||||
|
||||
<title>evcc</title>
|
||||
<script type="module" crossorigin src="./assets/index.fc7dad78.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index.8ba2569b.css">
|
||||
<script type="module" crossorigin src="./assets/index.a61ffbf5.js"></script>
|
||||
<link rel="stylesheet" href="./assets/index.c173ebc0.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue