You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while building Phase 3 (#89, landed in #171). The code-token palette the theme now ships is quantecon-book-theme's own (_code.scss), reproduced for parity. Measured against the white ground the theme's code blocks sit on (bg-stone-200/10 over white), five of its light-mode colours fall short of the WCAG 2.1 AA minimum of 4.5:1 for normal text. Code blocks render at text-sm, so the 3:1 large-text allowance does not apply. Every dark-mode value passes.
Token
Sphinx class
Colour
Contrast on white
AA
f-string substitution
.si
#70a0d0
2.75:1
✗
comment
.c.c1
#60a0b0
2.94:1
✗
number
.m.mi.mf
#40a070
3.24:1
✗
variable (non-Python)
.nv
#bb60d5
3.65:1
✗
class name
.nc
#0e84b5
4.21:1
✗
string
.s
#4070a0
5.19:1
✓
keyword, builtin
.k.nb
#007020
6.29:1
✓
decorator
.nd
#555555
7.46:1
✓
function name
.nf
#06287e
13.02:1
✓
Comments and numbers are the ones that matter in practice: every lecture code cell has both. The text colour scheme that landed alongside is fine (em 7.49:1, strong 5.73:1, inline literals 4.54:1).
This is a two-theme decision, not a fix for this repo alone. The values are the Sphinx builds' as deployed today, and #171 reproduced them deliberately so the migrated sites look like the current ones. Changing them here only would reintroduce a difference the parity work exists to remove; changing them means the same change in quantecon-book-theme's _code.scss, or accepting that the two stacks diverge on this point until the cutover.
If the decision is to fix, the nearest darker shade of each hue that reaches AA, keeping the palette's character:
Token
Today
Candidate
Contrast
comment
#60a0b0
#447c89
4.68:1
number
#40a070
#34835c
4.62:1
f-string substitution
#70a0d0
#3c7ab7
4.51:1
class name
#0e84b5
#0d7dac
4.62:1
variable
#bb60d5
#af44ce
4.62:1
Those are minimum-change candidates, not a design proposal; a designer may prefer a bigger move on the comment colour in particular, since 4.68:1 is barely over the line.
Options
Fix in both themes, same values, before the cutover. One PR here (styles/quantecon.css, CODE HIGHLIGHTING block, light values only) and one in quantecon-book-theme; refresh the visual baselines in both.
Fix here only and let the Sphinx sites keep the old values until they are retired. Simpler, but the parity tracker (Book-theme parity cutover — tracking #147) would need to record the known difference.
Accept as is. The colours have shipped on every lecture site for years without a reported complaint; record the decision and close.
Where it fits: not a cutover gate (#147 is about matching the current sites, which this does), so deliberately off the parity milestone. The decision should be taken before Phase 6 (#92) writes the parity docs, so the docs describe the settled palette.
Found while building Phase 3 (#89, landed in #171). The code-token palette the theme now ships is
quantecon-book-theme's own (_code.scss), reproduced for parity. Measured against the white ground the theme's code blocks sit on (bg-stone-200/10over white), five of its light-mode colours fall short of the WCAG 2.1 AA minimum of 4.5:1 for normal text. Code blocks render attext-sm, so the 3:1 large-text allowance does not apply. Every dark-mode value passes..si#70a0d0.c.c1#60a0b0.m.mi.mf#40a070.nv#bb60d5.nc#0e84b5.s#4070a0.k.nb#007020.nd#555555.nf#06287eComments and numbers are the ones that matter in practice: every lecture code cell has both. The text colour scheme that landed alongside is fine (
em7.49:1,strong5.73:1, inline literals 4.54:1).This is a two-theme decision, not a fix for this repo alone. The values are the Sphinx builds' as deployed today, and #171 reproduced them deliberately so the migrated sites look like the current ones. Changing them here only would reintroduce a difference the parity work exists to remove; changing them means the same change in
quantecon-book-theme's_code.scss, or accepting that the two stacks diverge on this point until the cutover.If the decision is to fix, the nearest darker shade of each hue that reaches AA, keeping the palette's character:
#60a0b0#447c89#40a070#34835c#70a0d0#3c7ab7#0e84b5#0d7dac#bb60d5#af44ceThose are minimum-change candidates, not a design proposal; a designer may prefer a bigger move on the comment colour in particular, since 4.68:1 is barely over the line.
Options
styles/quantecon.css, CODE HIGHLIGHTING block, light values only) and one inquantecon-book-theme; refresh the visual baselines in both.Where it fits: not a cutover gate (#147 is about matching the current sites, which this does), so deliberately off the parity milestone. The decision should be taken before Phase 6 (#92) writes the parity docs, so the docs describe the settled palette.