feat: export themes preset bundles for coherent visual styles#125
feat: export themes preset bundles for coherent visual styles#125smur89 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughA ChangesTheme Presets Bundle
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Adds a module-scope `themes` dict — `classic`, `modern`, `minimal` —
of vetted preset bundles. Each theme bundles `accent`, `font`,
`columnRatio`, and `headerTextAlign` — the four knobs that interact
visually. Callers spread a theme over their own overrides:
#import "@preview/altacv:1.1.0": alta, themes
#alta(cv, preferences: themes.modern + (imageSize: 7em))
Closes #58.
Design:
- `classic` re-declares current defaults — themes are by-name bundles,
not pointers to "whatever the default is right now". A future
defaults change will not silently shift `classic`.
- `imagePosition` deliberately omitted: it is only meaningful when
`basics.image` is set, so baking it into every bundle would either
force image-only assumptions or no-op for image-less CVs.
- Themes use `palettes.*` for accents (not raw hex), so any future
palette adjustment ripples through.
- `modern` (`Inter`) and `minimal` (`Source Sans 3`) fonts are
aspirational — neither is on CI. The fixture overrides `font: "Lato"`
for those themes so `make test` is silent; users with the named font
installed get the intended typography, others get Typst's standard
font-fallback warning. README flags this.
- `themes.classic.columnRatio: 0.64 → 0.65` so the 'canonical alta look'
matches `_default_preferences.columnRatio: 0.65`. Update the README
table cell accordingly (64/36 → 65/35).
- Trim the 27-line preamble above `themes` in `internal/presets.typ`
to match the brevity of sibling presets (`palettes`, `maps-providers`);
the spread-and-override usage now lives only in the README to remove
the source-vs-docs drift surface.
- Replace the three hand-written `#alta(...)` calls in `tests/themes.typ`
with a `for key in themes.keys()` loop mirroring `tests/palettes.typ`,
so adding a future theme auto-extends the fixture instead of needing
a parallel edit.
- Add `assert.eq` pins on `themes.{classic,modern,minimal}.font` at the
top of the fixture so a typo in the declared theme font is caught
there (the CI-host font fallback would otherwise mask it via an
identical-looking snapshot).
74e677a to
ea77820
Compare
Summary
Adds a module-scope
themesdict (classic,modern,minimal) of vetted preset bundles — each themes the four knobs that interact visually (accent,font,columnRatio,headerTextAlign). Callers spread a theme over their own overrides:Closes #58. Supersedes #70 (PR predates the
lib.typ→internal//sections/split + theinternal/labels-en.tomlextraction).Design notes
classicre-declares current defaults (includingcolumnRatio: 0.65, matching_default_preferences) — themes are by-name bundles, not pointers to "whatever the default is right now". Defaults can shift without silently shiftingclassic.imagePositionis intentionally not bundled: it only makes sense whenbasics.imageis set; baking it would either force image-only assumptions or no-op for image-less CVs.palettes.*for accents, so any future palette tweak ripples through.modern(Inter) andminimal(Source Sans 3) fonts are aspirational. Neither is on CI. The fixture overridesfont: "Lato"for those themes somake teststays silent; users with the named font installed get the intended typography, others get Typst's standard font-fallback warning.Test plan
make test—tests/themes.typand all pre-existing fixtures green.tests/themes.typiteratesthemes.keys()so a future theme auto-extends the fixture;assert.eqpins each theme's declaredfontso a typo ("Intr") is caught even though the CI-host fallback would mask it visually.examples/tests/themes.pdf.Summary by CodeRabbit
New Features
Documentation