Skip to main content

Crate makeover_build

Crate makeover_build 

Source
Expand description

Build-script support for the make-family design system.

Every consumer materialises the same generated files from a build.rs, and until now every consumer wrote that code itself. GoingsOn and Balanced Breakfast grew byte-identical copies of the theme materialiser during the makeover-geometry adoption, and the layout stylesheet would have been the third and fourth copies. This is that code, once.

§The geometry emitter, and why it took a decision to land

geometry_css was deliberately absent at first. GoingsOn and Balanced Breakfast did not agree on it: GO scoped the touch preset to a ui-mode-mobile class set by a bootstrap script, BB hung it off @media (hover: none), and audiofiles had no switch at all. Extracting it then would have meant picking one of those policies by accident, inside a shared crate, without anyone deciding.

Density selection was settled instead – touch is a capability, so it hangs off (hover: none), (pointer: coarse) and never off a user-agent string or a breakpoint – and the emitter followed. Recording an agreement rather than manufacturing one is the whole point, and it is why the order was that way round.

§Why these files are generated rather than checked in

Tauri’s resource globs are read by its CLI against the crate directory, so they cannot point into a registry checkout or OUT_DIR. Materialising into the crate keeps the source crate authoritative without vendoring a second copy that drifts. Every path written here is expected to be gitignored.

§The other half: what is checked rather than written

A consumer’s frontend is not all generated. The stylesheet and the scripts are hand-written and state some of the same facts the generated files ask the crates for, so they can drift where a generated file cannot. drift holds the checks that keep them honest, and they are assertions rather than substitutions on purpose: a file that has to be generated to be correct stops being readable on its own.

Re-exports§

pub use drift::check_breakpoints;
pub use drift::check_touch_density;

Modules§

drift
Checks that a hand-written frontend still agrees with the crate that generates its siblings.

Structs§

Emit
Re-exported so a consumer’s build.rs needs one dependency rather than three. Nothing here wraps it; the emitter’s options are the emitter’s. How the emitted CSS is shaped.

Functions§

geometry_css
Write makeover-geometry’s spacing layer, with its canonical density selection, to path.
layout_css
Write makeover-webview’s component stylesheet to path.
tauri_frontend
All three generated files at the layout every Tauri consumer already uses: themes/ beside the manifest, and frontend/css/{geometry,layout}.css under it.
themes
Write the themes makeover ships into dir, as <id>.toml.