Skip to main content

max / balanced_breakfast

Move the geometry emitter onto makeover-build Density selection is settled, so the last app-local emitter goes with the other two. This app already selected touch by capability rather than by width, and that argument is now the shared rule; it gains (pointer: coarse) alongside (hover: none), so a coarse pointer that can hover reads as touch. No explicit-choice selector passed: unlike GoingsOn this app has no user override, and inventing one here would be a feature rather than a move. build.rs 54 -> 12 lines. Cargo.lock staged as a partial hunk so the unrelated synckit-client lines stay out.
Author: Max Johnson <me@maxj.phd> · 2026-07-28 22:03 UTC
Signed with PGP, not checked
Commit: c29d27489f5c03c3e313a49a4f9c64e9d78de659
Parent: 6e2ccdb
2 files changed, +10 insertions, -51 deletions
M Cargo.lock +1
@@ -3129,6 +3129,7 @@
3129 3129 version = "0.1.0"
3130 3130 dependencies = [
3131 3131 "makeover 2.3.0",
3132 + "makeover-geometry",
3132 3133 "makeover-webview",
3133 3134 ]
3134 3135
@@ -1,54 +1,12 @@
1 - use std::path::Path;
2 -
3 - /// Write the geometry layer `makeover-geometry` defines into
4 - /// `frontend/css/geometry.css`, which `index.html` links ahead of the
5 - /// stylesheet.
6 - ///
7 - /// Baked at build time rather than applied from `themes.js` the way the intent
8 - /// layer is, because geometry never changes at runtime: no theme may touch it,
9 - /// so there is nothing to re-apply and no second pass over `:root` to pay for
10 - /// on load.
11 - ///
12 - /// The touch preset hangs off `@media (hover: none)` rather than off the
13 - /// 768px breakpoint. Density is about who is operating the app, not how wide
14 - /// the window is: a narrow window on a desktop still has a pointer in it, and
15 - /// a tablet at full width still has a finger. BB happens to already have a
16 - /// `hover: none` block for exactly this reason, so the presets land where the
17 - /// existing touch overrides already live.
18 - ///
19 - /// The file is generated, and gitignored.
20 - fn materialize_geometry() {
21 - use makeover_geometry::{Density, gap_css_overrides, geometry_css_vars};
22 -
23 - let mut css = String::from(
24 - "/* Generated by build.rs from makeover-geometry. Do not edit.\n \
25 - Spacing is named by relationship, not by size. Every token here is\n \
26 - invariant by construction -- the crate exists because none of it may\n \
27 - vary by theme -- which is why they carry no per-line `invariant`\n \
28 - marker the way the :root tokens in styles.css do. */\n",
29 - );
30 - css.push_str(&geometry_css_vars(Density::Pointer));
31 - css.push_str("\n@media (hover: none) {\n");
32 - for line in gap_css_overrides(":root", Density::Touch).lines() {
33 - css.push_str(" ");
34 - css.push_str(line);
35 - css.push('\n');
36 - }
37 - css.push_str("}\n");
38 -
39 - let path = Path::new(env!("CARGO_MANIFEST_DIR"))
40 - .join("frontend")
41 - .join("css")
42 - .join("geometry.css");
43 - std::fs::write(path, css).expect("write geometry.css");
44 - }
45 -
46 1 fn main() {
47 - // themes/ and frontend/css/layout.css. Both were written out here until
48 - // they had a second identical copy in the other Tauri app; they live in
49 - // makeover-build now. The geometry emitter below stays local, because the
50 - // two apps genuinely disagree about how the touch preset is selected.
51 - makeover_build::tauri_frontend(env!("CARGO_MANIFEST_DIR"), &makeover_build::Emit::default());
52 - materialize_geometry();
2 + // All three generated files: themes/, geometry.css, layout.css. The
3 + // geometry emitter moved out too once density selection was settled:
4 + // touch is a capability, so it hangs off (hover: none), (pointer: coarse)
5 + // rather than a user-agent string or a breakpoint.
6 + makeover_build::tauri_frontend(
7 + env!("CARGO_MANIFEST_DIR"),
8 + &makeover_build::Emit::default(),
9 + None,
10 + );
53 11 tauri_build::build();
54 12 }