From 1851f6984fbcfc7c72009fad452c3842f036037c Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 20 Nov 2026 17:33:27 +0000 Subject: [PATCH 1/5] Component constants: one-component values live in the component's file A dimension that belongs to one component's own drawing is a documented constant in that component's file; layout sizes stay semantic tokens, and no size-preset token exists for one component (craft-framework.md 5.4). - Spec: 5.4 rule 3 reworded; Appendix A, 4.6 (the component-token rung goes, no such tokens exist), 8.3, porting.md and the theme README agree. - design-lint: literal-size/* treats a module- or impl-level const with a doc comment as a named value: a name that resolves to it is not flagged, and its initializer is its definition. Fn-local and undocumented consts and call-site literals stay flagged. Nine markers that only covered such consts are removed. - Ruler ticks: size.ruler.tick.* leaves the size presets; kit.rs draws TICK_MID = 6 and TICK_MINOR = 3 points in every density, as the old library and the apps' rulers do. Comfortable ticks go back to 6 / 3 (from 9 / 4.5); Compact is unchanged. - size.scroll_fade becomes FADE_LENGTH in scroll_bar.rs, size.notice.width CARD_WIDTH in notice.rs, and size.story.* multiples of size.control.md in testing/stage.rs (15, 10 and 30 control heights: today's values in both densities). pointer_tip, checker, thumb.sample.*, the card gaps and icon.glyph_md stay tokens: each has more than one user. --- crates/design-lint/README.md | 2 +- crates/design-lint/src/rules.rs | 86 ++++++++++++++++--- crates/design-lint/tests/rules.rs | 14 +++ crates/draw/src/ui/pen/anchor_tool.rs | 1 - crates/pages/src/ui/page_rulers/stories.rs | 1 - crates/print/src/ui/dialog.rs | 2 - crates/theme/README.md | 6 +- crates/theme/sizes/comfortable.json | 15 ---- crates/theme/sizes/compact.json | 15 ---- crates/theme/src/dump.rs | 21 +---- crates/theme/src/lib.rs | 6 +- crates/theme/src/sizes.rs | 7 -- crates/theme/src/tokens/size.rs | 42 --------- .../tokens/adwaita-dark-high-comfortable.txt | 7 -- .../tokens/adwaita-dark-high-compact.txt | 7 -- .../adwaita-dark-standard-comfortable.txt | 7 -- .../tokens/adwaita-dark-standard-compact.txt | 7 -- .../tokens/adwaita-light-high-comfortable.txt | 7 -- .../tokens/adwaita-light-high-compact.txt | 7 -- .../adwaita-light-standard-comfortable.txt | 7 -- .../tokens/adwaita-light-standard-compact.txt | 7 -- .../tokens/artcraft-dark-high-comfortable.txt | 7 -- .../tokens/artcraft-dark-high-compact.txt | 7 -- .../artcraft-dark-standard-comfortable.txt | 7 -- .../tokens/artcraft-dark-standard-compact.txt | 7 -- .../artcraft-light-high-comfortable.txt | 7 -- .../tokens/artcraft-light-high-compact.txt | 7 -- .../artcraft-light-standard-comfortable.txt | 7 -- .../artcraft-light-standard-compact.txt | 7 -- .../tokens/breeze-dark-high-comfortable.txt | 7 -- .../dumps/tokens/breeze-dark-high-compact.txt | 7 -- .../breeze-dark-standard-comfortable.txt | 7 -- .../tokens/breeze-dark-standard-compact.txt | 7 -- .../tokens/breeze-light-high-comfortable.txt | 7 -- .../tokens/breeze-light-high-compact.txt | 7 -- .../breeze-light-standard-comfortable.txt | 7 -- .../tokens/breeze-light-standard-compact.txt | 7 -- .../tokens/classic-light-high-comfortable.txt | 7 -- .../tokens/classic-light-high-compact.txt | 7 -- .../classic-light-standard-comfortable.txt | 7 -- .../tokens/classic-light-standard-compact.txt | 7 -- .../tokens/graphite-dark-high-comfortable.txt | 7 -- .../tokens/graphite-dark-high-compact.txt | 7 -- .../graphite-dark-standard-comfortable.txt | 7 -- .../tokens/graphite-dark-standard-compact.txt | 7 -- .../graphite-light-high-comfortable.txt | 7 -- .../tokens/graphite-light-high-compact.txt | 7 -- .../graphite-light-standard-comfortable.txt | 7 -- .../graphite-light-standard-compact.txt | 7 -- .../tokens/pro-dark-high-comfortable.txt | 7 -- .../dumps/tokens/pro-dark-high-compact.txt | 7 -- ...ro-dark-standard-comfortable-app-sizes.txt | 7 -- .../tokens/pro-dark-standard-comfortable.txt | 7 -- .../tokens/pro-dark-standard-compact.txt | 7 -- .../pro-light-gray-light-high-comfortable.txt | 7 -- .../pro-light-gray-light-high-compact.txt | 7 -- ...-light-gray-light-standard-comfortable.txt | 7 -- .../pro-light-gray-light-standard-compact.txt | 7 -- .../tokens/pro-light-high-comfortable.txt | 7 -- .../dumps/tokens/pro-light-high-compact.txt | 7 -- .../tokens/pro-light-standard-comfortable.txt | 7 -- .../tokens/pro-light-standard-compact.txt | 7 -- .../tokens/soft-dark-high-comfortable.txt | 7 -- .../dumps/tokens/soft-dark-high-compact.txt | 7 -- .../tokens/soft-dark-standard-comfortable.txt | 7 -- .../tokens/soft-dark-standard-compact.txt | 7 -- .../tokens/soft-light-high-comfortable.txt | 7 -- .../dumps/tokens/soft-light-high-compact.txt | 7 -- .../soft-light-standard-comfortable.txt | 7 -- .../tokens/soft-light-standard-compact.txt | 7 -- .../solarized-dark-dark-high-comfortable.txt | 7 -- .../solarized-dark-dark-high-compact.txt | 7 -- ...larized-dark-dark-standard-comfortable.txt | 7 -- .../solarized-dark-dark-standard-compact.txt | 7 -- .../tokens/studio-dark-high-comfortable.txt | 7 -- .../dumps/tokens/studio-dark-high-compact.txt | 7 -- .../studio-dark-standard-comfortable.txt | 7 -- .../tokens/studio-dark-standard-compact.txt | 7 -- .../tokens/studio-light-high-comfortable.txt | 7 -- .../tokens/studio-light-high-compact.txt | 7 -- .../studio-light-standard-comfortable.txt | 7 -- .../tokens/studio-light-standard-compact.txt | 7 -- crates/ui-canvas/src/canvas/tools.rs | 4 +- .../ui-contract/src/contract/body/scroll.rs | 2 +- .../ui-contract/src/contract/items/hooks.rs | 2 +- crates/ui-contract/src/primitives/kit.rs | 21 +++-- .../ui-contract/src/primitives/pointer_art.rs | 1 - .../ui-contract/src/primitives/scroll_bar.rs | 11 ++- crates/ui-contract/src/style/paint.rs | 3 - crates/ui-contract/src/testing/mod.rs | 2 +- crates/ui-contract/src/testing/stage.rs | 30 +++++-- crates/ui-gallery/src/chrome/card.rs | 4 +- crates/ui-gallery/src/chrome/overview.rs | 4 +- .../src/patterns/preferences/window.rs | 4 +- crates/ui-widgets/src/notices/notice.rs | 8 +- docs/craft-framework.md | 20 ++--- docs/porting.md | 6 +- migration/api-map/canvas-core.toml | 2 +- 98 files changed, 169 insertions(+), 656 deletions(-) diff --git a/crates/design-lint/README.md b/crates/design-lint/README.md index 817b02e7a..7751a0f6c 100644 --- a/crates/design-lint/README.md +++ b/crates/design-lint/README.md @@ -81,7 +81,7 @@ Egui paths are resolved through the file's `use` items (one table per file, grou Names are resolved through the file's `use` items, per module scope: grouped imports, renames (`use egui::Margin as M`), module aliases (`use crate::theme as t`) and glob imports (`use crate::theme::*`) all reach the rule table, so `margin(4.0)` is flagged after `use crate::theme::margin`. A bare name that a fn in the same module defines is not extended through globs. Imports in a module do not apply in sibling modules. -A literal is a number, optionally negated, parenthesised, cast or in arithmetic; zero is never flagged. A name is flagged when a `const` or `static` in the same file with that name has such a value. Consts are keyed by module and impl scope: a bare name takes the innermost scope that defines it, `Self::X`, `self::X`, `super::X`, `crate::X`, `Type::X` and `module::X` (last two segments) the scope they name, and a name with several candidates is flagged when any is non-zero. +A literal is a number, optionally negated, parenthesised, cast or in arithmetic; zero is never flagged. A name is flagged when a `const` or `static` in the same file with that name has such a value, unless it is a component constant: a module- or impl-level `const` with a doc comment, the named place for a dimension of one component's own drawing (craft-framework.md 5.4). A name that resolves to a component constant is not a literal size, and its initializer is its definition, so the literals in it are not flagged either. A `const` inside a fn body, a `static` and an undocumented `const` are flagged as literals. Consts are keyed by module and impl scope: a bare name takes the innermost scope that defines it, `Self::X`, `self::X`, `super::X`, `crate::X`, `Type::X` and `module::X` (last two segments) the scope they name, and a name with several candidates is flagged when any is non-zero. ## Markers diff --git a/crates/design-lint/src/rules.rs b/crates/design-lint/src/rules.rs index 58720f847..d3dec56b4 100644 --- a/crates/design-lint/src/rules.rs +++ b/crates/design-lint/src/rules.rs @@ -150,6 +150,7 @@ pub(crate) fn analyze_file(src: &str, file: &syn::File, include_tests: bool) -> imports: Vec::new(), fns: Vec::new(), scope: Vec::new(), + in_named_const: false, out: Analysis::default(), include_tests, }; @@ -184,6 +185,9 @@ struct ConstDef { line: usize, expr: Expr, value: Option, + /// A component constant: a module- or impl-level `const` with a doc comment. A name that resolves to it is not a + /// literal size, and its initializer is its definition, not a call site. + named: bool, } /// A `use` declaration: `alias` is the name it brings in, `None` for a glob (`path::*`). @@ -202,6 +206,8 @@ struct Linter<'a> { fns: Vec<(Vec, String)>, /// The modules and impl blocks around the item being visited. scope: Vec, + /// Inside the initializer of a named const, where `literal-size/*` does not apply. + in_named_const: bool, out: Analysis, include_tests: bool, } @@ -212,17 +218,21 @@ struct ConstCollector { imports: Vec, fns: Vec<(Vec, String)>, scope: Vec, + /// How many fn bodies enclose the item being visited. + fn_depth: usize, include_tests: bool, } impl ConstCollector { - fn add(&mut self, name: &syn::Ident, expr: &Expr) { + /// Records a const or static; `documented` is whether it is a `const` with a doc comment. + fn add(&mut self, name: &syn::Ident, expr: &Expr, documented: bool) { self.defs.push(ConstDef { scope: self.scope.clone(), name: name.to_string(), line: name.span().start().line, expr: expr.clone(), value: None, + named: documented && self.fn_depth == 0, }); } @@ -256,9 +266,21 @@ impl<'ast> Visit<'ast> for ConstCollector { fn visit_item_fn(&mut self, i: &'ast syn::ItemFn) { if !self.skipped(&i.attrs) { self.fns.push((module_scope(&self.scope).to_vec(), i.sig.ident.to_string())); + self.fn_depth += 1; visit::visit_item_fn(self, i); + self.fn_depth -= 1; } } + fn visit_impl_item_fn(&mut self, i: &'ast syn::ImplItemFn) { + self.fn_depth += 1; + visit::visit_impl_item_fn(self, i); + self.fn_depth -= 1; + } + fn visit_trait_item_fn(&mut self, i: &'ast syn::TraitItemFn) { + self.fn_depth += 1; + visit::visit_trait_item_fn(self, i); + self.fn_depth -= 1; + } fn visit_item_use(&mut self, i: &'ast syn::ItemUse) { if !self.skipped(&i.attrs) { let mut found = Vec::new(); @@ -268,15 +290,15 @@ impl<'ast> Visit<'ast> for ConstCollector { } } fn visit_item_const(&mut self, i: &'ast syn::ItemConst) { - self.add(&i.ident, &i.expr); + self.add(&i.ident, &i.expr, has_doc(&i.attrs)); visit::visit_item_const(self, i); } fn visit_item_static(&mut self, i: &'ast syn::ItemStatic) { - self.add(&i.ident, &i.expr); + self.add(&i.ident, &i.expr, false); visit::visit_item_static(self, i); } fn visit_impl_item_const(&mut self, i: &'ast syn::ImplItemConst) { - self.add(&i.ident, &i.expr); + self.add(&i.ident, &i.expr, has_doc(&i.attrs)); visit::visit_impl_item_const(self, i); } } @@ -349,6 +371,11 @@ fn last_ident(path: &syn::Path) -> Option { path.segments.last().map(|s| s.ident.to_string()) } +/// Whether an item carries a doc comment (`///` or `#[doc = ...]`). +fn has_doc(attrs: &[Attribute]) -> bool { + attrs.iter().any(|a| a.path().is_ident("doc")) +} + fn cfg_is_test(meta: &Meta) -> bool { match meta { Meta::Path(p) => p.is_ident("test"), @@ -420,8 +447,14 @@ impl Linter<'_> { } fn resolve_consts(&mut self, file: &syn::File) { - let mut collector = - ConstCollector { defs: Vec::new(), imports: Vec::new(), fns: Vec::new(), scope: Vec::new(), include_tests: self.include_tests }; + let mut collector = ConstCollector { + defs: Vec::new(), + imports: Vec::new(), + fns: Vec::new(), + scope: Vec::new(), + fn_depth: 0, + include_tests: self.include_tests, + }; collector.visit_file(file); self.defs = collector.defs; self.imports = collector.imports; @@ -431,7 +464,8 @@ impl Linter<'_> { .defs .iter() .enumerate() - .filter(|(_, d)| d.value.is_none()) + // A named const keeps no literal value: a name that resolves to it reads like a token. + .filter(|(_, d)| d.value.is_none() && !d.named) .filter_map(|(i, d)| self.eval_in(&d.expr, &d.scope).map(|v| (i, v))) .collect(); if resolved.is_empty() { @@ -552,12 +586,21 @@ impl Linter<'_> { Some((shown, def.line)) } + /// Whether the const item named `ident` is a named const (`ConstDef::named`). + fn is_named_const(&self, ident: &syn::Ident) -> bool { + let line = ident.span().start().line; + self.defs.iter().any(|d| d.named && d.line == line && *ident == d.name) + } + fn is_flagged_size(&self, e: &Expr) -> bool { self.eval(e).is_some_and(|v| v != 0.0) } /// Reports `what` when any of `args` is a non-zero literal size. fn size_rule<'e>(&mut self, rule: &'static str, what: proc_macro2::Span, args: impl IntoIterator) { + if self.in_named_const { + return; + } let args: Vec<&Expr> = args.into_iter().collect(); // A vector of literal -1, 0 and 1 is a direction, not a size. if rule == VEC2 && args.iter().all(|a| is_unit_literal(a)) { @@ -726,11 +769,21 @@ fn is_unit_literal(e: &Expr) -> bool { fn hint(rule: &str) -> &'static str { match rule { - VEC2 => "use a size token (`Tokens::of(ui).size.control.md`, `space.gap.inline`) or mark `// design: allow()`", - ADD_SPACE => "use a spacing token (`Tokens::of(ui).space.gap.inline`) or mark `// design: allow()`", - CORNER_RADIUS => "use a radius token from `Tokens::of(ui)` or mark `// design: allow()`", - STROKE => "use a stroke width token from `Tokens::of(ui)` or mark `// design: allow()`", - MARGIN => "use a spacing token (`Tokens::of(ui).space`) or mark `// design: allow()`", + VEC2 => { + "use a size token (`Tokens::of(ui).size.control.md`, `space.gap.inline`), a documented module-level const for a dimension of the component's own drawing, or mark `// design: allow()`" + } + ADD_SPACE => { + "use a spacing token (`Tokens::of(ui).space.gap.inline`), a documented module-level const for a dimension of the component's own drawing, or mark `// design: allow()`" + } + CORNER_RADIUS => { + "use a radius token from `Tokens::of(ui)`, a documented module-level const for a dimension of the component's own drawing, or mark `// design: allow()`" + } + STROKE => { + "use a stroke width token from `Tokens::of(ui)`, a documented module-level const for a dimension of the component's own drawing, or mark `// design: allow()`" + } + MARGIN => { + "use a spacing token (`Tokens::of(ui).space`), a documented module-level const for a dimension of the component's own drawing, or mark `// design: allow()`" + } TOOLTIP => "use `craft_ui::contract::Props::tooltip` or `craft_ui::contract::Show::show_with_tip` or mark `// design: allow()`", STYLE_MUTATION => "set styles through the theme (craft-ui installs them from the tokens) or mark `// design: allow()`", _ => "use a type-size token from `Tokens::of(ui)` or mark `// design: allow()`", @@ -774,9 +827,18 @@ impl<'ast> Visit<'ast> for Linter<'_> { } fn visit_item_const(&mut self, i: &'ast syn::ItemConst) { if !self.skips(&i.attrs, i.span()) { + let named = self.in_named_const || self.is_named_const(&i.ident); + let outer = std::mem::replace(&mut self.in_named_const, named); visit::visit_item_const(self, i); + self.in_named_const = outer; } } + fn visit_impl_item_const(&mut self, i: &'ast syn::ImplItemConst) { + let named = self.in_named_const || self.is_named_const(&i.ident); + let outer = std::mem::replace(&mut self.in_named_const, named); + visit::visit_impl_item_const(self, i); + self.in_named_const = outer; + } fn visit_item_static(&mut self, i: &'ast syn::ItemStatic) { if !self.skips(&i.attrs, i.span()) { visit::visit_item_static(self, i); diff --git a/crates/design-lint/tests/rules.rs b/crates/design-lint/tests/rules.rs index 11b6b8efc..cba0e2fe9 100644 --- a/crates/design-lint/tests/rules.rs +++ b/crates/design-lint/tests/rules.rs @@ -67,6 +67,20 @@ fn consts_resolve_by_module_and_impl_scope() { assert_eq!(run(src).len(), 3); } +#[test] +fn documented_consts_are_component_constants() { + // A documented module or impl const is a named value, its initializer included; arithmetic on it reads like a token. + let src = "/// The tick.\nconst TICK: f32 = 3.0;\n/// The room.\nconst ROOM: Vec2 = vec2(30.0, 40.0);\nstruct A;\nimpl A {\n /// The pad.\n const PAD: f32 = 6.0;\n fn f(&self, ui: &mut Ui) { ui.add_space(Self::PAD); ui.add_space(TICK * 2.0); let v = vec2(TICK, ROOM.y); }\n}\n"; + assert!(clean(src)); + + // An undocumented const, a documented const in a fn body and a literal stay flagged. + let src = "const GAP: f32 = 4.0;\nfn f(ui: &mut Ui) { ui.add_space(GAP); }\nfn g(ui: &mut Ui) {\n /// The gap.\n const LOCAL: f32 = 4.0;\n ui.add_space(LOCAL);\n}\nfn h(ui: &mut Ui) { ui.add_space(4.0); }\n"; + assert_eq!(run(src).iter().map(|f| f.line).collect::>(), [2, 6, 8]); + + // The initializer of an undocumented const is a call site. + assert!(flagged("const ROOM: Vec2 = vec2(30.0, 40.0);\n", "literal-size/vec2")); +} + #[test] fn clippy_allow_attributes_are_counted_and_inner_ones_flagged() { let src = "#![allow(clippy::disallowed_methods, reason = \"stock widgets\")]\n#[expect(clippy::disallowed_types)]\nstruct S;\n#[allow(clippy::too_many_arguments)]\nfn f() {}\nmod m {\n #![expect(clippy::disallowed_methods)]\n}\n"; diff --git a/crates/draw/src/ui/pen/anchor_tool.rs b/crates/draw/src/ui/pen/anchor_tool.rs index 41cb41592..6a97242d4 100644 --- a/crates/draw/src/ui/pen/anchor_tool.rs +++ b/crates/draw/src/ui/pen/anchor_tool.rs @@ -10,7 +10,6 @@ use craft_ui::primitives::{Draw, ToolIcon}; use egui::Vec2; /// The apex of the Convert Point icon's caret, in the units of the icon's box. -// design: allow[literal-size/vec2](the cursor art's hot spot offset in icon units, not a layout size) const CONVERT_TIP: Vec2 = Vec2::new(ICON_BOX / 2.0, 5.5); /// The canvas tool of Add Anchor Point, Delete Anchor Point, Convert Point and Direct Selection. Every press of these diff --git a/crates/pages/src/ui/page_rulers/stories.rs b/crates/pages/src/ui/page_rulers/stories.rs index 7cdf4a66c..5afae5d28 100644 --- a/crates/pages/src/ui/page_rulers/stories.rs +++ b/crates/pages/src/ui/page_rulers/stories.rs @@ -41,7 +41,6 @@ fn inches() -> DocUnit { fn vertical(ui: &mut Ui, rows: &[f32], text: Option) -> StoryOutput { let full = craft_ui::testing::stage(ui); let page = demo_placed(1, pos2(full.min.x + STRIP, full.min.y + PAGE_TOP)).remove(0); - // design: allow[literal-size/vec2](the strip is the demo page margin in document points, story data) let strip = Rect::from_min_size(full.min, vec2(STRIP, full.height())); let mut ruler = VerticalRuler::new("Vertical ruler", &page).unit(inches()).rows(rows); if let Some(range) = text { diff --git a/crates/print/src/ui/dialog.rs b/crates/print/src/ui/dialog.rs index 85aeb96cf..df832b256 100644 --- a/crates/print/src/ui/dialog.rs +++ b/crates/print/src/ui/dialog.rs @@ -311,13 +311,11 @@ impl Component for PrintPreview<'_> { } // The description and the labels are text of the printed page; the preview shows where each stands. if marks.description { - // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) let from = paper.left_bottom() + vec2(MARK_GAP, -MARK_GAP); // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) rule(RuleKind::Edge, from, from + vec2(MARK_LEN * 3.0, 0.0)); } if marks.labels { - // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) let from = paper.left_top() + vec2(MARK_GAP, MARK_GAP); // design: allow[literal-size/vec2](printer's marks are page geometry in points, not UI sizes) rule(RuleKind::Edge, from, from + vec2(MARK_LEN * 3.0, 0.0)); diff --git a/crates/theme/README.md b/crates/theme/README.md index 483655170..a75dccadb 100644 --- a/crates/theme/README.md +++ b/crates/theme/README.md @@ -20,17 +20,15 @@ let resolved = resolve(theme, appearance, None); ## Tokens -Three layers, each derived from the one before: +Two layers, the second derived from the first: 1. **Primitives**: sRGB and OKLCH colour, WCAG contrast, 12-step colour ramps, fixed scales (space, radius, stroke, opacity, duration, easing, elevation). 2. **Semantic tokens**: surface, text, line, state, accent, status, overlay, data and caption colours; shape, size, space, motion and type tokens. Seeds (neutral, accent, four status colours) generate ramps, and ramps fill the tokens. -3. **Component tokens**: one struct per component family (button, badge, check box, radio button and switch, text and number field, guide, handle, icon button, kbd, list box, marquee, progress bar, readout, ruler, segmented control, slider, swatch, toggle button, tooltip), with curated overrides. -A theme sets **seeds** and may **pin** any colour token (`"surface.panel": "#F0F0F0"`), or a -component field, per mode. Pins win over derivation. Apps can pin per app (`apps.`). +A theme sets **seeds** and may **pin** any colour token (`"surface.panel": "#F0F0F0"`) per mode. Pins win over derivation. Apps can pin per app (`apps.`). ## Contrast diff --git a/crates/theme/sizes/comfortable.json b/crates/theme/sizes/comfortable.json index 02c680a30..49353b25f 100644 --- a/crates/theme/sizes/comfortable.json +++ b/crates/theme/sizes/comfortable.json @@ -69,9 +69,6 @@ "short": 120.0, "track": 144.0 }, - "notice": { - "width": 360.0 - }, "pane": { "least": 50.0 }, @@ -96,18 +93,6 @@ "row": { "text": 21.0 }, - "ruler": { - "tick": { - "mid": 9.0, - "minor": 4.5 - } - }, - "scroll_fade": 20.0, - "story": { - "height": 450.0, - "width_max": 900.0, - "width_min": 300.0 - }, "thumb": { "card": 160.0, "lg": 48.0, diff --git a/crates/theme/sizes/compact.json b/crates/theme/sizes/compact.json index b54e86102..1d2cc8a06 100644 --- a/crates/theme/sizes/compact.json +++ b/crates/theme/sizes/compact.json @@ -69,9 +69,6 @@ "short": 96.0, "track": 128.0 }, - "notice": { - "width": 360.0 - }, "pane": { "least": 40.0 }, @@ -96,18 +93,6 @@ "row": { "text": 18.0 }, - "ruler": { - "tick": { - "mid": 6.0, - "minor": 3.0 - } - }, - "scroll_fade": 20.0, - "story": { - "height": 360.0, - "width_max": 720.0, - "width_min": 240.0 - }, "thumb": { "card": 128.0, "lg": 48.0, diff --git a/crates/theme/src/dump.rs b/crates/theme/src/dump.rs index 0805e416f..a37895275 100644 --- a/crates/theme/src/dump.rs +++ b/crates/theme/src/dump.rs @@ -7,9 +7,9 @@ use std::fmt::Write as _; use crate::{ BarSizes, ColorToken, ControlSizes, DialogSizes, DockColumnSizes, Easing, Edge, Elevation, ElevationTokens, FloatSizes, FontSlot, Gaps, - HandleSizes, HitSizes, IconSizes, Insets, KnobShape, LengthSizes, Motion, MotionTokens, NoticeSizes, Pads, PaneSizes, PlotSizes, RadiusSet, - RailSizes, RampSizes, Rgba, RowSizes, RulerSizes, RulerTickSizes, ShapeTokens, SizeTokens, SpaceTokens, StorySizes, StrokeTokens, ThumbSamples, - ThumbSizes, Tokens, TypeStyle, TypeTokens, WellShape, WindowSizes, + HandleSizes, HitSizes, IconSizes, Insets, KnobShape, LengthSizes, Motion, MotionTokens, Pads, PaneSizes, PlotSizes, RadiusSet, RailSizes, + RampSizes, Rgba, RowSizes, ShapeTokens, SizeTokens, SpaceTokens, StrokeTokens, ThumbSamples, ThumbSizes, Tokens, TypeStyle, TypeTokens, + WellShape, WindowSizes, }; /// The text of every token, one `key = value` line each, in a fixed order. @@ -116,7 +116,6 @@ fn size_lines(out: &mut Lines, size: &SizeTokens) { bar, panel_header, popup_min, - scroll_fade, thumb: thumbs, handle, hit, @@ -130,11 +129,8 @@ fn size_lines(out: &mut Lines, size: &SizeTokens) { float, window, pane, - ruler, dock, - notice, dialog, - story, } = size; let ControlSizes { sm, md } = control; out.line("size.control.sm", len(*sm)); @@ -154,7 +150,6 @@ fn size_lines(out: &mut Lines, size: &SizeTokens) { } out.line("size.panel_header", len(*panel_header)); out.line("size.popup_min", len(*popup_min)); - out.line("size.scroll_fade", len(*scroll_fade)); let ThumbSizes { sm, md, lg, card, sample } = thumbs; out.line("size.thumb.sm", len(*sm)); out.line("size.thumb.md", len(*md)); @@ -198,23 +193,13 @@ fn size_lines(out: &mut Lines, size: &SizeTokens) { out.line("size.window.cascade", len(*cascade)); let PaneSizes { least } = pane; out.line("size.pane.least", len(*least)); - let RulerSizes { tick } = ruler; - let RulerTickSizes { mid, minor } = tick; - out.line("size.ruler.tick.mid", len(*mid)); - out.line("size.ruler.tick.minor", len(*minor)); let DockColumnSizes { column } = dock; out.line("size.dock.column", len(*column)); - let NoticeSizes { width } = notice; - out.line("size.notice.width", len(*width)); let DialogSizes { least, wrap, button, side_button } = dialog; out.line("size.dialog.least", len(*least)); out.line("size.dialog.wrap", len(*wrap)); out.line("size.dialog.button", len(*button)); out.line("size.dialog.side_button", len(*side_button)); - let StorySizes { height, width_min, width_max } = story; - out.line("size.story.height", len(*height)); - out.line("size.story.width_min", len(*width_min)); - out.line("size.story.width_max", len(*width_max)); } fn slot(s: FontSlot) -> &'static str { diff --git a/crates/theme/src/lib.rs b/crates/theme/src/lib.rs index 57e85bce2..3bed2c09f 100644 --- a/crates/theme/src/lib.rs +++ b/crates/theme/src/lib.rs @@ -98,9 +98,9 @@ pub use token_group::{GroupValues, TokenGroup}; pub use tokens::{ AccentColors, BarSizes, CaptionColors, ColorToken, ColorTokens, ControlSizes, DataColors, DialogSizes, DockColumnSizes, Edge, EdgeColors, ElevationTokens, FloatSizes, FontSlot, Gaps, HandleSizes, HitSizes, IconSizes, Insets, KnobShape, LengthSizes, LineColors, Motion, MotionTokens, - NoticeSizes, OverlayColors, Pads, PaneSizes, PlotSizes, RadiusSet, RailSizes, RampSizes, RowSizes, RulerSizes, RulerTickSizes, ShapeTokens, - SizeTokens, SpaceTokens, StateColors, Status, StatusColors, StatusKind, StorySizes, StrokeTokens, SurfaceColors, TextColors, ThumbSamples, - ThumbSizes, Tokens, TypeRole, TypeStyle, TypeTokens, WellShape, WindowSizes, + OverlayColors, Pads, PaneSizes, PlotSizes, RadiusSet, RailSizes, RampSizes, RowSizes, ShapeTokens, SizeTokens, SpaceTokens, StateColors, Status, + StatusColors, StatusKind, StrokeTokens, SurfaceColors, TextColors, ThumbSamples, ThumbSizes, Tokens, TypeRole, TypeStyle, TypeTokens, WellShape, + WindowSizes, }; pub use values::ColorSource; pub use variant::{CustomVariant, Emphasis, RadiusStep, Variant, VariantLook}; diff --git a/crates/theme/src/sizes.rs b/crates/theme/src/sizes.rs index a6adbf00b..6464ecb67 100644 --- a/crates/theme/src/sizes.rs +++ b/crates/theme/src/sizes.rs @@ -107,7 +107,6 @@ pub(crate) fn leaves(b: &mut Preset) -> Vec> { "base.size.bar.options_narrow" Num 16.0..=80.0 => s.bar.options_narrow; "base.size.panel_header" Num 16.0..=64.0 => s.panel_header; "base.size.popup_min" Num 64.0..=640.0 => s.popup_min; - "base.size.scroll_fade" Num 4.0..=64.0 => s.scroll_fade; "base.size.thumb.sm" Num 12.0..=96.0 => s.thumb.sm; "base.size.thumb.md" Num 12.0..=96.0 => s.thumb.md; "base.size.thumb.lg" Num 12.0..=96.0 => s.thumb.lg; @@ -140,13 +139,7 @@ pub(crate) fn leaves(b: &mut Preset) -> Vec> { "base.size.float.height" Num 48.0..=1024.0 => s.float.height; "base.size.window.cascade" Num 8.0..=96.0 => s.window.cascade; "base.size.pane.least" Num 16.0..=128.0 => s.pane.least; - "base.size.ruler.tick.mid" Num 1.0..=32.0 => s.ruler.tick.mid; - "base.size.ruler.tick.minor" Num 1.0..=32.0 => s.ruler.tick.minor; - "base.size.story.height" Num 120.0..=1024.0 => s.story.height; - "base.size.story.width_min" Num 120.0..=1024.0 => s.story.width_min; - "base.size.story.width_max" Num 120.0..=2048.0 => s.story.width_max; "base.size.dock.column" Num 120.0..=640.0 => s.dock.column; - "base.size.notice.width" Num 120.0..=1024.0 => s.notice.width; "base.size.dialog.least" Num 120.0..=1024.0 => s.dialog.least; "base.size.dialog.wrap" Num 120.0..=1024.0 => s.dialog.wrap; "base.size.dialog.button" Num 24.0..=240.0 => s.dialog.button; diff --git a/crates/theme/src/tokens/size.rs b/crates/theme/src/tokens/size.rs index 461a4fd21..65456f785 100644 --- a/crates/theme/src/tokens/size.rs +++ b/crates/theme/src/tokens/size.rs @@ -202,8 +202,6 @@ pub struct SizeTokens { pub panel_header: f32, /// Least width of a popup surface: a menu or a popup list. pub popup_min: f32, - /// The length of the fade at an edge of a scroll region past which its content continues. - pub scroll_fade: f32, /// Thumbnail sides. pub thumb: ThumbSizes, /// Canvas drag handles. @@ -233,41 +231,8 @@ pub struct SizeTokens { pub pane: PaneSizes, /// The docks' columns. pub dock: DockColumnSizes, - /// Notice cards: toasts. - pub notice: NoticeSizes, /// Dialogs: their content width and their buttons. pub dialog: DialogSizes, - /// The rulers of a canvas. - pub ruler: RulerSizes, - /// The stage a story draws on. - pub story: StorySizes, -} - -/// The stage a story draws on, in logical pixels: a story of a canvas control, and each column of a story grid. -#[derive(Clone, Copy, Debug, Default, PartialEq)] -pub struct StorySizes { - /// The height of the stage a story of a canvas control shows its canvas on. - pub height: f32, - /// The least width of a story: of that stage, and of a column of a story grid. - pub width_min: f32, - /// The greatest width of that stage. - pub width_max: f32, -} - -/// The sizes of a canvas ruler, in logical pixels. -#[derive(Clone, Copy, Debug, Default, PartialEq)] -pub struct RulerSizes { - /// The tick marks. - pub tick: RulerTickSizes, -} - -/// The lengths of a ruler's tick marks, in logical pixels. The major tick spans the ruler's depth. -#[derive(Clone, Copy, Debug, Default, PartialEq)] -pub struct RulerTickSizes { - /// The tick halfway between two labelled ticks. - pub mid: f32, - /// The tick between two other ticks. - pub minor: f32, } /// The sizes of the panes of a dock's split, in logical pixels. @@ -286,13 +251,6 @@ pub struct DockColumnSizes { pub column: f32, } -/// The sizes of a notice card, in logical pixels. -#[derive(Clone, Copy, Debug, Default, PartialEq)] -pub struct NoticeSizes { - /// The width every card of a toast stack has where the room allows. - pub width: f32, -} - /// The sizes of a dialog, in logical pixels. #[derive(Clone, Copy, Debug, Default, PartialEq)] pub struct DialogSizes { diff --git a/crates/theme/tests/dumps/tokens/adwaita-dark-high-comfortable.txt b/crates/theme/tests/dumps/tokens/adwaita-dark-high-comfortable.txt index e1e34bf96..f6f0f889d 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-dark-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/adwaita-dark-high-compact.txt b/crates/theme/tests/dumps/tokens/adwaita-dark-high-compact.txt index 234c614fd..baa136a14 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-dark-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/adwaita-dark-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/adwaita-dark-standard-comfortable.txt index 3ef6d8504..07a2b182b 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-dark-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/adwaita-dark-standard-compact.txt b/crates/theme/tests/dumps/tokens/adwaita-dark-standard-compact.txt index a9aba5082..663d9aa56 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-dark-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/adwaita-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/adwaita-light-high-comfortable.txt index 2af6bbff1..30791b515 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/adwaita-light-high-compact.txt b/crates/theme/tests/dumps/tokens/adwaita-light-high-compact.txt index d1648993d..0dbad648c 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/adwaita-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/adwaita-light-standard-comfortable.txt index b320cc27d..97f26b5b8 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/adwaita-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/adwaita-light-standard-compact.txt index 1e29c9a77..6afca472b 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/artcraft-dark-high-comfortable.txt b/crates/theme/tests/dumps/tokens/artcraft-dark-high-comfortable.txt index 70b095cf4..290bfbd69 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-dark-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/artcraft-dark-high-compact.txt b/crates/theme/tests/dumps/tokens/artcraft-dark-high-compact.txt index ae6cd9e19..08cb3121d 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-dark-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/artcraft-dark-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/artcraft-dark-standard-comfortable.txt index e1f8c22a7..0edf137d8 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-dark-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/artcraft-dark-standard-compact.txt b/crates/theme/tests/dumps/tokens/artcraft-dark-standard-compact.txt index 4f76678e5..98cfdf3ca 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-dark-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/artcraft-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/artcraft-light-high-comfortable.txt index 00a1091c9..4ef00d6e6 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/artcraft-light-high-compact.txt b/crates/theme/tests/dumps/tokens/artcraft-light-high-compact.txt index bfb368afb..bfc96544d 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/artcraft-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/artcraft-light-standard-comfortable.txt index 55f702a1f..7af4ea988 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/artcraft-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/artcraft-light-standard-compact.txt index 6ebe57241..c8f3f50a3 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/breeze-dark-high-comfortable.txt b/crates/theme/tests/dumps/tokens/breeze-dark-high-comfortable.txt index 709e21b2a..9095b81a2 100644 --- a/crates/theme/tests/dumps/tokens/breeze-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/breeze-dark-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/breeze-dark-high-compact.txt b/crates/theme/tests/dumps/tokens/breeze-dark-high-compact.txt index 352f425c3..69a5660f7 100644 --- a/crates/theme/tests/dumps/tokens/breeze-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/breeze-dark-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/breeze-dark-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/breeze-dark-standard-comfortable.txt index 777b6c368..cef377c1a 100644 --- a/crates/theme/tests/dumps/tokens/breeze-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/breeze-dark-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/breeze-dark-standard-compact.txt b/crates/theme/tests/dumps/tokens/breeze-dark-standard-compact.txt index 39337fa26..a8ca13233 100644 --- a/crates/theme/tests/dumps/tokens/breeze-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/breeze-dark-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/breeze-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/breeze-light-high-comfortable.txt index d815f8260..7292f9c95 100644 --- a/crates/theme/tests/dumps/tokens/breeze-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/breeze-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/breeze-light-high-compact.txt b/crates/theme/tests/dumps/tokens/breeze-light-high-compact.txt index 3a3de563a..03870d5cd 100644 --- a/crates/theme/tests/dumps/tokens/breeze-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/breeze-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/breeze-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/breeze-light-standard-comfortable.txt index 1c1046d51..2663a322b 100644 --- a/crates/theme/tests/dumps/tokens/breeze-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/breeze-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/breeze-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/breeze-light-standard-compact.txt index d28858afa..1d486baed 100644 --- a/crates/theme/tests/dumps/tokens/breeze-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/breeze-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/classic-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/classic-light-high-comfortable.txt index 0a8745f5e..c2b224cad 100644 --- a/crates/theme/tests/dumps/tokens/classic-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/classic-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/classic-light-high-compact.txt b/crates/theme/tests/dumps/tokens/classic-light-high-compact.txt index 6ded2511a..21eb18c2f 100644 --- a/crates/theme/tests/dumps/tokens/classic-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/classic-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/classic-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/classic-light-standard-comfortable.txt index 64a72cd99..d13e565b2 100644 --- a/crates/theme/tests/dumps/tokens/classic-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/classic-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/classic-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/classic-light-standard-compact.txt index 475e84eb3..75df34571 100644 --- a/crates/theme/tests/dumps/tokens/classic-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/classic-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/graphite-dark-high-comfortable.txt b/crates/theme/tests/dumps/tokens/graphite-dark-high-comfortable.txt index ed62a4f67..1903a0cab 100644 --- a/crates/theme/tests/dumps/tokens/graphite-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/graphite-dark-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/graphite-dark-high-compact.txt b/crates/theme/tests/dumps/tokens/graphite-dark-high-compact.txt index ed6911bd1..7749259d4 100644 --- a/crates/theme/tests/dumps/tokens/graphite-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/graphite-dark-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/graphite-dark-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/graphite-dark-standard-comfortable.txt index cb1c644a7..5048aad6e 100644 --- a/crates/theme/tests/dumps/tokens/graphite-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/graphite-dark-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/graphite-dark-standard-compact.txt b/crates/theme/tests/dumps/tokens/graphite-dark-standard-compact.txt index fd85432e1..10b953f21 100644 --- a/crates/theme/tests/dumps/tokens/graphite-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/graphite-dark-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/graphite-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/graphite-light-high-comfortable.txt index 086e42f22..00ffcfed9 100644 --- a/crates/theme/tests/dumps/tokens/graphite-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/graphite-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/graphite-light-high-compact.txt b/crates/theme/tests/dumps/tokens/graphite-light-high-compact.txt index 20062381c..f960fdee2 100644 --- a/crates/theme/tests/dumps/tokens/graphite-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/graphite-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/graphite-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/graphite-light-standard-comfortable.txt index ac916ce09..2e6c3882c 100644 --- a/crates/theme/tests/dumps/tokens/graphite-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/graphite-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/graphite-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/graphite-light-standard-compact.txt index c7e474ea1..9a62914d3 100644 --- a/crates/theme/tests/dumps/tokens/graphite-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/graphite-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-dark-high-comfortable.txt b/crates/theme/tests/dumps/tokens/pro-dark-high-comfortable.txt index a653473ad..a1fbfdc45 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-dark-high-compact.txt b/crates/theme/tests/dumps/tokens/pro-dark-high-compact.txt index 6c8c0dfee..e2fcea5f2 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable-app-sizes.txt b/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable-app-sizes.txt index a2fc1f7d2..7e441df23 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable-app-sizes.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable-app-sizes.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable.txt index c1cc33b3e..251190a64 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-dark-standard-compact.txt b/crates/theme/tests/dumps/tokens/pro-dark-standard-compact.txt index 1964a740c..72ddc45e9 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-light-gray-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/pro-light-gray-light-high-comfortable.txt index f161ee554..8367df0dc 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-gray-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-gray-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-light-gray-light-high-compact.txt b/crates/theme/tests/dumps/tokens/pro-light-gray-light-high-compact.txt index 32bf9b423..9ed556dab 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-gray-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-gray-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-light-gray-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/pro-light-gray-light-standard-comfortable.txt index 284bb93e2..ba9f4e843 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-gray-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-gray-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-light-gray-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/pro-light-gray-light-standard-compact.txt index 4dfa8b047..4aa509b95 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-gray-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-gray-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/pro-light-high-comfortable.txt index 257a367dd..ce1af43c1 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-light-high-compact.txt b/crates/theme/tests/dumps/tokens/pro-light-high-compact.txt index 68cdaad75..bed4e1f79 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/pro-light-standard-comfortable.txt index 1b2bc5507..01b5b2a57 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/pro-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/pro-light-standard-compact.txt index b4bbf55d3..3c1537b6f 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/soft-dark-high-comfortable.txt b/crates/theme/tests/dumps/tokens/soft-dark-high-comfortable.txt index ad8f3275d..1f5a590c3 100644 --- a/crates/theme/tests/dumps/tokens/soft-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/soft-dark-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/soft-dark-high-compact.txt b/crates/theme/tests/dumps/tokens/soft-dark-high-compact.txt index 17d472b79..db070fb55 100644 --- a/crates/theme/tests/dumps/tokens/soft-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/soft-dark-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/soft-dark-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/soft-dark-standard-comfortable.txt index 7b167d2e2..66d7444ae 100644 --- a/crates/theme/tests/dumps/tokens/soft-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/soft-dark-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/soft-dark-standard-compact.txt b/crates/theme/tests/dumps/tokens/soft-dark-standard-compact.txt index 857b91ed1..88b92b44c 100644 --- a/crates/theme/tests/dumps/tokens/soft-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/soft-dark-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/soft-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/soft-light-high-comfortable.txt index a2e781704..bb1b7b1b7 100644 --- a/crates/theme/tests/dumps/tokens/soft-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/soft-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/soft-light-high-compact.txt b/crates/theme/tests/dumps/tokens/soft-light-high-compact.txt index a96f66c16..652cf8299 100644 --- a/crates/theme/tests/dumps/tokens/soft-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/soft-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/soft-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/soft-light-standard-comfortable.txt index e113483a0..08a58ef9e 100644 --- a/crates/theme/tests/dumps/tokens/soft-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/soft-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/soft-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/soft-light-standard-compact.txt index 838825074..0586c0f88 100644 --- a/crates/theme/tests/dumps/tokens/soft-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/soft-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/solarized-dark-dark-high-comfortable.txt b/crates/theme/tests/dumps/tokens/solarized-dark-dark-high-comfortable.txt index 1a92c8898..40beff6ae 100644 --- a/crates/theme/tests/dumps/tokens/solarized-dark-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/solarized-dark-dark-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/solarized-dark-dark-high-compact.txt b/crates/theme/tests/dumps/tokens/solarized-dark-dark-high-compact.txt index 36e54c9db..aa973e000 100644 --- a/crates/theme/tests/dumps/tokens/solarized-dark-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/solarized-dark-dark-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/solarized-dark-dark-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/solarized-dark-dark-standard-comfortable.txt index a6d0d66c2..3695878d6 100644 --- a/crates/theme/tests/dumps/tokens/solarized-dark-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/solarized-dark-dark-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/solarized-dark-dark-standard-compact.txt b/crates/theme/tests/dumps/tokens/solarized-dark-dark-standard-compact.txt index 50b6a2dd9..1db2e75b0 100644 --- a/crates/theme/tests/dumps/tokens/solarized-dark-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/solarized-dark-dark-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/studio-dark-high-comfortable.txt b/crates/theme/tests/dumps/tokens/studio-dark-high-comfortable.txt index 70ec56153..5f2710e90 100644 --- a/crates/theme/tests/dumps/tokens/studio-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/studio-dark-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/studio-dark-high-compact.txt b/crates/theme/tests/dumps/tokens/studio-dark-high-compact.txt index ac2fc9e97..57b5d112d 100644 --- a/crates/theme/tests/dumps/tokens/studio-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/studio-dark-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/studio-dark-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/studio-dark-standard-comfortable.txt index 800b1a04d..1826e99ea 100644 --- a/crates/theme/tests/dumps/tokens/studio-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/studio-dark-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/studio-dark-standard-compact.txt b/crates/theme/tests/dumps/tokens/studio-dark-standard-compact.txt index 6d573d055..51a7034df 100644 --- a/crates/theme/tests/dumps/tokens/studio-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/studio-dark-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/studio-light-high-comfortable.txt b/crates/theme/tests/dumps/tokens/studio-light-high-comfortable.txt index 310de3b24..e9c49c1af 100644 --- a/crates/theme/tests/dumps/tokens/studio-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/studio-light-high-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/studio-light-high-compact.txt b/crates/theme/tests/dumps/tokens/studio-light-high-compact.txt index 2b734d0c3..ae6eb3217 100644 --- a/crates/theme/tests/dumps/tokens/studio-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/studio-light-high-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/studio-light-standard-comfortable.txt b/crates/theme/tests/dumps/tokens/studio-light-standard-comfortable.txt index 9daaaa4c8..f2c8e0554 100644 --- a/crates/theme/tests/dumps/tokens/studio-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/studio-light-standard-comfortable.txt @@ -144,7 +144,6 @@ size.bar.options = 42 size.bar.options_narrow = 36 size.panel_header = 34 size.popup_min = 240 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 34 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 240 size.float.height = 300 size.window.cascade = 38 size.pane.least = 50 -size.ruler.tick.mid = 9 -size.ruler.tick.minor = 4.5 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 450 -size.story.width_min = 300 -size.story.width_max = 900 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/theme/tests/dumps/tokens/studio-light-standard-compact.txt b/crates/theme/tests/dumps/tokens/studio-light-standard-compact.txt index e3baee9f6..6e62a52b3 100644 --- a/crates/theme/tests/dumps/tokens/studio-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/studio-light-standard-compact.txt @@ -144,7 +144,6 @@ size.bar.options = 36 size.bar.options_narrow = 28 size.panel_header = 28 size.popup_min = 192 -size.scroll_fade = 20 size.thumb.sm = 18 size.thumb.md = 24 size.thumb.lg = 48 @@ -177,17 +176,11 @@ size.float.width = 192 size.float.height = 240 size.window.cascade = 32 size.pane.least = 40 -size.ruler.tick.mid = 6 -size.ruler.tick.minor = 3 size.dock.column = 340 -size.notice.width = 360 size.dialog.least = 380 size.dialog.wrap = 440 size.dialog.button = 84 size.dialog.side_button = 96 -size.story.height = 360 -size.story.width_min = 240 -size.story.width_max = 720 stroke.thin = 1 stroke.medium = 1.5 stroke.thick = 2 diff --git a/crates/ui-canvas/src/canvas/tools.rs b/crates/ui-canvas/src/canvas/tools.rs index 28e021518..1e1feaa27 100644 --- a/crates/ui-canvas/src/canvas/tools.rs +++ b/crates/ui-canvas/src/canvas/tools.rs @@ -24,10 +24,10 @@ const ROTATE_STEP_DEG: f64 = 15.0; /// The room Fit Artboard on Screen leaves around the board, in points: at the sides, and above and below (the board's /// name sits above it). -const ARTBOARD_MARGIN: Vec2 = Vec2::new(30.0, 40.0); // design: allow[literal-size/vec2](view-fit room in screen points, not a look) +const ARTBOARD_MARGIN: Vec2 = Vec2::new(30.0, 40.0); /// The room Fit Layers on Screen leaves around the layers' bounds, in points. -const LAYERS_MARGIN: Vec2 = Vec2::new(20.0, 20.0); // design: allow[literal-size/vec2](view-fit room in screen points, not a look) +const LAYERS_MARGIN: Vec2 = Vec2::new(20.0, 20.0); /// The room Fit on Screen leaves around the document on each side, in points. const FIT_MARGIN: f64 = 20.0; diff --git a/crates/ui-contract/src/contract/body/scroll.rs b/crates/ui-contract/src/contract/body/scroll.rs index c1d1ba13c..d83bb4afb 100644 --- a/crates/ui-contract/src/contract/body/scroll.rs +++ b/crates/ui-contract/src/contract/body/scroll.rs @@ -187,7 +187,7 @@ impl BodyHooks<'_> { let content = Vec2::new(if scroll.horizontal_on() { ex } else { view.width() }, if scroll.vertical_on() { ey } else { view.height() }); let offset = Vec2::new(self.offset.x as f32, self.offset.y as f32); let background = surface_style(tokens, SurfaceKind::under(own_surface(props, cx), env.surface)).fill; - ui.painter().extend(ScrollBar::fades(&look, view, HiddenContent::new(content, view.size(), offset, rtl), background)); + ui.painter().extend(ScrollBar::fades(view, HiddenContent::new(content, view.size(), offset, rtl), background)); } if let Some(view) = self.view { use crate::contract::Pointer as _; diff --git a/crates/ui-contract/src/contract/items/hooks.rs b/crates/ui-contract/src/contract/items/hooks.rs index 49729416d..1f8f7507c 100644 --- a/crates/ui-contract/src/contract/items/hooks.rs +++ b/crates/ui-contract/src/contract/items/hooks.rs @@ -745,7 +745,7 @@ impl ShapeHooks for ItemsHooks<'_, '_, C> { // The rows blend into the surface they sit on. let background = surface_style(&env.tokens, SurfaceKind::under(own, env.surface)).fill; let hidden = HiddenContent::new(self.content, rect.size(), Vec2::new(self.offset_x as f32, self.offset as f32), rtl); - ui.painter().extend(ScrollBar::fades(&look, rect, hidden, background)); + ui.painter().extend(ScrollBar::fades(rect, hidden, background)); if self.shows_bar(rect) { let track = bar_track(rect, look.thickness, rtl); let content = f64::from(self.content.y); diff --git a/crates/ui-contract/src/primitives/kit.rs b/crates/ui-contract/src/primitives/kit.rs index f53b7b778..a6a95abf5 100644 --- a/crates/ui-contract/src/primitives/kit.rs +++ b/crates/ui-contract/src/primitives/kit.rs @@ -34,14 +34,20 @@ pub enum TickEdge { #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[non_exhaustive] pub enum TickRank { - /// The shortest, `size.ruler.tick.minor`. + /// The shortest, `TICK_MINOR` long. Minor, - /// Halfway between two major ticks, `size.ruler.tick.mid`. + /// Halfway between two major ticks, `TICK_MID` long. Mid, - /// The longest, `space.gap.inline`. + /// The longest, across the ruler's depth. Major, } +/// The length of a minor tick, in points. The same in every density, as in the apps' rulers. +const TICK_MINOR: f32 = 3.0; + +/// The length of the tick halfway between two major ticks, in points, in every density. +const TICK_MID: f32 = 6.0; + /// One tick: where it sits along its edge and how long it is. #[derive(Clone, Copy, Debug, PartialEq)] #[non_exhaustive] @@ -619,21 +625,20 @@ pub fn grid_lines_with(look: &GridLook, grid: &GridLines, ink: &GridInk, pixels_ } /// The tick marks of `ticks` on one edge of `rect` that `clip` shows, `stroke.thin` lines of `text.faint`: minor ones -/// `size.ruler.tick.minor` long, mid ones `size.ruler.tick.mid`, major ones across the whole depth of `rect`, beside their labels. +/// `TICK_MINOR` long, mid ones `TICK_MID`, major ones across the whole depth of `rect`, beside their labels. pub fn ticks(tokens: &UiTokens, rect: Rect, edge: TickEdge, ticks: &[Tick], clip: Rect, pixels_per_point: f32) -> Vec { let look = RuleLook { color: rgba_color(tokens.color.text.faint), width: RuleWidth::Points(tokens.stroke.thin) }; let depth = match edge { TickEdge::Bottom | TickEdge::Top => rect.height(), TickEdge::Left | TickEdge::Right => rect.width(), }; - let (minor, mid, major) = (tokens.size.ruler.tick.minor, tokens.size.ruler.tick.mid, depth); ticks .iter() .filter_map(|tick| { let length = match tick.rank { - TickRank::Minor => minor, - TickRank::Mid => mid, - TickRank::Major => major, + TickRank::Minor => TICK_MINOR, + TickRank::Mid => TICK_MID, + TickRank::Major => depth, }; let (from, to) = match edge { TickEdge::Bottom => (pos2(rect.left() + tick.at, rect.bottom()), pos2(rect.left() + tick.at, rect.bottom() - length)), diff --git a/crates/ui-contract/src/primitives/pointer_art.rs b/crates/ui-contract/src/primitives/pointer_art.rs index 0fd7be528..412666dde 100644 --- a/crates/ui-contract/src/primitives/pointer_art.rs +++ b/crates/ui-contract/src/primitives/pointer_art.rs @@ -412,7 +412,6 @@ pub(crate) fn type_on(pen: &Pen, path: bool) { /// The locator: a square frame centred on the pointer between halo frames a hairline outside and inside it. pub(crate) fn locator(pen: &Pen) { - // design: allow[literal-size/vec2](pointer art is a fixed bitmap-like drawing around the hotspot, not a layout size) let rect = Rect::from_center_size(Pos2::ZERO, Vec2::splat(LOCATOR_SIDE)); let halo = Stroke::new(pen.thin, pen.halo); pen.push(Mark::Frame(rect.expand(pen.thin), halo)); diff --git a/crates/ui-contract/src/primitives/scroll_bar.rs b/crates/ui-contract/src/primitives/scroll_bar.rs index f0c62a441..8027b18d5 100644 --- a/crates/ui-contract/src/primitives/scroll_bar.rs +++ b/crates/ui-contract/src/primitives/scroll_bar.rs @@ -11,6 +11,9 @@ pub struct ScrollBar; /// The opacity of an edge fade at the view's edge, once at least the fade's length of content is hidden past it. const FADE_STRENGTH: f32 = 0.5; +/// The length of an edge fade, in points, in every density. +const FADE_LENGTH: f32 = 20.0; + /// How far a scroll view's content runs past each of its edges, in points. #[derive(Clone, Copy, Debug, Default, PartialEq)] #[non_exhaustive] @@ -62,13 +65,13 @@ impl ScrollBar { } } - /// The fades over `view` at each edge past which content is hidden: `look.fade` long, from `background` at the + /// The fades over `view` at each edge past which content is hidden: `FADE_LENGTH` long, from `background` at the /// edge to clear inward, the more opaque the more is hidden, up to `FADE_STRENGTH` once a fade's length is. - pub fn fades(look: &ScrollBarLook, view: Rect, hidden: HiddenContent, background: Color32) -> Vec { + pub fn fades(view: Rect, hidden: HiddenContent, background: Color32) -> Vec { let across = |hidden: f32, extent: f32, edge: fn(Rect, f32) -> Rect, direction: Direction| { - let length = look.fade.min(extent); + let length = FADE_LENGTH.min(extent); (hidden > 0.0 && length > 0.0).then(|| { - let at = background.gamma_multiply((hidden / look.fade).clamp(0.0, 1.0) * FADE_STRENGTH); + let at = background.gamma_multiply((hidden / FADE_LENGTH).clamp(0.0, 1.0) * FADE_STRENGTH); Shape::gradient_rect(edge(view, length), direction, [at, Color32::TRANSPARENT]) }) }; diff --git a/crates/ui-contract/src/style/paint.rs b/crates/ui-contract/src/style/paint.rs index 73db34566..59066a5a9 100644 --- a/crates/ui-contract/src/style/paint.rs +++ b/crates/ui-contract/src/style/paint.rs @@ -199,8 +199,6 @@ pub struct ScrollBarLook { pub thumb_width: Stateful, /// The shortest the thumb gets along the bar. pub min_thumb: f32, - /// The length of the fade at an edge past which content is hidden. - pub fade: f32, } /// The shortest a scroll bar's thumb gets along the bar, whatever the bar's kind. @@ -245,7 +243,6 @@ pub(crate) fn scroll_bar_look_of(tokens: &UiTokens, kind: ScrollBarKind) -> Scro thickness, thumb_width: Stateful::new(rest).off(craft_theme::States::new(rest, thickness, thickness, rest)), min_thumb: min_thumb(tokens), - fade: tokens.size.scroll_fade, } } diff --git a/crates/ui-contract/src/testing/mod.rs b/crates/ui-contract/src/testing/mod.rs index a4dc0c3f4..f6993ccd3 100644 --- a/crates/ui-contract/src/testing/mod.rs +++ b/crates/ui-contract/src/testing/mod.rs @@ -51,7 +51,7 @@ pub use crate::runtime::measure::{ pub use craft_ui_macros::{story, trial}; pub use fixture::{Fixture, Impure, Room, Target}; pub use frames::Frames; -pub use stage::{room_height, stage, stage_fitting, stage_width}; +pub use stage::{least_stage_width, room_height, stage, stage_fitting, stage_width}; #[doc(hidden)] pub use story::{ CollectionKind, Drive, EditKind, Grip, Required, Story, StoryData, StoryOutput, StoryRegistration, StorySnapshot, show_as_only_item, stories, diff --git a/crates/ui-contract/src/testing/stage.rs b/crates/ui-contract/src/testing/stage.rs index 89759f814..c295901d2 100644 --- a/crates/ui-contract/src/testing/stage.rs +++ b/crates/ui-contract/src/testing/stage.rs @@ -2,13 +2,33 @@ use crate::layout::flow_room; use crate::runtime::env::Env; +use craft_theme::Tokens; use egui::{Rect, Ui}; +/// The stage's height, in control heights (`size.control.md`): 360 in Compact. +const HEIGHT_IN_CONTROLS: f32 = 15.0; + +/// The stage's least width, in control heights: 240 in Compact. +const WIDTH_MIN_IN_CONTROLS: f32 = 10.0; + +/// The stage's greatest width, in control heights: 720 in Compact. +const WIDTH_MAX_IN_CONTROLS: f32 = 30.0; + +/// The height of a story's stage. +fn stage_height(tokens: &Tokens) -> f32 { + HEIGHT_IN_CONTROLS * tokens.size.control.md +} + +/// The least width of a story's stage, which is also the least width of a column of a story grid. +pub fn least_stage_width(tokens: &Tokens) -> f32 { + WIDTH_MIN_IN_CONTROLS * tokens.size.control.md +} + /// Allocates the stage of a story of a canvas control or a root that fills both axes, and returns its rect: the width -/// left in `ui` between the least and greatest stage width, and the stage height, all from the size tokens. Show the +/// left in `ui` between the least and greatest stage width, and the stage height, all in control heights. Show the /// story's root over it with `show_at`. pub fn stage(ui: &mut Ui) -> Rect { - let height = Env::of(ui).tokens.tokens().size.story.height; + let height = stage_height(&Env::of(ui).tokens); stage_fitting(ui, |_| height) } @@ -16,7 +36,7 @@ pub fn stage(ui: &mut Ui) -> Rect { /// canvas): the room its card's view gives, or the stage height where the room is unbounded. pub fn room_height(ui: &Ui) -> f32 { let room = flow_room(ui).y; - if room.is_finite() { room } else { Env::of(ui).tokens.tokens().size.story.height } + if room.is_finite() { room } else { stage_height(&Env::of(ui).tokens) } } /// Allocates a stage as wide as [`stage`]'s and as tall as the story's content at that width, which `height` gives, @@ -29,8 +49,8 @@ pub fn stage_fitting(ui: &mut Ui, height: impl FnOnce(f32) -> f32) -> Rect { /// The width of the stage [`stage_fitting`] allocates: the width left in `ui` between the least and greatest stage /// width. A story whose content measures itself at a width (through `ui`) reads it before allocating. pub fn stage_width(ui: &Ui) -> f32 { - let story = Env::of(ui).tokens.tokens().size.story; + let tokens = &Env::of(ui).tokens; let room = flow_room(ui).x; let room = if room.is_finite() { room } else { ui.available_width() }; - room.clamp(story.width_min, story.width_max) + room.clamp(least_stage_width(tokens), WIDTH_MAX_IN_CONTROLS * tokens.size.control.md) } diff --git a/crates/ui-gallery/src/chrome/card.rs b/crates/ui-gallery/src/chrome/card.rs index 578b33e42..ced8c50c8 100644 --- a/crates/ui-gallery/src/chrome/card.rs +++ b/crates/ui-gallery/src/chrome/card.rs @@ -20,7 +20,7 @@ use craft_ui::runtime::inspect::{self, Recorded}; use craft_ui::runtime::layout_memory; use craft_ui::sections::{HeaderCommand, HeaderStrength, Panel}; use craft_ui::style::SurfaceKind; -use craft_ui::testing::{StoryData, StoryOutput, StoryRegistration}; +use craft_ui::testing::{StoryData, StoryOutput, StoryRegistration, least_stage_width}; /// A story's show function. type StoryFn = fn(&mut Ui, &mut StoryData) -> StoryOutput; @@ -198,7 +198,7 @@ impl Card<'_> { let gap = Gap::Item.points(ui); // The narrowest a column of stories may be is the least story width, as the old gallery's grids kept // their cases. - let least = Env::of(ui).tokens.size.story.width_min; + let least = least_stage_width(&Env::of(ui).tokens); let fit = ((ui.available_width() + gap) / (least + gap)).floor() as usize; let columns = fit.clamp(1, usize::from(most).clamp(1, COLUMNS.len())); Grid::new(&COLUMNS[..columns]).gap(Gap::Item).fill_width().show(ui, |ui, _| { diff --git a/crates/ui-gallery/src/chrome/overview.rs b/crates/ui-gallery/src/chrome/overview.rs index f9892f4bd..9960c64b4 100644 --- a/crates/ui-gallery/src/chrome/overview.rs +++ b/crates/ui-gallery/src/chrome/overview.rs @@ -16,7 +16,7 @@ use craft_ui::pickers::Select; use craft_ui::runtime::env::{Env, WindowKey}; use craft_ui::shell::AppShell; use craft_ui::style::SurfaceKind; -use craft_ui::testing::StoryRegistration; +use craft_ui::testing::{StoryRegistration, least_stage_width}; use egui::Ui; /// A card's story row before it ran, in standard control heights (120 at a 24 control). @@ -24,7 +24,7 @@ const STORY_ROW_IN_CONTROLS: f32 = 5.0; /// The narrowest a card may be before the cards go to one column: a story at its least width inside the card's padding. fn card_min_width(tokens: &Tokens) -> f32 { - tokens.size.story.width_min + 2.0 * tokens.space.pad.regular + least_stage_width(tokens) + 2.0 * tokens.space.pad.regular } const ONE: &[ColumnWidth] = &[ColumnWidth::fill(1.0)]; diff --git a/crates/ui-patterns/src/patterns/preferences/window.rs b/crates/ui-patterns/src/patterns/preferences/window.rs index c056738dc..f78ef4648 100644 --- a/crates/ui-patterns/src/patterns/preferences/window.rs +++ b/crates/ui-patterns/src/patterns/preferences/window.rs @@ -24,9 +24,9 @@ use std::cell::RefCell; use std::sync::Arc; /// The size the window opens at until the user resizes it. -pub const DEFAULT_SIZE: Vec2 = vec2(1040.0, 800.0); // design: allow[literal-size/vec2](the window's own opening size in points) +pub const DEFAULT_SIZE: Vec2 = vec2(1040.0, 800.0); /// The least size the window may be resized to. -pub const MIN_SIZE: Vec2 = vec2(560.0, 400.0); // design: allow[literal-size/vec2](the window's own least size in points) +pub const MIN_SIZE: Vec2 = vec2(560.0, 400.0); /// What the window keeps between passes; the host owns it and binds it with [`PreferencesWindow::new`]. #[derive(Clone, Debug, Default, PartialEq)] diff --git a/crates/ui-widgets/src/notices/notice.rs b/crates/ui-widgets/src/notices/notice.rs index 9c3bdce04..2c5f794d9 100644 --- a/crates/ui-widgets/src/notices/notice.rs +++ b/crates/ui-widgets/src/notices/notice.rs @@ -155,8 +155,6 @@ pub struct NoticeStyle { /// The icon's side and colour. #[style(icon)] icon: IconLook, - /// The width of every card, padding included, where the room allows. - card_width: f32, /// The widest column of the centred layout. reading_width: f32, } @@ -165,6 +163,9 @@ pub struct NoticeStyle { /// column in the source apps. const READING_IN_BODY_SIZES: f32 = 38.5; +/// The width of every card of a toast stack, padding included, where the room allows, in points, in every density. +const CARD_WIDTH: f32 = 360.0; + /// A message in a tone. The tone picks the icon and the colours; the neutral tone reads muted and has no icon. The /// message is the label; a title above it is optional. A centred notice can host the app's own leaves under its /// actions (a drop hint, "No recent files"). Actions read as links (as buttons in the centred layout) and @@ -541,7 +542,6 @@ impl Component for Notice<'_> { line, more, icon: IconLook::new(control.icon, stateful(tone)), - card_width: cx.tokens.size.notice.width, reading_width: cx.tokens.typography.get(TypeRole::Body).size * READING_IN_BODY_SIZES, } } @@ -554,7 +554,7 @@ impl Component for Notice<'_> { // The card is the card width wide, its padding included, where the room allows. (NoticeLayout::Card, room) => { let padding = cx.style.metrics.padding; - let width = cx.style.card_width - padding.start - padding.end; + let width = CARD_WIDTH - padding.start - padding.end; room.map_or(width, |room| width.min(room)) } (NoticeLayout::Centred, None) => natural.min(cx.style.reading_width), diff --git a/docs/craft-framework.md b/docs/craft-framework.md index 18697afe7..13a4a1d5f 100644 --- a/docs/craft-framework.md +++ b/docs/craft-framework.md @@ -440,11 +440,10 @@ An app has one layout in every theme and size. A theme never changes the layout. Use the first step that works. 1. **Density.** Compact or Comfortable. -2. **Size overrides.** The app ships a `sizes.json` that overrides base sizes (for example `size.control.md`). A base override carries to every size derived from it. To change one component, pin that component's token. Overrides stay within the validator's limits. -3. **Component tokens.** One named value changes a component app-wide. -4. **Builder options.** Options cover structural differences. A new need gets a new option, not a new component. -5. **Per-app colour overrides.** A theme file can carry a section per app. Values are theme roles or literal colours, so themes, dark mode and high contrast keep working. -6. **One-off app components.** A last resort, built from shared pieces. Allowed and not policed. +2. **Size overrides.** The app ships a `sizes.json` that overrides base sizes (for example `size.control.md`). A base override carries to every size derived from it. Overrides stay within the validator's limits. +3. **Builder options.** Options cover structural differences. A new need gets a new option, not a new component. +4. **Per-app colour overrides.** A theme file can carry a section per app. Values are theme roles or literal colours, so themes, dark mode and high contrast keep working. +5. **One-off app components.** A last resort, built from shared pieces. Allowed and not policed. ### 4.7 Themes @@ -501,9 +500,9 @@ Sizes are runtime tokens. The rule runs from the general to the specific: 1. A **scale** holds the allowed values: spacing 0, 2, 4, 6, 8, 12, 16, 20, 24, 32; radius 0, 2, 3, 4, 6, 8, 12 and full; strokes hairline, 1, 1.5, 2, 3. 2. **Semantic role tokens** pick from the scale by meaning: control height, icon size, gap, padding, radius, bar height. -3. **Components** derive their own dimensions from the role tokens in their style: a role, or a role times a ratio named in the component's style with the rule it comes from. There are no component-specific theme values. +3. **Components** take their layout sizes (heights, widths, padding, gaps between parts) from role tokens. A dimension that belongs to one component's own drawing, such as tick lengths, glyph geometry, a notch or an inset inside its art, is a named constant in the component's file with a doc comment (a ruler's `TICK_MINOR`), never a literal at the draw site. When it must follow density, the constant is a ratio of a role token (a story stage is 15 control heights tall). No theme or size-preset token exists for one component. -Components name semantic tokens and never a pixel value or shape of their own. [Appendix A](#appendix-a-component-tokens) says which component takes which role. Only drawing details (stroke widths, chevron geometry, dash lengths) stay constants. +[Appendix A](#appendix-a-component-tokens) says which component takes which role. **Semantic role tokens (pt).** @@ -686,6 +685,7 @@ How to run each locally, and which of them CI runs, is in [development.md](devel ### 8.3 Design lint - Rules: `literal-size/*`, `raw-colour/const`, `style-mutation`, `tooltip/stock`, `clippy/inner-allow`. +- `literal-size/*` flags literal sizes at a call site and names of consts with literal values, except a module- or impl-level `const` with a doc comment: that is a component constant ([5.4](#54-dimensions)), and its initializer is its definition. - Exemption marker: `// design: allow(reason)`. Empty, invalid and unused markers are findings. - Baselines and `--deny-unused` are supported. - Exit 0 clean, 1 findings, 2 error. @@ -893,7 +893,7 @@ The library replaces upstream's `craft-ui` crate, and changes public items in `c ## Appendix A. Component tokens -Maintainer reference. The rule is in [5.4 Dimensions](#54-dimensions): components name semantic tokens, and semantic tokens pick from the scale. This page lists which role each component takes. +Maintainer reference. The rule is in [5.4 Dimensions](#54-dimensions): components take their layout sizes from semantic tokens, semantic tokens pick from the scale, and a dimension of one component's own drawing is a constant in its file. This page lists which role each component takes. ### Semantic colour tokens @@ -990,7 +990,6 @@ A theme with its own shape replaces the radii or adds an offset to control, surf | `size.bar.title`, `size.bar.tab`, `size.bar.status`, `size.bar.options`, `size.bar.options_narrow` | Title bar, document tab bar, status bar, options bar | | `size.panel_header` | Panel headers | | `size.popup_min` | Least width of a popup surface (menus only; popup lists such as Select and ComboBox take their anchor's width) | -| `size.scroll_fade` | Length of the fade at an edge of a scroll region past which its content continues | | `size.groove` | Groove of a value track | | `size.ramp.bar` | Colour band: a gradient ramp drawn as a bar of its own (levels output bar, gradient thumb row) or as the face of a triangle-pointer channel slider | | `size.ramp.groove` | Gradient drawn as the groove of a value track (faced sliders) and the span between two thumbs of a gradient's thumb row | @@ -999,10 +998,8 @@ A theme with its own shape replaces the radii or adds an offset to control, surf | `size.length.number.sm`, `size.length.number.md` | Number field and the number cell over a slider, one width per control size | | `size.length.track`, `size.length.short` | Value track, short field | | `size.row.text` | A row that shows text only: one body line and `space.gap.tight`; read-only display tables take it, lists the user picks from keep control-high rows | -| `size.notice.width` | Width of a toast card where the room allows | | `size.dialog.least`, `size.dialog.wrap` | A dialog's content: the least width it opens at, and the line length its paragraphs wrap at (`LeastWidth::Dialog`, `WrapWidth::Dialog`); content that cannot wrap widens it past that | | `size.dialog.button`, `size.dialog.side_button` | Least width of a dialog's footer button and of a button in its column beside the body | -| `size.story.height`, `size.story.width_min`, `size.story.width_max` | The stage a story of a canvas control draws its canvas on: its height and the range of its width; `width_min` is also the least width of a column of a story grid | | `size.hit.edge` | The band inside the edge of a canvas's view in which a tool that autoscrolls on hover scrolls the view (a Polygonal Lasso's rubber band), at most a quarter of the view's shorter side | | `size.thumb.card` | The picture side of a tile card at zoom 1 (tile grids, preset browsers, the start screen) | | `size.thumb.sample.sm`, `size.thumb.sample.md`, `size.thumb.sample.lg` | The sample beside each thumbnail size choice in a panel's options dialog (Layers, Channels, Paths): larger than the panel's thumbnails, so the choices read apart (`PictureSize::Sample`) | @@ -1631,7 +1628,6 @@ The theme model: colour, scale and token primitives, semantic tokens, contrast r | `app_sizes` | An app's size overrides (`sizes.json`) | exists | | `builtins` | The ten built-in themes | exists | | `color`, `color_model` | sRGB, OKLab and OKLCH with gamut mapping; colour models a picker edits in; hex helpers | exists | -| `components` | Component tokens, one struct per family | exists | | `contrast` | WCAG contrast and repair | exists | | `derive`, `ramp` | Seeds to ramps to tokens; 12-step ramps | exists | | `dump`, `explain`, `report` | Token text dump, why each colour has its value, contrast sweep | exists | diff --git a/docs/porting.md b/docs/porting.md index 7bb144add..f7a03e41b 100644 --- a/docs/porting.md +++ b/docs/porting.md @@ -65,9 +65,9 @@ Before marking a part `missing component`, walk this ladder and stop at the firs 1. **An existing component as is.** Search components-index.md by purpose and by shape, and look at the component's stories in the gallery. 2. **An existing component with a new story or variant.** If the component already does the job and only lacks a shown state, add the story (authoring.md, "Stories"). A story is a state of an existing type, not a new type. -3. **A builder option on an existing component.** A structural difference gets a new option on the component, not a new component (craft-framework.md 4.6, step 4). -4. **Density, size overrides or component tokens.** Visual differences an app needs are tokens and size overrides, never component-specific theme values (craft-framework.md 4.6, steps 1–3). -5. **Per-app colour overrides** in the theme file (craft-framework.md 4.6, step 5). +3. **A builder option on an existing component.** A structural difference gets a new option on the component, not a new component (craft-framework.md 4.6, step 3). +4. **Density or size overrides.** Visual differences an app needs are tokens and size overrides, never a theme value for one component (craft-framework.md 4.6, steps 1–2). +5. **Per-app colour overrides** in the theme file (craft-framework.md 4.6, step 4). 6. **A family component** in the crate that owns the document concept, when the part names one (layer, colour model, path): craft-framework.md 4.3. 7. **A new library component**, when its inputs are general data and no existing component fits. Place it in the lowest crate of its layer (craft-framework.md 4.3). 8. **A one-off app component**, built from shared pieces, as a last resort. diff --git a/migration/api-map/canvas-core.toml b/migration/api-map/canvas-core.toml index 5529bc472..c885251da 100644 --- a/migration/api-map/canvas-core.toml +++ b/migration/api-map/canvas-core.toml @@ -152,7 +152,7 @@ name = "RulerTick" old = "craft_ui::canvas::rulers::RulerTick" new = "craft_ui::canvas::RulerTick" status = "moved" -note = "`RulerTick { value, rank: primitives::TickRank, step }`: the label text is written at paint time from `RulerText::tick_label`, and the rank is Major at a labelled step, Mid halfway between labels in an even subdivision, Minor otherwise (`primitives::ticks` draws the length by rank; the mid length is the token `size.ruler.tick.mid`)." +note = "`RulerTick { value, rank: primitives::TickRank, step }`: the label text is written at paint time from `RulerText::tick_label`, and the rank is Major at a labelled step, Mid halfway between labels in an even subdivision, Minor otherwise (`primitives::ticks` draws the length by rank; the minor and mid lengths are the constants `TICK_MINOR` and `TICK_MID` in `primitives/kit.rs`)." [[type]] name = "TickRule" From c9d84670b064883d18856b49ca41cdc97a850b8a Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 20 Nov 2026 17:39:51 +0000 Subject: [PATCH 2/5] design-lint: drop the exception entries the component-constant rule leaves stale --- design/exceptions/craft-draw/crate.toml | 8 -------- design/exceptions/craft-pages/stories.toml | 9 --------- design/exceptions/craft-print/crate.toml | 2 +- design/exceptions/craft-ui-canvas/canvas.toml | 9 --------- design/exceptions/craft-ui-contract/primitives.toml | 2 +- design/exceptions/craft-ui-patterns/preferences.toml | 9 --------- 6 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 design/exceptions/craft-pages/stories.toml delete mode 100644 design/exceptions/craft-ui-canvas/canvas.toml delete mode 100644 design/exceptions/craft-ui-patterns/preferences.toml diff --git a/design/exceptions/craft-draw/crate.toml b/design/exceptions/craft-draw/crate.toml index 74c710de8..f283a2909 100644 --- a/design/exceptions/craft-draw/crate.toml +++ b/design/exceptions/craft-draw/crate.toml @@ -7,11 +7,3 @@ rule = "raw-colour/const" path = "crates/draw/src/ui/artboard/stories.rs" reason = "The artboard background is document data in a story, not a UI colour." count = 2 - -[[exception]] -name = "convert-point-cursor-tip" -kind = "marker" -rule = "literal-size/vec2" -path = "crates/draw/src/ui/pen/anchor_tool.rs" -reason = "The cursor art's hot spot offset is in icon units, not a layout size." -count = 1 diff --git a/design/exceptions/craft-pages/stories.toml b/design/exceptions/craft-pages/stories.toml deleted file mode 100644 index 2c3c1d481..000000000 --- a/design/exceptions/craft-pages/stories.toml +++ /dev/null @@ -1,9 +0,0 @@ -config_version = 1 - -[[exception]] -name = "page-rulers-story-strip" -kind = "marker" -rule = "literal-size/vec2" -path = "crates/pages/src/ui/page_rulers/stories.rs" -reason = "The strip is the demo page margin in document points, story data." -count = 1 diff --git a/design/exceptions/craft-print/crate.toml b/design/exceptions/craft-print/crate.toml index aa4a9c243..abd78ce16 100644 --- a/design/exceptions/craft-print/crate.toml +++ b/design/exceptions/craft-print/crate.toml @@ -6,7 +6,7 @@ kind = "marker" rule = "literal-size/vec2" path = "crates/print/src/ui/dialog.rs" reason = "Printer's marks are page geometry in points, not UI sizes." -count = 4 +count = 2 [[exception]] name = "print-story-page-sizes" diff --git a/design/exceptions/craft-ui-canvas/canvas.toml b/design/exceptions/craft-ui-canvas/canvas.toml deleted file mode 100644 index 27a7d94cd..000000000 --- a/design/exceptions/craft-ui-canvas/canvas.toml +++ /dev/null @@ -1,9 +0,0 @@ -config_version = 1 - -[[exception]] -name = "view-fit-margins" -kind = "marker" -rule = "literal-size/vec2" -path = "crates/ui-canvas/src/canvas/tools.rs" -reason = "The room a view fit leaves around the document is in screen points, not a look." -count = 2 diff --git a/design/exceptions/craft-ui-contract/primitives.toml b/design/exceptions/craft-ui-contract/primitives.toml index 8c9d73b21..c4865a434 100644 --- a/design/exceptions/craft-ui-contract/primitives.toml +++ b/design/exceptions/craft-ui-contract/primitives.toml @@ -6,7 +6,7 @@ kind = "marker" rule = "literal-size/vec2" path = "crates/ui-contract/src/primitives/pointer_art.rs" reason = "Painted pointers are drawn in points around the hotspot like an OS cursor bitmap; their sides are art data, not layout sizes." -count = 2 +count = 1 [[exception]] name = "icon-fixed-layer-tint" diff --git a/design/exceptions/craft-ui-patterns/preferences.toml b/design/exceptions/craft-ui-patterns/preferences.toml deleted file mode 100644 index b1d675b49..000000000 --- a/design/exceptions/craft-ui-patterns/preferences.toml +++ /dev/null @@ -1,9 +0,0 @@ -config_version = 1 - -[[exception]] -name = "preferences-window-sizes" -kind = "marker" -rule = "literal-size/vec2" -path = "crates/ui-patterns/src/patterns/preferences/window.rs" -reason = "The window opens at and shrinks to sizes of its own, in points." -count = 2 From 48cef3fa60e2e9ecf7bff32acf0328a0c246a2ed Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 20 Nov 2026 17:42:03 +0000 Subject: [PATCH 3/5] contract-api.md: ScrollBarLook without its fade length --- docs/contract-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contract-api.md b/docs/contract-api.md index 006b1c940..276d6607d 100644 --- a/docs/contract-api.md +++ b/docs/contract-api.md @@ -3902,7 +3902,7 @@ The style layer: the state set and its resolver, style parts and `ComponentStyle - `pub fn pixels(self, pixels_per_point: f32) -> f32`. The width in whole physical pixels on a display of `pixels_per_point`. - `pub fn points(self, pixels_per_point: f32) -> f32`. The width in points on a display of `pixels_per_point`. - `craft_ui::style::ScrollBarKind`: `pub enum ScrollBarKind { Overlay, Docked }`. Where a scroll bar sits. -- `craft_ui::style::ScrollBarLook`: `pub struct ScrollBarLook { pub kind: ScrollBarKind, pub track: Stateful, pub thumb: Stateful, pub thickness: f32, pub min_thumb: f32, pub inset: f32, pub edge: Option, pub fade: f32 }`. A scroll bar's track and thumb. +- `craft_ui::style::ScrollBarLook`: `pub struct ScrollBarLook { pub kind: ScrollBarKind, pub track: Stateful, pub thumb: Stateful, pub thickness: f32, pub min_thumb: f32, pub inset: f32, pub edge: Option }`. A scroll bar's track and thumb. - `craft_ui::style::State`: re-export of `craft_theme::State` (outside these crates). - `craft_ui::style::StateMix`: re-export of `craft_theme::StateMix` (outside these crates). - `craft_ui::style::StateSet`: `pub struct StateSet { pub state: State, pub flags: Flags, pub t: StateMix }`. The state of a component or one of its parts at step 12: the interaction state, the value flags and the From d395d4f831a68be047f3a087a9e1957b90d54d69 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 20 Nov 2026 17:04:18 +0000 Subject: [PATCH 4/5] Component sets: the app's set of component looks as a root env value craft-theme gets `ComponentSet { Creative, Office }`: the app states its set in `AppDefaults::set`, the user's own choice for the app (`AppChoice::set`) overrides it, and `Selection::set` carries the result. The suite's choice never carries a set. ui-contract makes the set a style-affecting env value: `RootEnv::set` puts it in the root app values, a container overrides it for its subtree through `Overrides::values`, and windows, layers and popups take the scope's value. A component reads it in `style` with `StyleCx::set`. `Fixture::set` sets it in tests. The gallery gets a Set choice in the More popover and a Set axis in the Variants view. --- crates/theme-store/src/lib.rs | 5 +-- crates/theme-store/src/tests.rs | 3 +- crates/theme-store/src/watch/tests.rs | 3 +- crates/theme/src/lib.rs | 4 +-- crates/theme/src/selection.rs | 37 +++++++++++++++++--- crates/theme/tests/main.rs | 1 + crates/theme/tests/selection.rs | 25 +++++++++++++ crates/ui-contract/src/runtime/env/root.rs | 13 ++++++- crates/ui-contract/src/runtime/env/values.rs | 23 +++++++++++- crates/ui-contract/src/style/cx.rs | 5 +++ crates/ui-contract/src/testing/fixture.rs | 5 +++ crates/ui-gallery/src/chrome/card.rs | 5 +++ crates/ui-gallery/src/chrome/options.rs | 11 ++++-- crates/ui-gallery/src/chrome/variants.rs | 12 +++++-- crates/ui-gallery/src/viewer/appearance.rs | 9 +++-- crates/ui-gallery/src/viewer/mod.rs | 2 +- crates/ui-gallery/src/viewer/settings.rs | 6 +++- 17 files changed, 149 insertions(+), 20 deletions(-) create mode 100644 crates/theme/tests/selection.rs diff --git a/crates/theme-store/src/lib.rs b/crates/theme-store/src/lib.rs index ce039617d..9ff9fff52 100644 --- a/crates/theme-store/src/lib.rs +++ b/crates/theme-store/src/lib.rs @@ -15,7 +15,7 @@ //! `craft-theme`. //! //! ``` -//! use craft_theme::{ThemeId, AppDefaults, ModeChoice, Size, ThemePair}; +//! use craft_theme::{ThemeId, AppDefaults, ComponentSet, ModeChoice, Size, ThemePair}; //! use craft_theme_store::{SelectionChange, Store, StoreOptions, SuiteDir}; //! //! let mut store = Store::open(&SuiteDir::memory(), StoreOptions::new("doc 1.0")); @@ -30,7 +30,8 @@ //! assert_eq!((accepted.suite.theme_dark.as_ref(), accepted.suite.mode, accepted.revision), (Some(&graphite.id), None, 1)); //! //! let artcraft = ThemeId::parse("craft.artcraft").unwrap(); -//! let defaults = AppDefaults { theme: ThemePair::same(artcraft), mode: ModeChoice::Dark, size: Size::Compact, sizes: Default::default() }; +//! let defaults = +//! AppDefaults { theme: ThemePair::same(artcraft), mode: ModeChoice::Dark, size: Size::Compact, sizes: Default::default(), set: ComponentSet::Office }; //! let selection = accepted.suite.with_defaults(&defaults); //! assert_eq!((selection.theme.light, selection.mode), (graphite.id, ModeChoice::Dark)); //! ``` diff --git a/crates/theme-store/src/tests.rs b/crates/theme-store/src/tests.rs index 62a41a71a..51345c712 100644 --- a/crates/theme-store/src/tests.rs +++ b/crates/theme-store/src/tests.rs @@ -3,7 +3,7 @@ use craft_ui::testing::trial; use std::{fs, path::Path, time::Duration}; -use craft_theme::{ContrastChoice, ModeChoice, MotionChoice, Selection, Size, TextSize, ThemeId, ThemePair}; +use craft_theme::{ComponentSet, ContrastChoice, ModeChoice, MotionChoice, Selection, Size, TextSize, ThemeId, ThemePair}; use crate::{ Accepted, FileStamp, Problem, SelectionChange, SelectionError, Store, StoreError, StoreOptions, SuiteDir, @@ -31,6 +31,7 @@ fn sel(theme: &str, mode: ModeChoice) -> Selection { motion: MotionChoice::System, size: Size::Compact, text_size: TextSize::Small, + set: ComponentSet::Creative, } } diff --git a/crates/theme-store/src/watch/tests.rs b/crates/theme-store/src/watch/tests.rs index 094c505ae..2ebfd5d9f 100644 --- a/crates/theme-store/src/watch/tests.rs +++ b/crates/theme-store/src/watch/tests.rs @@ -11,7 +11,7 @@ use std::{ time::{Duration, Instant}, }; -use craft_theme::{ContrastChoice, ModeChoice, MotionChoice, Selection, Size, TextSize, ThemeId, ThemePair}; +use craft_theme::{ComponentSet, ContrastChoice, ModeChoice, MotionChoice, Selection, Size, TextSize, ThemeId, ThemePair}; use super::SuiteWatch; use crate::{Accepted, SelectionChange, Store, StoreOptions, SuiteDir}; @@ -33,6 +33,7 @@ fn sel(theme: &str, mode: ModeChoice) -> Selection { motion: MotionChoice::System, size: Size::Compact, text_size: TextSize::Small, + set: ComponentSet::Creative, } } diff --git a/crates/theme/src/lib.rs b/crates/theme/src/lib.rs index 3bed2c09f..1064277b1 100644 --- a/crates/theme/src/lib.rs +++ b/crates/theme/src/lib.rs @@ -86,8 +86,8 @@ pub use ramp::{Mode, Ramp, RampKind}; pub use resolve::{Resolved, resolve, resolve_sized}; pub use scale::{Duration, Easing, Elevation, Opacity, Radius, Space, Stroke}; pub use selection::{ - AppChoice, AppDefaults, ContrastChoice, Fallback, ModeChoice, MotionChoice, Selection, Shown, SuiteChoice, SystemAppearance, ThemePair, - resolve_selection, + AppChoice, AppDefaults, ComponentSet, ContrastChoice, Fallback, ModeChoice, MotionChoice, Selection, Shown, SuiteChoice, SystemAppearance, + ThemePair, resolve_selection, }; pub use stateful::{FlagMask, Flags, Mix, Resolve, StateMix, Stateful}; pub use theme::{ diff --git a/crates/theme/src/selection.rs b/crates/theme/src/selection.rs index 970a4f7c1..b4e77a9d5 100644 --- a/crates/theme/src/selection.rs +++ b/crates/theme/src/selection.rs @@ -1,4 +1,4 @@ -//! What the user picked (theme per mode, mode, contrast, motion, size, text size), how the suite's +//! What the user picked (theme per mode, mode, contrast, motion, size, text size, component set), how the suite's //! choice, an app's own choice and the app's defaults combine, and resolution of the result //! against what the OS reports. @@ -112,6 +112,19 @@ impl ThemePair { } } +/// The set of component looks an app shows: each component that has variants maps the set to one of them (a ruler's +/// face, for one), and every other component looks the same in each set. A component stays functionally identical +/// across sets. The app states its set ([`AppDefaults::set`]); the suite's choice never carries one. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum ComponentSet { + /// The look the creative apps' users expect. + #[default] + Creative, + /// The look the office apps' users expect. + Office, +} + /// What the user picked, every field concrete (after defaults are filled in). #[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] pub struct Selection { @@ -127,6 +140,9 @@ pub struct Selection { pub size: Size, /// The text size. pub text_size: TextSize, + /// The component set: the app's own, never the suite's. + #[serde(default)] + pub set: ComponentSet, } /// The suite's choice as `selection.json` holds it. Each field is set once a user picks it in @@ -167,6 +183,7 @@ impl SuiteChoice { motion: self.motion.unwrap_or_default(), size: self.size.unwrap_or(defaults.size), text_size: self.text_size.unwrap_or_default(), + set: defaults.set, } } @@ -210,6 +227,8 @@ pub struct AppDefaults { /// The app's own sizes: base overrides and component pins, applied to whichever size set is /// chosen. pub sizes: AppSizes, + /// The component set the app shows when the user hasn't chosen one for it. + pub set: ComponentSet, } /// An app's own choice, kept in the app's preferences: "Use a different theme / mode / size in @@ -226,12 +245,15 @@ pub struct AppChoice { pub mode: Option, /// The app's own size set. pub size: Option, + /// The app's own component set. No user-visible choice sets it yet. + #[serde(default)] + pub set: Option, } impl AppChoice { - /// A choice with all three fields given. + /// A choice of theme, mode and size; the component set follows the app's default. pub const fn new(theme: Option, mode: Option, size: Option) -> Self { - Self { theme, mode, size } + Self { theme, mode, size, set: None } } /// This choice with the app's own mode. @@ -246,12 +268,19 @@ impl AppChoice { self } - /// `suite` with this app's theme, mode and size where set. + /// This choice with the app's own component set. + pub fn with_set(mut self, set: ComponentSet) -> Self { + self.set = Some(set); + self + } + + /// `suite` with this app's theme, mode, size and component set where set. pub fn apply(&self, suite: &Selection) -> Selection { Selection { theme: self.theme.clone().unwrap_or_else(|| suite.theme.clone()), mode: self.mode.unwrap_or(suite.mode), size: self.size.unwrap_or(suite.size), + set: self.set.unwrap_or(suite.set), ..suite.clone() } } diff --git a/crates/theme/tests/main.rs b/crates/theme/tests/main.rs index 6eea01a7d..93a7bd1fa 100644 --- a/crates/theme/tests/main.rs +++ b/crates/theme/tests/main.rs @@ -1,3 +1,4 @@ //! Integration tests, built into the library's own test executable. mod dumps; +mod selection; diff --git a/crates/theme/tests/selection.rs b/crates/theme/tests/selection.rs new file mode 100644 index 000000000..6dacfc927 --- /dev/null +++ b/crates/theme/tests/selection.rs @@ -0,0 +1,25 @@ +//! The component set: the app states it, the user's own choice for the app overrides it, and the suite's choice never +//! carries it. + +use craft_theme::{AppChoice, AppDefaults, ComponentSet, ModeChoice, Size, SuiteChoice, ThemeId, ThemePair}; + +#[test] +fn the_component_set_is_the_apps_unless_the_user_chose_one_for_it_and_never_the_suites() { + let defaults = AppDefaults { + theme: ThemePair::same(ThemeId::suite_default()), + mode: ModeChoice::Light, + size: Size::Comfortable, + sizes: Default::default(), + set: ComponentSet::Office, + }; + let suite = SuiteChoice::default().with_defaults(&defaults); + assert_eq!(suite.set, ComponentSet::Office, "a fresh install shows the app's set"); + let follows = AppChoice::new(None, None, None).apply(&suite); + assert_eq!(follows.set, ComponentSet::Office, "an app choice without a set keeps the app's"); + let own = AppChoice::new(None, None, None).with_set(ComponentSet::Creative).apply(&suite); + assert_eq!(own.set, ComponentSet::Creative, "the user's set for the app wins"); + let stored: AppChoice = serde_json::from_str(r#"{"theme":null,"mode":null,"size":null}"#).expect("a stored choice without a set reads"); + assert_eq!(stored.apply(&suite).set, ComponentSet::Office); + let shared = SuiteChoice::from(own); + assert_eq!(shared.with_defaults(&defaults).set, ComponentSet::Office, "the suite's choice carries no set to other apps"); +} diff --git a/crates/ui-contract/src/runtime/env/root.rs b/crates/ui-contract/src/runtime/env/root.rs index d2433b696..23fc27c0b 100644 --- a/crates/ui-contract/src/runtime/env/root.rs +++ b/crates/ui-contract/src/runtime/env/root.rs @@ -8,7 +8,7 @@ use craft_behavior::MotionMode; use craft_i18n::CalendarDate; use craft_i18n::Direction; use craft_theme::{ - AppSizes, Appearance, Contrast, ContrastChoice, Mode, ModeChoice, MotionChoice, Size, SystemAppearance, TextSize, ThemeDef, ThemeId, + AppSizes, Appearance, ComponentSet, Contrast, ContrastChoice, Mode, ModeChoice, MotionChoice, Size, SystemAppearance, TextSize, ThemeDef, ThemeId, }; use egui::Context; use std::sync::Arc; @@ -198,6 +198,17 @@ impl RootEnv { self } + /// Sets the component set (`Selection::set`): a root app value, so a container can set another for its subtree. + pub fn set(mut self, set: ComponentSet) -> Self { + self.values.set(set); + self + } + + /// The component set the root's values carry. + pub fn component_set(&self) -> ComponentSet { + self.values.get::() + } + /// Sets today's date, as the host's clock and time zone give it. pub fn today(mut self, date: CalendarDate) -> Self { self.today = Some(date); diff --git a/crates/ui-contract/src/runtime/env/values.rs b/crates/ui-contract/src/runtime/env/values.rs index 2a461ae2b..52591cf9a 100644 --- a/crates/ui-contract/src/runtime/env/values.rs +++ b/crates/ui-contract/src/runtime/env/values.rs @@ -1,4 +1,4 @@ -//! The library values the env carries: scale, motion policy and arena id. +//! The library values the env carries: scale, motion policy, arena id and the component set. use super::EnvValue; use craft_behavior::{ColumnKey, MotionMode}; @@ -140,6 +140,27 @@ impl EnvValue for InBar { } } +/// The component set: an app sets it on its root (`RootEnv::set`) and a container may set another for its subtree +/// (`Overrides::values`); every window, layer and popup opened inside takes the scope's. A component with variants +/// reads it in `style` (`StyleCx::set`) and maps it to one of them. It is in the style key, so a change restyles as a +/// theme or density change does. +impl EnvValue for craft_theme::ComponentSet { + const AFFECTS_STYLE: bool = true; + + fn root() -> Self { + craft_theme::ComponentSet::default() + } + + fn style_hash(&self) -> Option { + use std::hash::Hasher as _; + let mut hasher = std::collections::hash_map::DefaultHasher::new(); + self.hash(&mut hasher); + Some(hasher.finish()) + } +} + +impl super::StyleValue for craft_theme::ComponentSet {} + /// Where a shell pane sits. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] #[non_exhaustive] diff --git a/crates/ui-contract/src/style/cx.rs b/crates/ui-contract/src/style/cx.rs index db46b47fc..d82c9f33b 100644 --- a/crates/ui-contract/src/style/cx.rs +++ b/crates/ui-contract/src/style/cx.rs @@ -136,6 +136,11 @@ impl<'a> StyleCx<'a> { self.tokens.density() } + /// The component set of the scope, for a component that maps it to one of its named variants. + pub fn set(&self) -> craft_theme::ComponentSet { + self.env::() + } + /// A style context for the scope the pipeline or an app colour hook runs in. #[expect(clippy::too_many_arguments, reason = "one argument per input the style cache key covers")] #[doc(hidden)] diff --git a/crates/ui-contract/src/testing/fixture.rs b/crates/ui-contract/src/testing/fixture.rs index b2165c890..52ef2f8ac 100644 --- a/crates/ui-contract/src/testing/fixture.rs +++ b/crates/ui-contract/src/testing/fixture.rs @@ -343,6 +343,11 @@ impl Fixture { self.set_root(|root| root.density = density) } + /// The component set. + pub fn set(&mut self, set: craft_theme::ComponentSet) -> &mut Self { + self.root_value(set) + } + /// The interface scale. pub fn scale(&mut self, scale: Scale) -> &mut Self { self.set_root(|root| root.scale = scale) diff --git a/crates/ui-gallery/src/chrome/card.rs b/crates/ui-gallery/src/chrome/card.rs index ced8c50c8..a4e6917af 100644 --- a/crates/ui-gallery/src/chrome/card.rs +++ b/crates/ui-gallery/src/chrome/card.rs @@ -53,6 +53,8 @@ pub struct Look { pub direction: Option, /// The control size. pub size: Option, + /// The component set. + pub set: Option, } /// One story a card shows. @@ -434,6 +436,9 @@ impl Host<'_> { env.direction = look.direction; env.size = look.size; env.wheel = gated.then_some(craft_ui::runtime::env::WheelScope::Gated); + if let Some(set) = look.set { + env.values.set(set); + } }, |ui| match region { Some(key) => inspect::record(ui, key, |ui| show(ui, data)), diff --git a/crates/ui-gallery/src/chrome/options.rs b/crates/ui-gallery/src/chrome/options.rs index 5006b1a5a..1c75cfce6 100644 --- a/crates/ui-gallery/src/chrome/options.rs +++ b/crates/ui-gallery/src/chrome/options.rs @@ -2,7 +2,8 @@ //! layout and the workspace switch at the end. use crate::viewer::{ - CONTRASTS, DENSITIES, DIRECTIONS, GalleryCommands, MODES, MOTIONS, Preview, SCALES, TEXT_SIZES, VariantAxis, Viewer, Workspace, theme_entries, + CONTRASTS, DENSITIES, DIRECTIONS, GalleryCommands, MODES, MOTIONS, Preview, SCALES, SETS, TEXT_SIZES, VariantAxis, Viewer, Workspace, + theme_entries, }; use craft_behavior::{IconId, Value}; use craft_ui::bars::{Bar, BarKind}; @@ -40,15 +41,21 @@ fn line(ui: &mut Ui, mut add: impl FnMut(&mut Ui)) { fn more_form(ui: &mut Ui, viewer: &mut Viewer) { let env = &mut viewer.env; let (contrasts, densities, motions) = (CONTRASTS.entries(), DENSITIES.entries(), MOTIONS.entries()); - let (directions, text_sizes, scales) = (DIRECTIONS.entries(), TEXT_SIZES.entries(), SCALES.entries()); + let (directions, text_sizes, scales, sets) = (DIRECTIONS.entries(), TEXT_SIZES.entries(), SCALES.entries(), SETS.entries()); + // The set is a root app value, not a field of the root. + let mut set = env.component_set(); Stack::new().show(ui, |ui, _| { line(ui, |ui| choose(ui, "Contrast", &mut env.contrast, &contrasts)); line(ui, |ui| choose(ui, "Size", &mut env.density, &densities)); + line(ui, |ui| choose(ui, "Set", &mut set, &sets)); line(ui, |ui| choose(ui, "Reduced motion", &mut env.motion, &motions)); line(ui, |ui| choose(ui, "Direction", &mut env.direction, &directions)); line(ui, |ui| choose(ui, "Text", &mut env.text_size, &text_sizes)); line(ui, |ui| pick(ui, "Scale", &mut env.scale, &scales)); }); + if set != env.component_set() { + env.values.set(set); + } } /// The Variants toggle and its menu of axes: the toggle shows whether a Variants view is open, and a press opens the diff --git a/crates/ui-gallery/src/chrome/variants.rs b/crates/ui-gallery/src/chrome/variants.rs index a4eded1ca..d6d7b67ce 100644 --- a/crates/ui-gallery/src/chrome/variants.rs +++ b/crates/ui-gallery/src/chrome/variants.rs @@ -4,7 +4,7 @@ use super::card::Look; use super::overview::{Spec, SpecStory, apply, grid, on_background, selected_type, target_story}; use super::panels::Panels; -use crate::viewer::{DIRECTIONS, MODES, PanelId, VariantAxis, entry_of}; +use crate::viewer::{DIRECTIONS, MODES, PanelId, SETS, VariantAxis, entry_of}; use craft_i18n::Direction; use craft_theme::variant::Tone; use craft_theme::{ControlSize, Mode, ModeChoice}; @@ -29,6 +29,7 @@ fn noun(axis: VariantAxis) -> &'static str { VariantAxis::Mode => "mode", VariantAxis::Contrast => "contrast", VariantAxis::Size => "size", + VariantAxis::Set => "set", VariantAxis::Direction => "direction", VariantAxis::ControlSize => "control size", VariantAxis::DirectionAndControlSize => "direction and control size", @@ -65,6 +66,9 @@ fn values(axis: VariantAxis) -> Option> { .map(|choice| Value { label: choice.label, look: Look { direction: direction(choice.value), ..Look::default() } }) .collect(), ), + VariantAxis::Set => { + Some(SETS.0.iter().map(|choice| Value { label: choice.label, look: Look { set: Some(choice.value), ..Look::default() } }).collect()) + } VariantAxis::ControlSize => { Some(sizes.iter().map(|(size, label)| Value { label, look: Look { size: Some(*size), ..Look::default() } }).collect()) } @@ -122,10 +126,11 @@ pub(super) fn show(ui: &mut Ui, p: &mut Panels<'_>, tab: PanelId) -> bool { let cards: Vec = match (target, values(axis)) { (Some((type_name, index)), Some(values)) => { let Some(entry) = entry_of(type_name) else { return false }; - let (mode, direction) = (p.env.appearance(ui.ctx()).mode, p.env.direction); + let (mode, direction, set) = (p.env.appearance(ui.ctx()).mode, p.env.direction, p.env.component_set()); let shown = |look: &Look| match axis { VariantAxis::Mode => look.mode == Some(mode), VariantAxis::Direction => look.direction == Some(direction), + VariantAxis::Set => look.set == Some(set), _ => false, }; values @@ -180,6 +185,9 @@ pub(super) fn show(ui: &mut Ui, p: &mut Panels<'_>, tab: PanelId) -> bool { if let Some(direction) = card.look.direction { p.env.direction = direction; } + if let Some(set) = card.look.set { + p.env.values.set(set); + } closed = true; } if closed { diff --git a/crates/ui-gallery/src/viewer/appearance.rs b/crates/ui-gallery/src/viewer/appearance.rs index 18469bec1..6b433e7df 100644 --- a/crates/ui-gallery/src/viewer/appearance.rs +++ b/crates/ui-gallery/src/viewer/appearance.rs @@ -1,7 +1,7 @@ //! The choices of the options bar: the named options of each root value, the theme list and the Variants axes. use craft_i18n::Direction; -use craft_theme::{ContrastChoice, ModeChoice, MotionChoice, Size, TextSize, ThemeDef, ThemeId, builtins}; +use craft_theme::{ComponentSet, ContrastChoice, ModeChoice, MotionChoice, Size, TextSize, ThemeDef, ThemeId, builtins}; use craft_ui::contract::Entry; use craft_ui::runtime::env::Scale; @@ -66,6 +66,7 @@ choices!(TEXT_SIZES: TextSize = [ (TextSize::Large, "large", "Large"), ]); choices!(DENSITIES: Size = [(Size::Compact, "compact", "Compact"), (Size::Comfortable, "comfortable", "Comfortable")]); +choices!(SETS: ComponentSet = [(ComponentSet::Creative, "creative", "Creative"), (ComponentSet::Office, "office", "Office")]); choices!(MOTIONS: MotionChoice = [ (MotionChoice::Full, "full", "Off"), (MotionChoice::Reduced, "reduced", "On"), @@ -91,6 +92,8 @@ pub enum VariantAxis { Contrast, /// Compact and comfortable density. Size, + /// The creative and the office component set. + Set, /// Left to right and right to left. Direction, /// Small and medium controls. @@ -101,11 +104,12 @@ pub enum VariantAxis { impl VariantAxis { /// Every axis, in menu order. - pub const ALL: [VariantAxis; 7] = [ + pub const ALL: [VariantAxis; 8] = [ VariantAxis::Theme, VariantAxis::Mode, VariantAxis::Contrast, VariantAxis::Size, + VariantAxis::Set, VariantAxis::Direction, VariantAxis::ControlSize, VariantAxis::DirectionAndControlSize, @@ -118,6 +122,7 @@ impl VariantAxis { VariantAxis::Mode => "Every mode (light, dark)", VariantAxis::Contrast => "Every contrast (standard, high)", VariantAxis::Size => "Every size (compact, comfortable)", + VariantAxis::Set => "Every set (creative, office)", VariantAxis::Direction => "Every direction (LTR, RTL)", VariantAxis::ControlSize => "Every control size (Sm, Md)", VariantAxis::DirectionAndControlSize => "Every direction and control size", diff --git a/crates/ui-gallery/src/viewer/mod.rs b/crates/ui-gallery/src/viewer/mod.rs index 642bf13a7..160bde8ed 100644 --- a/crates/ui-gallery/src/viewer/mod.rs +++ b/crates/ui-gallery/src/viewer/mod.rs @@ -10,7 +10,7 @@ mod state; mod tree; pub use appearance::{ - CONTRASTS, Choice, Choices, DENSITIES, DIRECTIONS, MODES, MOTIONS, SCALES, TEXT_SIZES, VariantAxis, theme_entries, theme_named, theme_of, + CONTRASTS, Choice, Choices, DENSITIES, DIRECTIONS, MODES, MOTIONS, SCALES, SETS, TEXT_SIZES, VariantAxis, theme_entries, theme_named, theme_of, }; pub use catalog::{Catalog, ComponentInfo, Declared, Entry, StoryGroup, display_name}; pub use commands::GalleryCommands; diff --git a/crates/ui-gallery/src/viewer/settings.rs b/crates/ui-gallery/src/viewer/settings.rs index b213a437b..a23d264d4 100644 --- a/crates/ui-gallery/src/viewer/settings.rs +++ b/crates/ui-gallery/src/viewer/settings.rs @@ -1,6 +1,6 @@ //! What the viewer keeps between runs, in the gallery's own `config.toml`. -use super::appearance::{CONTRASTS, DENSITIES, DIRECTIONS, MODES, MOTIONS, SCALES, TEXT_SIZES, theme_named}; +use super::appearance::{CONTRASTS, DENSITIES, DIRECTIONS, MODES, MOTIONS, SCALES, SETS, TEXT_SIZES, theme_named}; use super::catalog::Catalog; use super::layout; use super::state::{Preview, Viewer, Workspace}; @@ -25,6 +25,8 @@ pub struct GallerySettings { pub text_size: String, /// The density preset. pub density: String, + /// The component set. + pub set: String, /// The motion mode. pub motion: String, /// The interface scale in percent. @@ -68,6 +70,7 @@ impl GallerySettings { contrast: CONTRASTS.name(env.contrast).to_owned(), text_size: TEXT_SIZES.name(env.text_size).to_owned(), density: DENSITIES.name(env.density).to_owned(), + set: SETS.name(env.component_set()).to_owned(), motion: MOTIONS.name(env.motion).to_owned(), scale: SCALES.name(env.scale).to_owned(), direction: DIRECTIONS.name(env.direction).to_owned(), @@ -91,6 +94,7 @@ impl GallerySettings { env.contrast = CONTRASTS.parse(&self.contrast).unwrap_or(default.contrast); env.text_size = TEXT_SIZES.parse(&self.text_size).unwrap_or(default.text_size); env.density = DENSITIES.parse(&self.density).unwrap_or(default.density); + env.values.set(SETS.parse(&self.set).unwrap_or(default.component_set())); env.motion = MOTIONS.parse(&self.motion).unwrap_or(default.motion); env.scale = SCALES.parse(&self.scale).unwrap_or(default.scale); env.direction = DIRECTIONS.parse(&self.direction).unwrap_or(default.direction); From 3f9adf355dc768fd2466c22775df6ae35068fec3 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 20 Nov 2026 17:04:18 +0000 Subject: [PATCH 5/5] Rulers: an edge and a centred face, picked by the component set `RulerFace { Edge, Centred }` sits beside `TickEdge`, and `RulerFace::of(set)` maps the creative set to Edge and the office set to Centred. The shared tick painter takes the face. Centred draws a bar inset in the strip by `space.gap.tight`, centres the marks on it, and puts a number in place of each whole-unit mark. No mark runs under a number (`RulerFace::beside_numbers`), so a whole-unit tick shows only where its number is dropped. TextRuler, VerticalRuler and canvas Rulers take an optional `face` prop in their style key. Unset, the style resolves it from the scope's set. PageRulers passes its face to both of its rulers, and the timeline ruler keeps the edge face. Under Centred: - the strip is on the chrome surface and the bar carries the margin shade and the text column on the well; - numbers show only over the text area and are dropped where a marker stands; - canvas Rulers shade their margin bands as the text ruler does. Edge is the look the rulers had before. Each ruler gets an edge and a centred story. --- crates/design-lint/src/workspace.rs | 1 + crates/pages/src/ui/page_rulers.rs | 98 +++++++++---- crates/pages/src/ui/page_rulers/stories.rs | 46 ++++++- crates/text/src/ui/ruler.rs | 18 ++- crates/text/src/ui/ruler/paint.rs | 69 ++++++---- crates/text/src/ui/ruler/stories.rs | 29 +++- crates/text/tests/it/ruler.rs | 130 ++++++++++++++++++ crates/timeline/src/ui/ruler.rs | 4 +- crates/ui-canvas/src/canvas/rulers/mod.rs | 130 +++++++++++++----- crates/ui-canvas/src/canvas/rulers/stories.rs | 35 ++++- crates/ui-contract/src/primitives/kit.rs | 116 ++++++++++++++-- crates/ui-contract/src/primitives/mod.rs | 4 +- 12 files changed, 567 insertions(+), 113 deletions(-) diff --git a/crates/design-lint/src/workspace.rs b/crates/design-lint/src/workspace.rs index 2475ff7b7..5e6a187c9 100644 --- a/crates/design-lint/src/workspace.rs +++ b/crates/design-lint/src/workspace.rs @@ -58,6 +58,7 @@ const CLOSED: &[&str] = &[ "ReorderMove", // built or matched in craft-ui-patterns "RowState", // built or matched in craft-ui-widgets "RuleLook", // built or matched in craft-ui-canvas + "RulerFace", // matched by every ruler (craft-text, craft-pages, craft-ui-canvas): a new face must be drawn by each "ShellRegions", // built or matched in craft-ui-shell "SizeLimits", // built or matched in craft-ui-panels "StoryOutput", // built or matched in craft-ui-widgets diff --git a/crates/pages/src/ui/page_rulers.rs b/crates/pages/src/ui/page_rulers.rs index e19df84a0..ea8be6eb3 100644 --- a/crates/pages/src/ui/page_rulers.rs +++ b/crates/pages/src/ui/page_rulers.rs @@ -17,7 +17,7 @@ use craft_ui::contract::{ Access, Bind, Common, Component, Cx, Focus as _, IdSource, Input, MeasureCx, Name, NoValue, Numeric, Outcome, PaintUi, PartsCx, Pointer as _, Props as _, Remember as _, Role, Show as _, Styled as _, WordSetCx as _, }; -use craft_ui::primitives::{PaintShape, StrokeWidth, TextRun, Tick, TickEdge, TickRank}; +use craft_ui::primitives::{PaintShape, RulerFace, StrokeWidth, TextRun, Tick, TickEdge, TickRank}; use craft_ui::runtime::env::{Env, Label}; use craft_ui::runtime::focus::{ActivateKeys, FocusShape, KeyUse}; use craft_ui::style::{ComponentStyle, FocusLook, StyleColor, StyleCx, TextLook, TypeRole}; @@ -80,6 +80,10 @@ pub struct VerticalRulerStyle { metrics: Metrics, #[style(focus)] focus: FocusLook, + /// The face: the prop's, else the component set's. + face: RulerFace, + /// The strip round the centred face's bar. + strip: StyleColor, /// The text range. fill: StyleColor, /// The margins above and below it. @@ -113,6 +117,9 @@ struct Held(Option<(usize, f32)>); /// shaded as margin and the text range filled, and a drag of a grip is one gesture. /// /// - Ticks and numbers count from the page's top in the unit, through the canvas rulers' tick rule. +/// - The face ([`RulerFace`]) is the prop's, else the component set's: the edge face hangs the ticks from the strip's +/// inner edge with each number below its whole-unit tick; the centred face (Word's) draws a bar inset in the strip +/// with the ticks centred on it and the numbers in place of the whole-unit ticks, over the text range only. /// - A grip drag reports a [`RowDrag`]: Begin, Update per move, Commit on release, Cancel on Escape. It snaps to the /// ruler's step; Alt reports in `mods` that the drag is free of the snap and the position is not snapped. /// - The grips are one Tab stop: Page Down and Page Up pick the next or previous grip, the arrows nudge the focused one @@ -133,13 +140,17 @@ pub struct VerticalRuler<'a> { /// The table row bottoms, points from the page's top, each a grip. #[prop] rows: &'a [f32], + /// The face; unset, the scope's component set picks it ([`RulerFace::of`]). + #[style_key] + #[prop] + face: Option, report: Option, } impl<'a> VerticalRuler<'a> { /// The ruler named `label` along `page`. pub fn new(label: impl Into