Repository navigation
notebooks: theme marimo toys and labs/app.py with the course tokens - #17
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Learner-facing effect: the marimo toys and
labs/app.pyuse 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
sessions/theme.css--ahp-*), light andbody.dark.pyproject.toml[tool.marimo.display] custom_css = ["sessions/theme.css"]CHANGELOG.mdNo
toy.pychanges, and nocss_file=onmarimo.App(...), whichtest_notebooks.pypins.Checked against pinned marimo 0.24.2
ProjectConfigManager._resolve_custom_cssresolves the path against thepyproject.tomldirectory, so it works fromsessions/*/toy.pyandlabs/. Project config keepsdisplay.custom_css; only PEP 723 script metadata strips it.marimo edit sessions/s05-consent-gate/toy.pyandmarimo edit labs/app.py, the served page inlines the theme. In the live DOM,.markdownand.prosematch, headings get the serif stack, andbody.darkswitches the tokens (--ahp-bg#161411, code background#2a2621). The diagram plate is#1f2020in both themes.span.markdown.prosewithdisplay: contents, somax-width: 44remon it never applied, and text ran about 1020px wide. The measure now sits on its text children, including marimo'sspan.paragraph(634px at marimo's 14.4px root). Tables, code and figures keep full width.Evidence
Definition of Done on this branch:
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.pycheck 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 -vuv run python tools/build.pyproduces no generated HTML driftuv run python tools/check_links.pyuv run python tools/check_sota_urls.pymarimo check --strictand canonical form cleanuv run python labs/run.py --all --replaypass