Skip to main content

max / goingson

Move the geometry emitter onto makeover-build Density selection is settled, so the last app-local emitter goes with the other two. Touch now hangs off (hover: none), (pointer: coarse) instead of only the ui-mode-mobile class, which means a genuine touch device gets touch spacing even in the desktop layout. It did not before: this app selected density by user-agent sniff behind a mode class, which asks what device this is as a proxy for a capability the platform reports. .ui-mode-mobile still applies touch spacing, passed as the explicit-choice selector and emitted last, so forcing mobile mode behaves exactly as it did. The class keeps its layout job; it just no longer carries density on its own. build.rs 45 -> 12 lines.
Author: Max Johnson <me@maxj.phd> · 2026-07-28 22:01 UTC
Signed with PGP, not checked
Commit: 99eda9a51c182c940979ed832808899d750b7f9b
Parent: 108d9b7
2 files changed, +10 insertions, -42 deletions
M Cargo.lock +1
@@ -3388,6 +3388,7 @@
3388 3388 version = "0.1.0"
3389 3389 dependencies = [
3390 3390 "makeover 2.3.0",
3391 + "makeover-geometry",
3391 3392 "makeover-webview",
3392 3393 ]
3393 3394
@@ -1,45 +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 JS the way themes are, because
8 - /// geometry never changes at runtime: there is no geometry picker, so nothing
9 - /// to re-apply and no reason to pay for a second pass over `:root` on load.
10 - ///
11 - /// The desktop preset goes in `:root`; the touch preset overrides only the
12 - /// relational layer, scoped to the `ui-mode-mobile` class `bootstrap-uimode.js`
13 - /// puts on `<html>` before the stylesheet evaluates. Both selectors match the
14 - /// root element with the same specificity, so the override has to come second,
15 - /// which is the order these are written in.
16 - ///
17 - /// The file is generated, and gitignored.
18 - fn materialize_geometry() {
19 - use makeover_geometry::{Density, gap_css_overrides, geometry_css_vars};
20 -
21 - let mut css = String::from(
22 - "/* Generated by build.rs from makeover-geometry. Do not edit.\n \
23 - Spacing is named by relationship, not by size: see the crate's README\n \
24 - and wiki note makeover-geometry. */\n",
25 - );
26 - css.push_str(&geometry_css_vars(Density::Pointer));
27 - css.push('\n');
28 - css.push_str(&gap_css_overrides(".ui-mode-mobile", Density::Touch));
29 -
30 - let path = Path::new(env!("CARGO_MANIFEST_DIR"))
31 - .join("frontend")
32 - .join("css")
33 - .join("geometry.css");
34 - std::fs::write(path, css).expect("write geometry.css");
35 - }
36 -
37 1 fn main() {
38 - // themes/ and frontend/css/layout.css. Both were written out here until
39 - // they had a second identical copy in the other Tauri app; they live in
40 - // makeover-build now. The geometry emitter below stays local, because the
41 - // two apps genuinely disagree about how the touch preset is selected.
42 - makeover_build::tauri_frontend(env!("CARGO_MANIFEST_DIR"), &makeover_build::Emit::default());
43 - 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 + Some(".ui-mode-mobile"),
10 + );
44 11 tauri_build::build();
45 12 }