Skip to content

feat(styles): 16px code and callouts, solid resting underline, AA footer contrast - #238

Open
quantecon-services wants to merge 3 commits into
mainfrom
claude/brave-archimedes-k3bmsi
Open

feat(styles): 16px code and callouts, solid resting underline, AA footer contrast#238
quantecon-services wants to merge 3 commits into
mainfrom
claude/brave-archimedes-k3bmsi

Conversation

@quantecon-services

@quantecon-services quantecon-services commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

The combined CSS PR from the v2.5.0 design review (#187): the four items whose decisions are in, on one branch so the snapshot set is refreshed once. Nothing here waits on design input; what does is listed at the end.

What changes

Tests

Four computed-style assertions, so each change is guarded by a number rather than by pixels:

  • code-block-size: 16px / 20px on a plain fence, an executable cell and its stored output.
  • callout-size: 18px prose; 16px on admonition, exercise and proof bodies and headers, and on the note nested in the exercise (new fixture content in features.md).
  • link-underline-solid: underline / solid in QuantEcon blue on a .hover-link cross-reference and a .link.
  • footer-contrast: composites the computed colours at the computed opacity on the nearest painted ancestor and asserts at least 4.5:1 for text and link, light and dark.

npm run compile, npm run test:unit (59 pass) and the CI comment-rule grep pass locally, and all four new tests pass on CI. On the first commit the visual job failed its snapshot comparisons, as a change that moves every page should: 12 of them (intro, features, lists, notebook, history-open and rtl on both viewports; sidebar-open stayed within budget). An earlier version of this paragraph said the snapshots passed under the 1% budget; that was a misreading of the local run's summary and is withdrawn.

Baselines

Every snapshot name moves: features, history-open and notebook (code size); features, history-open and lists (callouts); intro, features, history-open, sidebar-open and rtl (links); and all of them for the footer.

  • -linux: refreshed by the /update-snapshots workflow in 8c557bd (13 files, both viewports). CI is green on that set and on the current head.
  • -darwin: needs THEME_TEMPLATE="$PWD/.deploy/quantecon-theme" npx playwright test --update-snapshots=all on a Mac.

Docs

New docs/typography.md (content size, code blocks, callouts, links), a row in docs/index.md, a footer paragraph in docs/layout.md, a pointer from docs/code-highlighting.md, and two entries in CONTRIBUTING's list of deliberate divergences from the lecture builds. CHANGELOG under Unreleased.

Not in this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01K8u2d3ZQEcz8D6P7Zuyugn

…ter contrast

Code blocks render their source at 16px / 20px instead of the 13px / 17px
JupyterLab default that thebe-core.css applied to every <pre>. The value is
set on the JupyterLab variables, scoped to .article, so the source block,
Jupyter's live-compute output and thebe's derived spacing follow it together;
stored outputs take their own 16px / 20px rule. The frame is unchanged.

Admonition, exercise, proof and dropdown bodies step down to 16px,
root-relative so nested callouts do not compound, and their titles take the
container's size.

Content links keep a resting underline and it is now solid on both .link and
.hover-link, removing the thumbnail-driven dotted/solid split. The link colour
is 2.02:1 (light) and 1.49:1 (dark) against the body text, so colour alone
cannot mark a link and the underline cannot be hover-only.

The footer's text and links clear WCAG AA once its 70% opacity is composited:
#3b3b3b and #00436f in light mode, #b5b5b5 for dark text. The colour
utilities come off the element so the stylesheet is the only source.

Computed-style tests cover each change; a nested callout is added to the
fixture. Docs gain a typography page, and CONTRIBUTING records the two new
deliberate divergences from the lecture builds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K8u2d3ZQEcz8D6P7Zuyugn

Copy link
Copy Markdown
Collaborator Author

/update-snapshots

Re-captures every -linux baseline for this PR's CSS. The changes sit under the 1% diff budget, so the visual job passes against the old pictures; the refresh is so the baselines show what now renders.


Generated by Claude Code

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://QuantEcon.github.io/quantecon-theme.mystmd/pr-preview/pr-238/

Built to branch gh-pages at 2026-09-12 09:44 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@mmcky

mmcky commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

@DrDrij was just updating the project issues and it was suggested to throw this together. You can take or leave it as you see fit.

@mmcky
mmcky requested a balanced review from Copilot September 12, 2026 09:35
@github-actions

Copy link
Copy Markdown
Contributor

🎭 Refreshed visual baselines in 8c557bd:

  • tests/visual/snapshots/desktop-chrome-linux/features.png
  • tests/visual/snapshots/desktop-chrome-linux/history-open.png
  • tests/visual/snapshots/desktop-chrome-linux/intro.png
  • tests/visual/snapshots/desktop-chrome-linux/lists.png
  • tests/visual/snapshots/desktop-chrome-linux/notebook.png
  • tests/visual/snapshots/desktop-chrome-linux/rtl.png
  • tests/visual/snapshots/desktop-chrome-linux/sidebar-open.png
  • tests/visual/snapshots/mobile-chrome-linux/features.png
  • tests/visual/snapshots/mobile-chrome-linux/history-open.png
  • tests/visual/snapshots/mobile-chrome-linux/intro.png
  • tests/visual/snapshots/mobile-chrome-linux/lists.png
  • tests/visual/snapshots/mobile-chrome-linux/notebook.png
  • tests/visual/snapshots/mobile-chrome-linux/rtl.png

@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

🎭 Visual regression results

passed  52 passed
skipped  19 skipped

Details

stats  71 tests across 2 suites
duration  1 minute, 49 seconds
commit  04f8896

Skipped tests

mobile-chrome › theme.spec.ts › QuantEcon theme — visual regression › without JavaScript › drawer-opens-without-javascript
mobile-chrome › theme.spec.ts › QuantEcon theme — visual regression › drawer-closes-when-search-opens
mobile-chrome › theme.spec.ts › QuantEcon theme — visual regression › launch-colab
mobile-chrome › theme.spec.ts › QuantEcon theme — visual regression › live-compute-toggle
mobile-chrome › theme.spec.ts › QuantEcon theme — visual regression › live-compute-toggle-absent-without-thebe
mobile-chrome › theme.spec.ts › On this page outline › outline-pinned-and-nested
mobile-chrome › theme.spec.ts › On this page outline › outline-tracks-scroll
mobile-chrome › theme.spec.ts › On this page outline › outline-unnumbered
mobile-chrome › theme.spec.ts › On this page outline › outline-within-viewport
mobile-chrome › theme.spec.ts › Meta/SEO and notebook output › social-meta
mobile-chrome › theme.spec.ts › Meta/SEO and notebook output › no-canonical-without-site-url
mobile-chrome › theme.spec.ts › Meta/SEO and notebook output › stderr-collapsed
mobile-chrome › theme.spec.ts › Site options reach the theme › site-options
mobile-chrome › theme.spec.ts › Site footer › default-footer-without-part
mobile-chrome › theme.spec.ts › Site footer › declared-part-replaces-default
mobile-chrome › theme.spec.ts › Site footer › footer-contrast
mobile-chrome › theme.spec.ts › Content typography › code-block-size
mobile-chrome › theme.spec.ts › Content typography › callout-size
mobile-chrome › theme.spec.ts › Content typography › link-underline-solid

Copy link
Copy Markdown
Collaborator Author

A correction and one ask.

Correction. My /update-snapshots comment said the visual job would pass against the old baselines because the changes sit under the 1% budget. It did not, and it should not have: the run on ff0d71a failed 12 snapshot comparisons (intro, features, lists, notebook, history-open and rtl, on both viewports; sidebar-open passed), which is the intended outcome of a CSS change that moves every page: a full-page screenshot grows when each code line gains 3px, and the fixture gained an exercise. My local run had the same failures and I misread its summary. The PR body's Tests paragraph is corrected. The four computed-style tests passed on CI.

Ask. The refreshed baselines are in 8c557bd, pushed by the workflow. GitHub created the CI and preview runs for that commit in the "action required" state (the triggering actor is github-actions[bot]), so a maintainer needs to approve them from the Actions tab for the head to show green: CI run 34686249760 and preview run 34686249780. Nothing else is pending on the branch. The darwin baselines still need the local --update-snapshots=all pass.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The changes are visual/accessibility CSS adjustments whose correctness depends on rendered contrast math, cascade/layer interactions, and a manual multi-platform snapshot-baseline refresh that cannot be fully verified without a human render.

Pull request overview

This PR implements four accepted decisions from the v2.5.0 design review (#187), grouped onto one branch so the overlapping visual-snapshot set is refreshed once. It resizes code blocks and callout bodies against the 18px prose, unifies content-link underlines to a solid resting line, and darkens the site footer's text/link colours so their composited (opacity-faded) contrast clears WCAG AA in both modes. All changes live in styles/quantecon.css (plus a one-line component cleanup in SiteFooter.tsx), with matching docs, CHANGELOG, and computed-style tests.

Changes:

  • Code source blocks and stored outputs render at 16px/20px (via the --jp-code-* JupyterLab variables scoped to .article, plus a direct rule for .myst-jp-safe-output-text); callout bodies/titles step down to 16px, root-relative so nested callouts don't compound.
  • .link and .hover-link get a solid text-decoration-line/-style at rest, removing the thumbnail-driven dotted/solid split.
  • Footer colours moved off SiteFooter's utilities into CSS: light text #3b3b3b, light link #00436f, dark text #b5b5b5, so the composited-at-70%-opacity contrast meets AA.
File summaries
File Description
styles/quantecon.css Core change: adds CODE BLOCKS/CALLOUTS blocks, solid resting underline, footer colour/dark-mode rules with contrast rationale.
app/components/SiteFooter.tsx Removes footer colour/opacity utilities so the stylesheet is the sole colour source in both modes.
tests/visual/theme.spec.ts Adds four computed-style tests (footer-contrast, code-block-size, callout-size, link-underline-solid).
tests/visual/fixture/features.md Adds an exercise containing a nested note to exercise the no-compounding size rule.
docs/typography.md New page documenting content size, code blocks, callouts, and links.
docs/layout.md Adds a footer paragraph on size/opacity and the AA-driven colour divergence.
docs/index.md Adds the typography row to the docs table.
docs/code-highlighting.md Adds a pointer to the new typography page for size/frame.
CONTRIBUTING.md Records two new deliberate WCAG divergences; drops the now-resolved #201 pointer.
CHANGELOG.md Adds Changed/Fixed entries under ## [Unreleased].
Review details
  • Files reviewed: 10/23 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CONTRIBUTING.md Outdated
Dropping the resolved footer pointer from the parenthetical joined the next
sentence onto the same line; wrap it back to the width the rest of the
section uses.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K8u2d3ZQEcz8D6P7Zuyugn

Copy link
Copy Markdown
Collaborator Author

Status, closing the round above.

  • CI is green on the refreshed baselines. The held run on 8c557bd went through once re-run from this account (CI run 379, attempt 2): build and typecheck, unit tests, the visual gate against the new -linux set, and the FOUC guard all pass. The approval ask in my previous comment is moot.
  • Copilot's one finding is fixed in 04f8896: the CONTRIBUTING paragraph is rewrapped to the file's width. Docs only, so no baseline moves; CI run 380 on that head is in progress.
  • Still open: the -darwin baselines, refreshed locally on a Mac with --update-snapshots=all.

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants