Skip to content

Commit 6476d11

Browse files
authored
fix: exclude emphasis color styling from citation reference links (et al.) (#366)
* fix: exclude emphasis color styling from citation reference links 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. * fix: update sphinxcontrib-bibtex upper bound to <3 (was <=2.5.0)
1 parent 04c716a commit 6476d11

4 files changed

Lines changed: 25 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ doc = [
6464
"sphinx-copybutton",
6565
"docutils>=0.20",
6666
"plotly",
67-
"sphinxcontrib-bibtex>=2.2.0,<=2.5.0",
67+
"sphinxcontrib-bibtex>=2.2.0,<3",
6868
]
6969
test = [
7070
"myst_nb",

src/quantecon_book_theme/assets/styles/_base.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ em {
154154
color: var(--qe-emphasis-color, colors.$emphasis);
155155
}
156156

157+
// Reset emphasis styling inside citation reference links
158+
// Prevents "et al." in references from inheriting emphasis color
159+
a.reference em {
160+
font-style: normal;
161+
font-weight: inherit;
162+
color: inherit;
163+
}
164+
157165
// Strong/bold styling - semi-bold weight with color
158166
strong,
159167
b {

src/quantecon_book_theme/assets/styles/_color-schemes.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ body.color-scheme-gruvbox {
2424
font-weight: 600;
2525
}
2626

27+
// Reset emphasis styling inside citation reference links (gruvbox)
28+
a.reference em {
29+
color: inherit;
30+
font-weight: inherit;
31+
}
32+
2733
strong,
2834
b {
2935
color: var(--qe-strong-color, colors.$gruvbox-definition);
@@ -44,6 +50,11 @@ body.color-scheme-gruvbox {
4450
color: var(--qe-emphasis-color, colors.$gruvbox-emphasis-dark);
4551
}
4652

53+
// Reset emphasis styling inside citation reference links (gruvbox dark)
54+
a.reference em {
55+
color: inherit;
56+
}
57+
4758
strong,
4859
b {
4960
color: var(--qe-strong-color, colors.$gruvbox-definition-dark);

src/quantecon_book_theme/assets/styles/_dark-theme.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ body.dark-theme {
153153
color: var(--qe-emphasis-color, colors.$emphasis-dark);
154154
}
155155

156+
// Reset emphasis styling inside citation reference links (dark mode)
157+
a.reference em {
158+
color: inherit;
159+
}
160+
156161
strong,
157162
b {
158163
color: var(--qe-strong-color, colors.$definition-dark);

0 commit comments

Comments
 (0)