File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
resources/formats/html/templates Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ export async function resolveSassBundles(
142142 )
143143 ? "dark"
144144 : "light" ;
145- const targets : SassTarget [ ] = [ {
145+ let targets : SassTarget [ ] = [ {
146146 name : `${ dependency } .min.css` ,
147147 bundles : ( bundles as any ) ,
148148 attribs : {
@@ -175,10 +175,22 @@ export async function resolveSassBundles(
175175 ...attribForThemeStyle ( "dark" ) ,
176176 } ,
177177 } ;
178- if ( defaultStyle === "dark" ) {
178+ if ( defaultStyle === "dark" ) { // light, dark
179179 targets . push ( darkTarget ) ;
180- } else {
181- targets . unshift ( darkTarget ) ;
180+ } else { // light, dark, light
181+ const lightTargetExtra = {
182+ ...targets [ 0 ] ,
183+ attribs : {
184+ ...targets [ 0 ] . attribs ,
185+ class : "quarto-color-scheme-extra" ,
186+ } ,
187+ } ;
188+
189+ targets = [
190+ targets [ 0 ] ,
191+ darkTarget ,
192+ lightTargetExtra ,
193+ ] ;
182194 }
183195
184196 hasDarkStyles = true ;
Original file line number Diff line number Diff line change 4141 const alternateStylesheets = window .document .querySelectorAll (' link.quarto-color-scheme.quarto-color-alternate' );
4242 manageTransitions (' #quarto-margin-sidebar .nav-link' , false );
4343 if (alternate) {
44- disableStylesheet (primaryStylesheets)
44+ // note: dark is layered on light, we don't disable primary!
4545 enableStylesheet (alternateStylesheets);
4646 for (const sheetNode of alternateStylesheets) {
4747 if (sheetNode .id === " quarto-bootstrap" ) {
170170 < % } else { % >
171171 const darkModeDefault = < %= darkModeDefault % > ;
172172 < % } % >
173+
174+ < % if (! darkModeDefault) { % >
175+ document .querySelector (' link.quarto-color-scheme-extra' ).rel = ' disabled-stylesheet' ;
176+ < % } % >
173177
174178 let localAlternateSentinel = darkModeDefault ? ' alternate' : ' default' ;
175179
You can’t perform that action at this time.
0 commit comments