Cranberry palette refresh + dark mode - #291
Open
EmilHvitfeldt wants to merge 7 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts the Posit creative team's accessible cranberry color family (base
#BA355F) and adds a light/dark theme toggle to the site.Two logical pieces, sequenced so the palette refresh could stand alone:
#CA225E→#BA355Fand key the light theme off a named seven-step ramp.dark:theme with a navbar toggle, deriving the dark surface from the existing tidymodels ink (#1A162D), and make the previously light-only styles theme-aware.Palette and contrast guidance come from
Tidymodels-ColorGuidance-Accessibility-2025(Posit creative team), documented against WCAG 2.2 AA.What changed
_cranberry.scss(new): shared color ramp as SCSS variables ($cranberry-light-1…$cranberry-dark-3, surfaces, inks,$theme-blue/$theme-blue-dark), layered into both themes.styles.scss: base cranberry#BA355F, link/hover/focus-ring and table tints keyed off the ramp._quarto.yml:theme:moved underformat: html:as alight:/dark:mapping;respect-user-color-scheme: true.styles-dark.scss(new): dark Bootstrap defaults +.quarto-dark-scoped rule overrides (h2, code/tables/session-info, resource stickies, and the front page bands/event card; decorativetidy-back-*.svgbackgrounds hidden on dark).find/listing-cards.css,start/styles.css:.quarto-darkoverride blocks (plain CSS, ramp values inlined);start/styles.cssmirrored value updated to#BA355F.learn/models/parsnip-predictions/index.qmd: page-leveltheme:converted to the mapping shape so it merges with the site light/dark themes.README.md: new "Color palette" and "Light and dark themes" styling docs.Accessibility
Contrast ratios verified against the guidance (all pass their WCAG tiers):
#BA355Fon white#CB6585on#1A162D#919BCDon#1A162D#DDDDDDon#1A162D#BA355Fon whiteNotes / follow-ups
_cranberry.scssis listed last (Quarto emitsscss:defaultsfrom later-listed files first);styles-dark.scssis listed beforestyles.scssso its variable overrides win, with rule overrides scoped under.quarto-darkfor specificity. Documented in the README.parsnip-predictionsfreeze is invalidated by the front-matter fix and will re-render in CI. That first data-heavy render is the moment to review dark-mode output tables.#CA225Eand are simply hidden on dark; purpose-built dark variants are a possible future improvement.