Feature Request
Summary
Allow users to customize the colors used for emphasis (em) and bold/strong (strong, b) text through html_theme_options in their Jupyter Book _config.yml.
Current Behavior
The theme uses hardcoded colors defined in SCSS:
- Emphasis (italics): Green (
#2d9f42)
- Bold/Strong: Brown (
#8b4513)
These colors are compiled into the CSS and cannot be changed without custom CSS overrides.
Proposed Solution
Add new theme options to allow customization:
# _config.yml
sphinx:
config:
html_theme_options:
emphasis_color: "#1a73e8"
emphasis_color_dark: "#8ab4f8"
definition_color: "#d93025"
definition_color_dark: "#f28b82"
Implementation Approach
- Add CSS custom properties (variables) to the theme CSS
- Expose these as theme options in
theme.conf
- Inject the custom property values via a Jinja template or inline styles
Example CSS variables approach:
:root {
--qe-emphasis-color: #2d9f42;
--qe-definition-color: #8b4513;
}
body.dark-theme {
--qe-emphasis-color: #66bb6a;
--qe-definition-color: #cd853f;
}
em {
color: var(--qe-emphasis-color);
}
strong, b {
color: var(--qe-definition-color);
}
Workaround
Until this feature is implemented, users can override colors with custom CSS. See: https://gist.github.com/mmcky/f3cd498225627424b3237a4b2fdb959f
Additional Context
This feature would make it easier for different QuantEcon projects to have consistent but distinct visual identities without requiring custom CSS files.
Feature Request
Summary
Allow users to customize the colors used for emphasis (
em) and bold/strong (strong,b) text throughhtml_theme_optionsin their Jupyter Book_config.yml.Current Behavior
The theme uses hardcoded colors defined in SCSS:
#2d9f42)#8b4513)These colors are compiled into the CSS and cannot be changed without custom CSS overrides.
Proposed Solution
Add new theme options to allow customization:
Implementation Approach
theme.confExample CSS variables approach:
Workaround
Until this feature is implemented, users can override colors with custom CSS. See: https://gist.github.com/mmcky/f3cd498225627424b3237a4b2fdb959f
Additional Context
This feature would make it easier for different QuantEcon projects to have consistent but distinct visual identities without requiring custom CSS files.