Skip to content

Commit fdb4331

Browse files
committed
remove dark mode
1 parent 84451c6 commit fdb4331

File tree

2 files changed

+3
-149
lines changed

2 files changed

+3
-149
lines changed

docs/index.html

Lines changed: 2 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@
3030
<script src="index_files/libs/quarto-html/tippy.umd.min.js"></script>
3131
<script src="index_files/libs/quarto-html/anchor.min.js"></script>
3232
<link href="index_files/libs/quarto-html/tippy.css" rel="stylesheet">
33-
<link href="index_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
34-
<link href="index_files/libs/quarto-html/quarto-syntax-highlighting-dark.css" rel="prefetch" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
33+
<link href="index_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
3534
<script src="index_files/libs/bootstrap/bootstrap.min.js"></script>
3635
<link href="index_files/libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
37-
<link href="index_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
38-
<link href="index_files/libs/bootstrap/bootstrap-dark.min.css" rel="prefetch" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="dark">
36+
<link href="index_files/libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light">
3937

4038
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
4139
<script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
@@ -174,150 +172,6 @@ <h1>Was kann Datawrapper sonst?</h1>
174172
}
175173
}
176174
toggleBodyColorPrimary();
177-
const disableStylesheet = (stylesheets) => {
178-
for (let i=0; i < stylesheets.length; i++) {
179-
const stylesheet = stylesheets[i];
180-
stylesheet.rel = 'prefetch';
181-
}
182-
}
183-
const enableStylesheet = (stylesheets) => {
184-
for (let i=0; i < stylesheets.length; i++) {
185-
const stylesheet = stylesheets[i];
186-
stylesheet.rel = 'stylesheet';
187-
}
188-
}
189-
const manageTransitions = (selector, allowTransitions) => {
190-
const els = window.document.querySelectorAll(selector);
191-
for (let i=0; i < els.length; i++) {
192-
const el = els[i];
193-
if (allowTransitions) {
194-
el.classList.remove('notransition');
195-
} else {
196-
el.classList.add('notransition');
197-
}
198-
}
199-
}
200-
const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => {
201-
const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light';
202-
const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark';
203-
let newTheme = '';
204-
if(darkModeDefault) {
205-
newTheme = isAlternate ? baseTheme : alternateTheme;
206-
} else {
207-
newTheme = isAlternate ? alternateTheme : baseTheme;
208-
}
209-
const changeGiscusTheme = () => {
210-
// From: https://github.com/giscus/giscus/issues/336
211-
const sendMessage = (message) => {
212-
const iframe = document.querySelector('iframe.giscus-frame');
213-
if (!iframe) return;
214-
iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
215-
}
216-
sendMessage({
217-
setConfig: {
218-
theme: newTheme
219-
}
220-
});
221-
}
222-
const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null;
223-
if (isGiscussLoaded) {
224-
changeGiscusTheme();
225-
}
226-
}
227-
const toggleColorMode = (alternate) => {
228-
// Switch the stylesheets
229-
const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate');
230-
manageTransitions('#quarto-margin-sidebar .nav-link', false);
231-
if (alternate) {
232-
enableStylesheet(alternateStylesheets);
233-
for (const sheetNode of alternateStylesheets) {
234-
if (sheetNode.id === "quarto-bootstrap") {
235-
toggleBodyColorMode(sheetNode);
236-
}
237-
}
238-
} else {
239-
disableStylesheet(alternateStylesheets);
240-
toggleBodyColorPrimary();
241-
}
242-
manageTransitions('#quarto-margin-sidebar .nav-link', true);
243-
// Switch the toggles
244-
const toggles = window.document.querySelectorAll('.quarto-color-scheme-toggle');
245-
for (let i=0; i < toggles.length; i++) {
246-
const toggle = toggles[i];
247-
if (toggle) {
248-
if (alternate) {
249-
toggle.classList.add("alternate");
250-
} else {
251-
toggle.classList.remove("alternate");
252-
}
253-
}
254-
}
255-
// Hack to workaround the fact that safari doesn't
256-
// properly recolor the scrollbar when toggling (#1455)
257-
if (navigator.userAgent.indexOf('Safari') > 0 && navigator.userAgent.indexOf('Chrome') == -1) {
258-
manageTransitions("body", false);
259-
window.scrollTo(0, 1);
260-
setTimeout(() => {
261-
window.scrollTo(0, 0);
262-
manageTransitions("body", true);
263-
}, 40);
264-
}
265-
}
266-
const isFileUrl = () => {
267-
return window.location.protocol === 'file:';
268-
}
269-
const hasAlternateSentinel = () => {
270-
let styleSentinel = getColorSchemeSentinel();
271-
if (styleSentinel !== null) {
272-
return styleSentinel === "alternate";
273-
} else {
274-
return false;
275-
}
276-
}
277-
const setStyleSentinel = (alternate) => {
278-
const value = alternate ? "alternate" : "default";
279-
if (!isFileUrl()) {
280-
window.localStorage.setItem("quarto-color-scheme", value);
281-
} else {
282-
localAlternateSentinel = value;
283-
}
284-
}
285-
const getColorSchemeSentinel = () => {
286-
if (!isFileUrl()) {
287-
const storageValue = window.localStorage.getItem("quarto-color-scheme");
288-
return storageValue != null ? storageValue : localAlternateSentinel;
289-
} else {
290-
return localAlternateSentinel;
291-
}
292-
}
293-
const darkModeDefault = false;
294-
let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default';
295-
// Dark / light mode switch
296-
window.quartoToggleColorScheme = () => {
297-
// Read the current dark / light value
298-
let toAlternate = !hasAlternateSentinel();
299-
toggleColorMode(toAlternate);
300-
setStyleSentinel(toAlternate);
301-
toggleGiscusIfUsed(toAlternate, darkModeDefault);
302-
};
303-
// Ensure there is a toggle, if there isn't float one in the top right
304-
if (window.document.querySelector('.quarto-color-scheme-toggle') === null) {
305-
const a = window.document.createElement('a');
306-
a.classList.add('top-right');
307-
a.classList.add('quarto-color-scheme-toggle');
308-
a.href = "";
309-
a.onclick = function() { try { window.quartoToggleColorScheme(); } catch {} return false; };
310-
const i = window.document.createElement("i");
311-
i.classList.add('bi');
312-
a.appendChild(i);
313-
window.document.body.appendChild(a);
314-
}
315-
// Switch to dark mode if need be
316-
if (hasAlternateSentinel()) {
317-
toggleColorMode(true);
318-
} else {
319-
toggleColorMode(false);
320-
}
321175
const icon = "";
322176
const anchorJS = new window.AnchorJS();
323177
anchorJS.options = {

docs/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ format:
88
html:
99
theme:
1010
light: default
11-
dark: darkly
11+
#dark: darkly
1212
---
1313

1414
:::{.callout-note}

0 commit comments

Comments
 (0)