File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1818 currentMathjaxRenderLatex = DEFAULT_MATHJAX_RENDER_LATEX ,
1919 currentMedia = DEFAULT_MEDIA ,
2020 currentRtl = false ,
21+ currentTheme = 'light' ,
2122 currentViewportHeight = 0 ,
2223 currentViewportWidth = 0 ,
2324 shouldResetMouse = false ;
@@ -47,6 +48,7 @@ export async function reset(opts = {}) {
4748 lang : DEFAULT_LANG ,
4849 mathjax : { } ,
4950 rtl : ! ! opts . lang ?. startsWith ( 'ar' ) ,
51+ theme : 'light' ,
5052 pagePadding : DEFAULT_PAGE_PADDING ,
5153 media : DEFAULT_MEDIA
5254 } ;
@@ -89,6 +91,13 @@ export async function reset(opts = {}) {
8991 currentRtl = opts . rtl ;
9092 }
9193
94+ if ( opts . theme !== currentTheme ) {
95+ let theme = [ 'light' , 'dark' ] . includes ( opts . theme ) ? opts . theme : 'light' ;
96+ document . documentElement . dataset . theme = theme ;
97+ awaitNextFrame = true ;
98+ currentTheme = theme ;
99+ }
100+
92101 opts . lang ??= '' ;
93102 if ( documentLocaleSettings . language !== opts . lang ) {
94103 document . documentElement . lang = opts . lang ;
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ export class WTRConfig {
118118 font-size: 20px;
119119 }
120120 body {
121- background-color: #ffffff ;
121+ background-color: var(--d2l-color-background-base) ;
122122 color: var(--d2l-color-ferrite, #202122);
123123 font-family: 'Lato', sans-serif;
124124 letter-spacing: 0.01rem;
You can’t perform that action at this time.
0 commit comments