Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Authoritative style guides:
- `latex-macros/` --- git submodule for shortcode/macro definitions (see `.gitmodules`)
- `R/`, `man/`, `DESCRIPTION`, `NAMESPACE` --- the project is also a small R package
- `references.bib` --- BibTeX bibliography
- `offwhite.scss`, `theme-picker.html` --- the website's Light / Off-white / Parchment / Dark theme dropdown (`theme-picker.html` builds it, `offwhite.scss` styles the two tinted palettes); the choice is saved under `mln-theme`, shared with the slides and with the other sites on this origin
- `offwhite.scss`, `theme-picker.html` --- the website's Light / Off-white / Parchment / Dark theme dropdown (`theme-picker.html` builds it, `offwhite.scss` styles the two tinted palettes);
the choice is saved under `lds-theme` (reading the older `mln-theme` as a fallback), shared with the slides and with the other sites on this origin
- `page-navigation.html` --- HTML include (`format.html.include-after-body`) that adds floating previous/next arrows in the page margins and fixes navbar highlighting now that Home is in the sidebar; vendored from `Morrison-Lab/lbt` (a private repo, so not linked)
- `anchor-landing.html` --- HTML include (`format.html.include-after-body`) that keeps the reader's place while equations and images change the page height
(the same file as in `Morrison-Lab/lds`)
Expand Down
12 changes: 7 additions & 5 deletions qwt-reveal-toggle.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
reads those vars so it stays legible in every palette. Light is the
default variable set, Off-white and Parchment are a data-palette attribute
on <html>, and Dark is the body.qwt-dark class. The choice is saved under
"mln-theme", the key the website's theme dropdown (theme-picker.html) uses,
so it carries across the site and the decks. First-time visitors get
Dark if their system prefers it, and Off-white otherwise.
"lds-theme" (falling back to "mln-theme"), the key the website's theme
dropdown (theme-picker.html) uses, so it carries across the site and the
decks. First-time visitors get Dark if their system prefers it, and
Off-white otherwise.
-->
<style>
#qwt-theme-select {
Expand Down Expand Up @@ -42,7 +43,8 @@
<script>
(function () {
"use strict";
var KEY = "mln-theme";
var KEY = "lds-theme";
var LEGACY_KEY = "mln-theme";
var DARK_CLASS = "qwt-dark";
var OPTIONS = [["light", "Light"], ["offwhite", "Off-white"], ["parchment", "Parchment"], ["dark", "Dark"]];
var root = document.documentElement;
Expand All @@ -52,7 +54,7 @@
}

function stored() {
try { return localStorage.getItem(KEY); } catch (e) { return null; }
try { return localStorage.getItem(KEY) || localStorage.getItem(LEGACY_KEY); } catch (e) { return null; }
}

function initialTheme() {
Expand Down
9 changes: 5 additions & 4 deletions theme-picker.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script>
// Theme dropdown: Light, Off-white, Parchment, Dark. Quarto's own toggle
// handles light/dark and remembers it; the two tinted palettes are a
// data-palette attribute on <html>. The choice is kept under "mln-theme".
// Off-white is the default for a first visit.
// data-palette attribute on <html>. The choice is kept under "lds-theme"
// (falling back to "mln-theme"). Off-white is the default for a first visit.
(function () {
var KEY = "mln-theme";
var KEY = "lds-theme";
var LEGACY_KEY = "mln-theme";
var OPTIONS = [["light", "Light"], ["offwhite", "Off-white"], ["parchment", "Parchment"], ["dark", "Dark"]];
function stored() {
try { return localStorage.getItem(KEY); } catch (e) { return null; }
try { return localStorage.getItem(KEY) || localStorage.getItem(LEGACY_KEY); } catch (e) { return null; }
}
function isDark() { return document.body.classList.contains("quarto-dark"); }
function apply(choice, remember) {
Expand Down
Loading