fix: exclude emphasis color styling from citation reference links (et al.)#366
fix: exclude emphasis color styling from citation reference links (et al.)#366
Conversation
|
This PR address the feedback from @HumphreyYang QuantEcon/lecture-python.myst#809 |
This comment was marked as outdated.
This comment was marked as outdated.
The theme's emphasis styling (color + semi-bold weight) was being applied to <em> tags inside citation reference links, causing 'et al.' text in references like 'Barillas et al. [2009]' to display with the emphasis color instead of inheriting the link color. Add 'a.reference em' overrides in base, dark theme, and color scheme styles to reset em tags inside reference links to inherit from their parent link element.
cb48009 to
36cb8a6
Compare
🎭 Visual Regression Test ResultsDetails
Skipped testsmobile-chrome › theme.spec.ts › Theme Features › f-string interpolation styling |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the theme’s emphasis styling so that et al. (rendered as <em>…</em> inside sphinxcontrib-bibtex citation links) no longer picks up the theme’s emphasis color/weight treatment and instead matches the surrounding citation link text.
Changes:
- Add CSS overrides for
<em>nested within Sphinx “reference” anchors to inherit the anchor’s styling. - Apply the override in the base (light) styles, dark theme overrides, and gruvbox color schemes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/quantecon_book_theme/assets/styles/_base.scss |
Adds an override for <em> inside a.reference to inherit link styling. |
src/quantecon_book_theme/assets/styles/_dark-theme.scss |
Adds a dark-mode override for <em> inside a.reference. |
src/quantecon_book_theme/assets/styles/_color-schemes.scss |
Adds gruvbox and gruvbox-dark overrides for <em> inside a.reference. |
Investigation SummaryAfter investigating the actual HTML output from <span id="id17">Barillas <em>et al.</em> [<a class="reference internal" href="...">2009</a>]</span>Additionally, the wrapper Upstream FixWe've submitted a 1-line fix to
If merged, this PR can be revised to use |
|
Summary
Fixes emphasis color styling being applied to
et al.text inside citation reference links.Problem
The theme's emphasis styling replaces italics with a colored, semi-bold treatment for
<em>tags. However, Sphinx/sphinxcontrib-bibtex renders "et al." inside citation links as<em>et al.</em>, which causes the emphasis color to be applied within the citation link text.For example, in a reference like:
The "et al." was displaying in teal (the emphasis color) instead of matching the rest of the link text.
From doubts_or_variability
Fix
Added
a.reference emCSS overrides that resetemtags inside reference links to inherit color and font-weight from their parent anchor element. Applied across:_base.scss— default light theme_dark-theme.scss— dark mode_color-schemes.scss— gruvbox and gruvbox dark variantsThe compiled CSS assets have been rebuilt.