Disable transitions when setting theme on startup
Remove a silly extra newline Remove unnecessary !important statements
This commit is contained in:
parent
296227e9fc
commit
b207f51b84
7
app.css
7
app.css
@ -56,6 +56,13 @@
|
|||||||
transition: 0.2s ease-in-out;
|
transition: 0.2s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notransition {
|
||||||
|
-webkit-transition: none;
|
||||||
|
-moz-transition: none;
|
||||||
|
-o-transition: none;
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
.withImageBackground {
|
.withImageBackground {
|
||||||
background-image: var(--imgcol), var(--imgbg);
|
background-image: var(--imgcol), var(--imgbg);
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
@ -25,7 +25,11 @@ const disableDark = () => {
|
|||||||
|
|
||||||
//Toggle theme
|
//Toggle theme
|
||||||
if (darkTheme === 'enabled') {
|
if (darkTheme === 'enabled') {
|
||||||
|
// Temporarily disable transitions when changing theme on startup
|
||||||
|
document.body.classList.add('notransition');
|
||||||
enableDark();
|
enableDark();
|
||||||
|
document.body.offsetHeight; // Trigger reflow to flush CSS changes
|
||||||
|
document.body.classList.remove('notransition');
|
||||||
} else {
|
} else {
|
||||||
disableDark();
|
disableDark();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user