Skip to content

notebooks: theme marimo toys and labs/app.py with the course tokens - #17

Merged
macayaven merged 2 commits into
mainfrom
design/course-ui-marimo-theme
Sep 25, 2026
Merged

macayaven merged 2 commits into
mainfrom
design/course-ui-marimo-theme

Conversation

@macayaven

Copy link
Copy Markdown
Owner

Summary

Learner-facing effect: the marimo toys and labs/app.py use the same type, colors and code styling as the lessons, in light and dark, with a readable line length.

Concern: (d) marimo theme. Stacked on #16; once #16 merges, this PR will be retargeted to main.

Author: Carlos Crespo Macaya. Design from the Claude Design course UI handoff.

What changed

File Change
sessions/theme.css Shared marimo theme with the lesson tokens (--ahp-*), light and body.dark.
pyproject.toml [tool.marimo.display] custom_css = ["sessions/theme.css"]
CHANGELOG.md Unreleased entry.

No toy.py changes, and no css_file= on marimo.App(...), which test_notebooks.py pins.

Checked against pinned marimo 0.24.2

  • ProjectConfigManager._resolve_custom_css resolves the path against the pyproject.toml directory, so it works from sessions/*/toy.py and labs/. Project config keeps display.custom_css; only PEP 723 script metadata strips it.
  • With marimo edit sessions/s05-consent-gate/toy.py and marimo edit labs/app.py, the served page inlines the theme. In the live DOM, .markdown and .prose match, headings get the serif stack, and body.dark switches the tokens (--ahp-bg #161411, code background #2a2621). The diagram plate is #1f2020 in both themes.
  • Selector fix on top of the delivered file. marimo renders markdown in span.markdown.prose with display: contents, so max-width: 44rem on it never applied, and text ran about 1020px wide. The measure now sits on its text children, including marimo's span.paragraph (634px at marimo's 14.4px root). Tables, code and figures keep full width.

Evidence

Definition of Done on this branch:

$ uv sync --frozen
$ uv run python tools/build.py && git diff --exit-code -- '*.html'
sessions/study-plan.md -> sessions/study-plan.html (1 mermaid block(s))
(no HTML drift)
$ uv run python -m unittest discover -s tests -v
Ran 154 tests in 1.179s
OK
$ uv run python tools/check_links.py
check_links.py: 16 pages, 406 relative refs ok
$ uv run python tools/check_sota_urls.py
check_sota_urls.py: 99 tagged rows, all have a URL
$ uv run python -m unittest labs/test_contracts.py
Ran 29 tests in 0.010s
OK
$ uv run python labs/run.py --all --replay
naïve 2/9 vs engine 9/9
exit=0
# verify.yml extras
12 notebooks executed offline
marimo check --strict ok
marimo canonical form: no drift

Screenshots. Before/after sheets for the S05 toy, at 375 and 1280, light and dark, were reviewed locally. They are not embedded here because there was no approved image host. The labs/app.py check was done in the browser; its screenshot is omitted because marimo prints the local file path.

Checklist

  • uv run python -m unittest discover -s tests -v
  • uv run python tools/build.py produces no generated HTML drift
  • uv run python tools/check_links.py
  • uv run python tools/check_sota_urls.py
  • Notebooks: sources untouched; all 12 execute offline; marimo check --strict and canonical form clean
  • Lab contract tests and uv run python labs/run.py --all --replay pass
  • Public text contains no learner data, credentials, raw logs or private machine paths

Add sessions/theme.css and load it once through
[tool.marimo.display] custom_css in pyproject.toml, so no toy.py or
marimo.App(...) line changes. Checked against the pinned marimo 0.24.2:
the served page inlines the file for sessions/*/toy.py and labs/app.py,
and dark mode keys off body.dark.

Selector fix on top of the delivered file: marimo renders markdown in
span.markdown.prose with display: contents, so max-width on it never
applied. The 44rem measure now sits on its text children, including
marimo's span.paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from design/course-ui to main September 25, 2026 10:06
@macayaven
macayaven merged commit fbf40bd into main Sep 25, 2026
2 checks passed
@macayaven
macayaven deleted the design/course-ui-marimo-theme branch September 25, 2026 10:07
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.

1 participant