feat: Replace individual color options with color_scheme system (Seoul256 + Gruvbox)#360
feat: Replace individual color options with color_scheme system (Seoul256 + Gruvbox)#360
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #360 +/- ##
=======================================
Coverage ? 45.92%
=======================================
Files ? 2
Lines ? 405
Branches ? 0
=======================================
Hits ? 186
Misses ? 219
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🎭 Visual Regression Test ResultsDetails
Flaky testsdesktop-chrome › theme.spec.ts › Theme Features › math equation rendering Skipped testsmobile-chrome › theme.spec.ts › Theme Features › f-string interpolation styling |
|
/update-new-snapshots |
|
✅ Visual snapshots have been updated and committed to this PR. |
Replace 6 individual html_theme_options for emphasis/strong/definition colors (light + dark) with a single 'color_scheme' option. Ships with two built-in schemes: - seoul256 (default): Dark teal (#005f5f) for emphasis, dark amber (#875f00) for strong, with matching light variants (#5fafaf, #d7af5f) for dark mode. Inspired by the Seoul256 vim color scheme. - none: Restores standard typography (italic em, bold strong, no color). Users can override colors via a custom_color_scheme.css file in _static/ using CSS custom properties (--qe-emphasis-color, --qe-strong-color, --qe-definition-color). The theme auto-detects this file at build time. Updated: SCSS colors, dark theme, layout template, theme.conf, __init__.py validation, tests, docs, and CHANGELOG.
Add Gruvbox color palette alongside Seoul256: - Earthy aqua (#427b58 / #8ec07c) for emphasis - Warm orange (#af3a03 / #fe8019) for strong/definitions - All colors WCAG AA compliant (5.0-8.3:1 contrast ratios) Updated: _colors.scss, _color-schemes.scss, layout.html, __init__.py, tests, docs, and CHANGELOG.
b216916 to
f803033
Compare
|
/update-snapshots |
|
✅ All visual snapshots have been regenerated and committed to this PR. A |
- Remove [skip ci] from commit messages so snapshot updates trigger CI - Add direct link to workflow run artifacts in /update-snapshots PR comment
Summary
Replaces the 6 individual
html_theme_optionsfor emphasis/strong/definition colors (light + dark variants) with a singlecolor_schemeoption and a built-in palette system.Motivation
The previous approach exposed 6 separate color options (
emphasis_color,emphasis_color_dark,strong_color, etc.) which was complex to configure and lacked a cohesive design rationale. This PR simplifies configuration to a single option while shipping well-researched default palettes based on established vim color schemes.Changes
New
color_schemetheme optionThree built-in schemes:
seoul256(default)gruvboxnoneem, boldstrong, no color)Seoul256 Colors
em)#005f5fdark teal (7.7:1 contrast)#5fafafmedium-light teal (5.5:1)strong,b)#875f00dark amber (5.4:1 contrast)#d7af5flight amber-gold (7.0:1)dl dt)Gruvbox Colors
em)#427b58aqua green (5.2:1 contrast)#8ec07clight aqua green (8.3:1)strong,b)#af3a03burnt orange (5.0:1 contrast)#fe8019light orange (7.5:1)dl dt)All colors meet WCAG AA contrast requirements.
Custom override support
Users can place a
custom_color_scheme.cssfile in_static/to override colors via CSS custom properties (--qe-emphasis-color,--qe-strong-color,--qe-definition-color). The theme auto-detects this file at build time.Configuration
Breaking Changes
The following
html_theme_optionshave been removed:emphasis_color/emphasis_color_darkstrong_color/strong_color_darkdefinition_color/definition_color_darkMigration: Remove these options and use
color_scheme: "seoul256"(default) instead. For custom colors, place acustom_color_scheme.cssfile in_static/.Files Changed
_colors.scss— Seoul256 + Gruvbox palette variables_dark-theme.scss— Uses new SCSS dark-mode variables_color-schemes.scss— New file defininggruvboxandnonescheme classesindex.scss— Added@forward "color-schemes"theme.conf— Replaced 6 color options with singlecolor_scheme = seoul256layout.html— Replaced per-color CSS variable injection with scheme-based class toggle__init__.py— Newvalidate_color_scheme()function, auto-detection ofcustom_color_scheme.csstest_custom_colors.py— Fully rewritten test suite for the new scheme systemtest_module_structure.py— Added_color-schemes.scssto expected modulesconfigure.md— Updated documentation with scheme usage, color reference, and custom override instructionsCHANGELOG.md— Added unreleased entry with breaking changes