From 36cb8a6e75fd8463fb2f560558fa4f5e2a368c1f Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Thu, 19 Feb 2026 18:17:04 +1100 Subject: [PATCH] fix: exclude emphasis color styling from citation reference links The theme's emphasis styling (color + semi-bold weight) was being applied to 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. --- src/quantecon_book_theme/assets/styles/_base.scss | 8 ++++++++ .../assets/styles/_color-schemes.scss | 11 +++++++++++ .../assets/styles/_dark-theme.scss | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/src/quantecon_book_theme/assets/styles/_base.scss b/src/quantecon_book_theme/assets/styles/_base.scss index 24ba341..ad14d31 100644 --- a/src/quantecon_book_theme/assets/styles/_base.scss +++ b/src/quantecon_book_theme/assets/styles/_base.scss @@ -154,6 +154,14 @@ em { color: var(--qe-emphasis-color, colors.$emphasis); } +// Reset emphasis styling inside citation reference links +// Prevents "et al." in references from inheriting emphasis color +a.reference em { + font-style: normal; + font-weight: inherit; + color: inherit; +} + // Strong/bold styling - semi-bold weight with color strong, b { diff --git a/src/quantecon_book_theme/assets/styles/_color-schemes.scss b/src/quantecon_book_theme/assets/styles/_color-schemes.scss index 8522258..24d5601 100644 --- a/src/quantecon_book_theme/assets/styles/_color-schemes.scss +++ b/src/quantecon_book_theme/assets/styles/_color-schemes.scss @@ -24,6 +24,12 @@ body.color-scheme-gruvbox { font-weight: 600; } + // Reset emphasis styling inside citation reference links (gruvbox) + a.reference em { + color: inherit; + font-weight: inherit; + } + strong, b { color: var(--qe-strong-color, colors.$gruvbox-definition); @@ -40,6 +46,11 @@ body.color-scheme-gruvbox { color: var(--qe-emphasis-color, colors.$gruvbox-emphasis-dark); } + // Reset emphasis styling inside citation reference links (gruvbox dark) + a.reference em { + color: inherit; + } + strong, b { color: var(--qe-strong-color, colors.$gruvbox-definition-dark); diff --git a/src/quantecon_book_theme/assets/styles/_dark-theme.scss b/src/quantecon_book_theme/assets/styles/_dark-theme.scss index f273645..80fd05c 100644 --- a/src/quantecon_book_theme/assets/styles/_dark-theme.scss +++ b/src/quantecon_book_theme/assets/styles/_dark-theme.scss @@ -26,6 +26,11 @@ body.dark-theme { color: var(--qe-emphasis-color, colors.$emphasis-dark); } + // Reset emphasis styling inside citation reference links (dark mode) + a.reference em { + color: inherit; + } + strong, b { color: var(--qe-strong-color, colors.$definition-dark);