File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
packages/astro/src/core/errors Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " astro " : patch
3
+ ---
4
+
5
+ Fixed errorOverlay theme toggle bug.
Original file line number Diff line number Diff line change @@ -593,13 +593,14 @@ class ErrorOverlay extends HTMLElement {
593
593
window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches )
594
594
) {
595
595
this ?. classList . add ( 'astro-dark' ) ;
596
+ localStorage . astroErrorOverlayTheme = 'dark' ;
596
597
themeToggle ! . checked = true ;
597
598
} else {
598
599
this ?. classList . remove ( 'astro-dark' ) ;
599
600
themeToggle ! . checked = false ;
600
601
}
601
602
themeToggle ?. addEventListener ( 'click' , ( ) => {
602
- const isDark = localStorage . astroErrorOverlayTheme === 'dark' ;
603
+ const isDark = localStorage . astroErrorOverlayTheme === 'dark' || this ?. classList . contains ( 'astro-dark' ) ;
603
604
this ?. classList . toggle ( 'astro-dark' , ! isDark ) ;
604
605
localStorage . astroErrorOverlayTheme = isDark ? 'light' : 'dark' ;
605
606
} ) ;
You can’t perform that action at this time.
0 commit comments