From 7fcd160ecad5be335d8ec97070f119720be0c031 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 12 Nov 2026 10:08:05 +0000 Subject: [PATCH] Field and number widths per control size: size.length.field and size.length.number hold sm and md, and controls read them through ControlMetrics, so a field in a small options bar is narrower than one in a dialog --- crates/behavior/src/sizing.rs | 28 +++++++++++++--- crates/review/src/ui/chat.rs | 2 +- crates/table/src/ui/grid/stories.rs | 4 +-- crates/theme/sizes/comfortable.json | 10 ++++-- crates/theme/sizes/compact.json | 10 ++++-- crates/theme/src/dump.rs | 6 ++-- crates/theme/src/format/sizes.rs | 2 ++ crates/theme/src/sizes.rs | 6 ++-- crates/theme/src/tokens/size.rs | 11 ++++--- .../tokens/adwaita-dark-high-comfortable.txt | 6 ++-- .../tokens/adwaita-dark-high-compact.txt | 6 ++-- .../adwaita-dark-standard-comfortable.txt | 6 ++-- .../tokens/adwaita-dark-standard-compact.txt | 6 ++-- .../tokens/adwaita-light-high-comfortable.txt | 6 ++-- .../tokens/adwaita-light-high-compact.txt | 6 ++-- .../adwaita-light-standard-comfortable.txt | 6 ++-- .../tokens/adwaita-light-standard-compact.txt | 6 ++-- .../tokens/artcraft-dark-high-comfortable.txt | 6 ++-- .../tokens/artcraft-dark-high-compact.txt | 6 ++-- .../artcraft-dark-standard-comfortable.txt | 6 ++-- .../tokens/artcraft-dark-standard-compact.txt | 6 ++-- .../artcraft-light-high-comfortable.txt | 6 ++-- .../tokens/artcraft-light-high-compact.txt | 6 ++-- .../artcraft-light-standard-comfortable.txt | 6 ++-- .../artcraft-light-standard-compact.txt | 6 ++-- .../tokens/breeze-dark-high-comfortable.txt | 6 ++-- .../dumps/tokens/breeze-dark-high-compact.txt | 6 ++-- .../breeze-dark-standard-comfortable.txt | 6 ++-- .../tokens/breeze-dark-standard-compact.txt | 6 ++-- .../tokens/breeze-light-high-comfortable.txt | 6 ++-- .../tokens/breeze-light-high-compact.txt | 6 ++-- .../breeze-light-standard-comfortable.txt | 6 ++-- .../tokens/breeze-light-standard-compact.txt | 6 ++-- .../tokens/classic-light-high-comfortable.txt | 6 ++-- .../tokens/classic-light-high-compact.txt | 6 ++-- .../classic-light-standard-comfortable.txt | 6 ++-- .../tokens/classic-light-standard-compact.txt | 6 ++-- .../tokens/graphite-dark-high-comfortable.txt | 6 ++-- .../tokens/graphite-dark-high-compact.txt | 6 ++-- .../graphite-dark-standard-comfortable.txt | 6 ++-- .../tokens/graphite-dark-standard-compact.txt | 6 ++-- .../graphite-light-high-comfortable.txt | 6 ++-- .../tokens/graphite-light-high-compact.txt | 6 ++-- .../graphite-light-standard-comfortable.txt | 6 ++-- .../graphite-light-standard-compact.txt | 6 ++-- .../tokens/pro-dark-high-comfortable.txt | 6 ++-- .../dumps/tokens/pro-dark-high-compact.txt | 6 ++-- ...ro-dark-standard-comfortable-app-sizes.txt | 6 ++-- .../tokens/pro-dark-standard-comfortable.txt | 6 ++-- .../tokens/pro-dark-standard-compact.txt | 6 ++-- .../pro-light-gray-light-high-comfortable.txt | 6 ++-- .../pro-light-gray-light-high-compact.txt | 6 ++-- ...-light-gray-light-standard-comfortable.txt | 6 ++-- .../pro-light-gray-light-standard-compact.txt | 6 ++-- .../tokens/pro-light-high-comfortable.txt | 6 ++-- .../dumps/tokens/pro-light-high-compact.txt | 6 ++-- .../tokens/pro-light-standard-comfortable.txt | 6 ++-- .../tokens/pro-light-standard-compact.txt | 6 ++-- .../tokens/soft-dark-high-comfortable.txt | 6 ++-- .../dumps/tokens/soft-dark-high-compact.txt | 6 ++-- .../tokens/soft-dark-standard-comfortable.txt | 6 ++-- .../tokens/soft-dark-standard-compact.txt | 6 ++-- .../tokens/soft-light-high-comfortable.txt | 6 ++-- .../dumps/tokens/soft-light-high-compact.txt | 6 ++-- .../soft-light-standard-comfortable.txt | 6 ++-- .../tokens/soft-light-standard-compact.txt | 6 ++-- .../solarized-dark-dark-high-comfortable.txt | 6 ++-- .../solarized-dark-dark-high-compact.txt | 6 ++-- ...larized-dark-dark-standard-comfortable.txt | 6 ++-- .../solarized-dark-dark-standard-compact.txt | 6 ++-- .../tokens/studio-dark-high-comfortable.txt | 6 ++-- .../dumps/tokens/studio-dark-high-compact.txt | 6 ++-- .../studio-dark-standard-comfortable.txt | 6 ++-- .../tokens/studio-dark-standard-compact.txt | 6 ++-- .../tokens/studio-light-high-comfortable.txt | 6 ++-- .../tokens/studio-light-high-compact.txt | 6 ++-- .../studio-light-standard-comfortable.txt | 6 ++-- .../tokens/studio-light-standard-compact.txt | 6 ++-- .../ui-contract/src/contract/label/place.rs | 2 +- .../ui-contract/src/contract/label/props.rs | 4 +-- crates/ui-contract/src/runtime/env.rs | 2 +- crates/ui-contract/src/runtime/env/view.rs | 2 +- crates/ui-contract/src/style/cx.rs | 6 ++-- .../src/patterns/dock/panes/stories.rs | 4 +-- crates/ui-widgets/src/bars/breadcrumb.rs | 2 +- crates/ui-widgets/src/form/slider_field.rs | 4 +-- crates/ui-widgets/src/pickers/unit_select.rs | 3 +- crates/ui-widgets/src/text/mod.rs | 6 ++-- crates/ui-widgets/src/text/number.rs | 5 ++- crates/ui-widgets/tests/it/text/mod.rs | 1 + crates/ui-widgets/tests/it/text/widths.rs | 32 +++++++++++++++++++ docs/craft-framework.md | 6 ++-- 92 files changed, 395 insertions(+), 177 deletions(-) create mode 100644 crates/ui-widgets/tests/it/text/widths.rs diff --git a/crates/behavior/src/sizing.rs b/crates/behavior/src/sizing.rs index 393fab0e1..ec913f7a7 100644 --- a/crates/behavior/src/sizing.rs +++ b/crates/behavior/src/sizing.rs @@ -100,7 +100,8 @@ impl Metrics { } } -/// The sizes a control takes from its `ControlSize`: height, icon side, horizontal padding and gap. +/// The sizes a control takes from its `ControlSize`: height, icon side, horizontal padding, gap and the widths of a +/// field and a number field. #[derive(Clone, Copy, Debug, Default, PartialEq)] #[non_exhaustive] pub struct ControlMetrics { @@ -112,12 +113,31 @@ pub struct ControlMetrics { pub pad_x: f32, /// The gap between content parts. pub gap: f32, + /// The width of a text or value field where the room allows. + pub field: f32, + /// The width of a number field. + pub number: f32, } impl ControlMetrics { - /// The entries of the four tables at `size`. - pub fn at(size: ControlSize, height: &BySize, icon: &BySize, pad_x: &BySize, gap: &BySize) -> Self { - ControlMetrics { height: height.get(size), icon: icon.get(size), pad_x: pad_x.get(size), gap: gap.get(size) } + /// The entries of the six tables at `size`. + pub fn at( + size: ControlSize, + height: &BySize, + icon: &BySize, + pad_x: &BySize, + gap: &BySize, + field: &BySize, + number: &BySize, + ) -> Self { + ControlMetrics { + height: height.get(size), + icon: icon.get(size), + pad_x: pad_x.get(size), + gap: gap.get(size), + field: field.get(size), + number: number.get(size), + } } /// The `Metrics` of a control of this height: horizontal padding, the height as the least height, the gap. diff --git a/crates/review/src/ui/chat.rs b/crates/review/src/ui/chat.rs index 7d8f5d9e1..5afeb7313 100644 --- a/crates/review/src/ui/chat.rs +++ b/crates/review/src/ui/chat.rs @@ -56,7 +56,7 @@ impl BubbleLook { gap: tokens.space.gap.tight, radius: tokens.shape.radius.surface.round().clamp(0.0, 255.0) as u8, offset: Vec2::new(tokens.size.pointer_tip.x, tokens.size.pointer_tip.y), - width: tokens.size.length.field, + width: control.field, body: (body.size, body.line_height), caption: (caption.size, caption.line_height), } diff --git a/crates/table/src/ui/grid/stories.rs b/crates/table/src/ui/grid/stories.rs index 58c95edbb..2f24aa99c 100644 --- a/crates/table/src/ui/grid/stories.rs +++ b/crates/table/src/ui/grid/stories.rs @@ -83,7 +83,7 @@ impl StorySheet { } StorySheet { rows: LineIndex::new(&BTreeMap::new(), size.control.sm, SALES_ROWS), - columns: LineIndex::new(&BTreeMap::from([(WIDE_COLUMN, size.length.short)]), size.length.number, SALES_COLUMNS), + columns: LineIndex::new(&BTreeMap::from([(WIDE_COLUMN, size.length.short)]), size.length.number.md, SALES_COLUMNS), merges: Vec::new(), frozen: (1, 0), cells, @@ -102,7 +102,7 @@ impl StorySheet { .collect::>(); let mut sheet = StorySheet { rows: LineIndex::new(&BTreeMap::new(), size.control.sm, rows), - columns: LineIndex::new(&hidden, size.length.number, SHEET_COLUMNS), + columns: LineIndex::new(&hidden, size.length.number.md, SHEET_COLUMNS), merges: if rows > 3 { vec![CellRange::cells(CellAt::new(2, 1), CellAt::new(3, 2))] } else { Vec::new() }, frozen: (rows.min(1), 1), cells, diff --git a/crates/theme/sizes/comfortable.json b/crates/theme/sizes/comfortable.json index 07b7a49fd..2f96542b1 100644 --- a/crates/theme/sizes/comfortable.json +++ b/crates/theme/sizes/comfortable.json @@ -52,8 +52,14 @@ "sm": 14.0 }, "length": { - "field": 240.0, - "number": 90.0, + "field": { + "md": 240.0, + "sm": 192.0 + }, + "number": { + "md": 90.0, + "sm": 72.0 + }, "short": 120.0, "track": 144.0 }, diff --git a/crates/theme/sizes/compact.json b/crates/theme/sizes/compact.json index 42a4a1d11..bf9724ba6 100644 --- a/crates/theme/sizes/compact.json +++ b/crates/theme/sizes/compact.json @@ -52,8 +52,14 @@ "sm": 12.0 }, "length": { - "field": 192.0, - "number": 72.0, + "field": { + "md": 192.0, + "sm": 160.0 + }, + "number": { + "md": 72.0, + "sm": 60.0 + }, "short": 96.0, "track": 128.0 }, diff --git a/crates/theme/src/dump.rs b/crates/theme/src/dump.rs index b828337fb..dd78c86e6 100644 --- a/crates/theme/src/dump.rs +++ b/crates/theme/src/dump.rs @@ -168,10 +168,12 @@ fn size_lines(out: &mut Lines, size: &SizeTokens) { out.line("size.plot.width", len(*width)); out.line("size.plot.height", len(*height)); let LengthSizes { field, track, short, number } = length; - out.line("size.length.field", len(*field)); + out.line("size.length.field.sm", len(field.sm)); + out.line("size.length.field.md", len(field.md)); out.line("size.length.track", len(*track)); out.line("size.length.short", len(*short)); - out.line("size.length.number", len(*number)); + out.line("size.length.number.sm", len(number.sm)); + out.line("size.length.number.md", len(number.md)); out.line("size.groove", len(*groove)); let RampSizes { bar, groove: ramp_groove } = ramp; out.line("size.ramp.bar", len(*bar)); diff --git a/crates/theme/src/format/sizes.rs b/crates/theme/src/format/sizes.rs index e7325b7a6..9486a5e04 100644 --- a/crates/theme/src/format/sizes.rs +++ b/crates/theme/src/format/sizes.rs @@ -246,6 +246,8 @@ impl SizeSet { } }; le("base.size.control.sm", s.control.sm, "at most base.size.control.md", s.control.md); + le("base.size.length.field.sm", s.length.field.sm, "at most base.size.length.field.md", s.length.field.md); + le("base.size.length.number.sm", s.length.number.sm, "at most base.size.length.number.md", s.length.number.md); le("base.size.icon.sm", s.icon.sm, "at most base.size.icon.md", s.icon.md); le("base.size.icon.md", s.icon.md, "at most base.size.icon.lg", s.icon.lg); le("base.size.icon.glyph_sm", s.icon.glyph_sm, "at most base.size.icon.sm", s.icon.sm); diff --git a/crates/theme/src/sizes.rs b/crates/theme/src/sizes.rs index bb2896a2b..65c5eb713 100644 --- a/crates/theme/src/sizes.rs +++ b/crates/theme/src/sizes.rs @@ -124,10 +124,12 @@ pub(crate) fn leaves(b: &mut Preset) -> Vec> { "base.size.checker" Num 1.0..=32.0 => s.checker; "base.size.plot.width" Num 48.0..=640.0 => s.plot.width; "base.size.plot.height" Num 32.0..=480.0 => s.plot.height; - "base.size.length.field" Num 64.0..=1024.0 => s.length.field; + "base.size.length.field.sm" Num 64.0..=1024.0 => s.length.field.sm; + "base.size.length.field.md" Num 64.0..=1024.0 => s.length.field.md; "base.size.length.track" Num 48.0..=1024.0 => s.length.track; "base.size.length.short" Num 32.0..=512.0 => s.length.short; - "base.size.length.number" Num 32.0..=512.0 => s.length.number; + "base.size.length.number.sm" Num 32.0..=512.0 => s.length.number.sm; + "base.size.length.number.md" Num 32.0..=512.0 => s.length.number.md; "base.size.groove" Num 0.25..=16.0 => s.groove; "base.size.ramp.bar" Num 1.0..=64.0 => s.ramp.bar; "base.size.ramp.groove" Num 0.25..=32.0 => s.ramp.groove; diff --git a/crates/theme/src/tokens/size.rs b/crates/theme/src/tokens/size.rs index 5a6cfe30b..329176605 100644 --- a/crates/theme/src/tokens/size.rs +++ b/crates/theme/src/tokens/size.rs @@ -139,7 +139,7 @@ pub struct Insets { pub screen: f32, } -/// Control heights, in logical pixels. +/// One length per control size, in logical pixels: control heights, field widths. #[derive(Clone, Copy, Debug, Default, PartialEq)] pub struct ControlSizes { /// Small controls. @@ -314,14 +314,15 @@ pub struct PointerTipOffset { /// Lengths of controls that stretch along one axis, in logical pixels. #[derive(Clone, Copy, Debug, Default, PartialEq)] pub struct LengthSizes { - /// The width of a text or value field. - pub field: f32, + /// The width of a text or value field, one per control size: a field in a small options bar is narrower than one + /// in a dialog. + pub field: ControlSizes, /// The length of a value track (a slider, a range slider, a thumb row). pub track: f32, /// The width of a short field, such as a number beside a slider. pub short: f32, - /// The width of a number field over a slider. - pub number: f32, + /// The width of a number field over a slider, one per control size. + pub number: ControlSizes, } /// Thicknesses of gradient ramps, in logical pixels. 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 be1a6a910..9738e8a0e 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-dark-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 ed1074fe2..21f93125f 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-dark-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 c6a84a8ca..daec7cda1 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-dark-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 6ce915e04..7d1f3a621 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-dark-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 c63d847d6..1c22d195f 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-light-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 5a8ac61e5..5766791d2 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-light-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 8629456bd..ee5fd4c62 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-light-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 43746e870..04e71f50f 100644 --- a/crates/theme/tests/dumps/tokens/adwaita-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/adwaita-light-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 58267f7b1..e4a3aa4b4 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-dark-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 9dd88a8a6..87a202050 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-dark-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 169267951..0e7c126cc 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-dark-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 d90831d8a..63ab484c9 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-dark-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 b621347b9..9e5c31b57 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-light-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 b92c31cd4..02d06dc31 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-light-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 e2bba8d17..e076163e7 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-light-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 857d68c82..dc0a3e6ed 100644 --- a/crates/theme/tests/dumps/tokens/artcraft-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/artcraft-light-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 2e9d0b9cf..4a701dbd6 100644 --- a/crates/theme/tests/dumps/tokens/breeze-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/breeze-dark-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 b03fc83e9..7da598f8b 100644 --- a/crates/theme/tests/dumps/tokens/breeze-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/breeze-dark-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 82ffc5d72..c5e31b0a5 100644 --- a/crates/theme/tests/dumps/tokens/breeze-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/breeze-dark-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 4783d8c27..3945bc513 100644 --- a/crates/theme/tests/dumps/tokens/breeze-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/breeze-dark-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 3cd9d8044..f5400714a 100644 --- a/crates/theme/tests/dumps/tokens/breeze-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/breeze-light-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 08f7544d7..ca571700b 100644 --- a/crates/theme/tests/dumps/tokens/breeze-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/breeze-light-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 bc534f24b..4db6f6959 100644 --- a/crates/theme/tests/dumps/tokens/breeze-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/breeze-light-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 faef0d958..8e888ba2f 100644 --- a/crates/theme/tests/dumps/tokens/breeze-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/breeze-light-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 0dc48fd5c..dec37fa0e 100644 --- a/crates/theme/tests/dumps/tokens/classic-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/classic-light-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 11b6a89c2..fac2b99e4 100644 --- a/crates/theme/tests/dumps/tokens/classic-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/classic-light-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 b707ffe2b..e70740e33 100644 --- a/crates/theme/tests/dumps/tokens/classic-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/classic-light-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 a1c082609..5640a97a4 100644 --- a/crates/theme/tests/dumps/tokens/classic-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/classic-light-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 f4cde7d55..7026f8346 100644 --- a/crates/theme/tests/dumps/tokens/graphite-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/graphite-dark-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 0f03a0e2b..b56b60c5e 100644 --- a/crates/theme/tests/dumps/tokens/graphite-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/graphite-dark-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 3b14f827d..fa21702f5 100644 --- a/crates/theme/tests/dumps/tokens/graphite-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/graphite-dark-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 d5283ce2e..90e7db8d4 100644 --- a/crates/theme/tests/dumps/tokens/graphite-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/graphite-dark-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 263cb4482..5c4bd5378 100644 --- a/crates/theme/tests/dumps/tokens/graphite-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/graphite-light-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 b45a2d172..aae1ab503 100644 --- a/crates/theme/tests/dumps/tokens/graphite-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/graphite-light-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 11fa2762b..0a0e5ce71 100644 --- a/crates/theme/tests/dumps/tokens/graphite-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/graphite-light-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 3fb11813d..06e04f43a 100644 --- a/crates/theme/tests/dumps/tokens/graphite-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/graphite-light-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 32c702501..e38260fae 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 433b886dd..399c14c37 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 33925e52f..79feb772e 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 7942eb0df..fab241fdc 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 f835d6fe7..87c2be96f 100644 --- a/crates/theme/tests/dumps/tokens/pro-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-dark-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 31b814a97..3b1b2835d 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 74d8d5aee..239048da6 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 f25343695..47dab7698 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 455f4e14c..df121c6b3 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 b34a1b5ff..c2bac6c72 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 0ad8bfdaf..1a318ca49 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 49ff2970d..9a35268df 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 8d420897c..8accf0c3c 100644 --- a/crates/theme/tests/dumps/tokens/pro-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/pro-light-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 97d959b8d..961e973e6 100644 --- a/crates/theme/tests/dumps/tokens/soft-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/soft-dark-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 cbe3b2008..a4462fddc 100644 --- a/crates/theme/tests/dumps/tokens/soft-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/soft-dark-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 9bf859b72..3b09d66a1 100644 --- a/crates/theme/tests/dumps/tokens/soft-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/soft-dark-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 7af3c94ea..320adc8f7 100644 --- a/crates/theme/tests/dumps/tokens/soft-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/soft-dark-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 9487c7ded..6d12def47 100644 --- a/crates/theme/tests/dumps/tokens/soft-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/soft-light-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 93a1c36eb..b9caa6d10 100644 --- a/crates/theme/tests/dumps/tokens/soft-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/soft-light-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 17a49524e..1430df39b 100644 --- a/crates/theme/tests/dumps/tokens/soft-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/soft-light-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 6778d2c9a..0f8152def 100644 --- a/crates/theme/tests/dumps/tokens/soft-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/soft-light-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 423afb92c..5d963e509 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 1c8cd32ec..cb7394fae 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 17fb126f4..37600ed7c 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 480cc3097..41cc4dbda 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 @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 c29b8f7ca..3a4619d2e 100644 --- a/crates/theme/tests/dumps/tokens/studio-dark-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/studio-dark-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 4d3c968b9..4645ecf5b 100644 --- a/crates/theme/tests/dumps/tokens/studio-dark-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/studio-dark-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 2dcacd845..89054e4de 100644 --- a/crates/theme/tests/dumps/tokens/studio-dark-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/studio-dark-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 f5a8bea61..2fe6be8cd 100644 --- a/crates/theme/tests/dumps/tokens/studio-dark-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/studio-dark-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 8ee652dc3..e5c89bdea 100644 --- a/crates/theme/tests/dumps/tokens/studio-light-high-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/studio-light-high-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 5e5c2e8be..0a7cb6856 100644 --- a/crates/theme/tests/dumps/tokens/studio-light-high-compact.txt +++ b/crates/theme/tests/dumps/tokens/studio-light-high-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 1f89846f1..fe30386c0 100644 --- a/crates/theme/tests/dumps/tokens/studio-light-standard-comfortable.txt +++ b/crates/theme/tests/dumps/tokens/studio-light-standard-comfortable.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 300 size.plot.height = 180 -size.length.field = 240 +size.length.field.sm = 192 +size.length.field.md = 240 size.length.track = 144 size.length.short = 120 -size.length.number = 90 +size.length.number.sm = 72 +size.length.number.md = 90 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 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 03cafa60b..64904c342 100644 --- a/crates/theme/tests/dumps/tokens/studio-light-standard-compact.txt +++ b/crates/theme/tests/dumps/tokens/studio-light-standard-compact.txt @@ -156,10 +156,12 @@ size.hit.target = 8 size.checker = 4 size.plot.width = 240 size.plot.height = 144 -size.length.field = 192 +size.length.field.sm = 160 +size.length.field.md = 192 size.length.track = 128 size.length.short = 96 -size.length.number = 72 +size.length.number.sm = 60 +size.length.number.md = 72 size.groove = 3 size.ramp.bar = 10 size.ramp.groove = 5 diff --git a/crates/ui-contract/src/contract/label/place.rs b/crates/ui-contract/src/contract/label/place.rs index 0949cffdb..86e70a2ff 100644 --- a/crates/ui-contract/src/contract/label/place.rs +++ b/crates/ui-contract/src/contract/label/place.rs @@ -81,7 +81,7 @@ pub(super) fn decide(ctx: &egui::Context, env: &Env, input: &LabelIn<'_>, kids: } let baseline = leaf.baseline.get(); if input.side.layout == FieldLayout::Line { - let (cell, rest) = flow.take_end(env.tokens.size.length.number); + let (cell, rest) = flow.take_end(env.control(input.size).number); let width = natural.x.min((rest.rect().width() - gap).max(0.0)); let drop = (cell.height() - natural.y).max(0.0) / 2.0; let label = Flow::new(rest.rect(), rtl).align(Vec2::new(width, natural.y), Align::Min, Align::Min).translate(Vec2::new(0.0, drop)); diff --git a/crates/ui-contract/src/contract/label/props.rs b/crates/ui-contract/src/contract/label/props.rs index 5dc7d674b..4d05a39a3 100644 --- a/crates/ui-contract/src/contract/label/props.rs +++ b/crates/ui-contract/src/contract/label/props.rs @@ -103,8 +103,8 @@ pub enum FieldLayout { /// After the control, as check box and radio labels sit: the control takes its narrowest width and the label /// follows it, on the end side under RTL. The row never stacks. After, - /// On one line: the label at the start and the control in a `size.length.number` cell at the end, as a number - /// field sits over its slider. The label elides before the cell. The row never stacks. + /// On one line: the label at the start and the control in a cell of `size.length.number` at the control's size at + /// the end, as a number field sits over its slider. The label elides before the cell. The row never stacks. Line, /// In the control's box at its start, in the slot a control that offers one shows it (a number field's leading /// adornment); the control takes the whole row. For a glyph label of a body that is one such control: the slot diff --git a/crates/ui-contract/src/runtime/env.rs b/crates/ui-contract/src/runtime/env.rs index fe68c1720..b1cd33a6b 100644 --- a/crates/ui-contract/src/runtime/env.rs +++ b/crates/ui-contract/src/runtime/env.rs @@ -275,7 +275,7 @@ impl Scoped { self.scroll_owner.is_some_and(|owner| owner.view) } - /// The height, icon side, padding and gap of a control of `size`, with the line ratio of this scope. + /// The height, icon side, padding, gap and field widths of a control of `size`, with the line ratio of this scope. pub(crate) fn control(&self, size: craft_theme::ControlSize) -> craft_behavior::ControlMetrics { crate::style::control_metrics(&self.tokens, size, self.line_ratio) } diff --git a/crates/ui-contract/src/runtime/env/view.rs b/crates/ui-contract/src/runtime/env/view.rs index 4a8e0155e..9dd019e9d 100644 --- a/crates/ui-contract/src/runtime/env/view.rs +++ b/crates/ui-contract/src/runtime/env/view.rs @@ -22,7 +22,7 @@ pub struct EnvView<'a> { } impl<'a> EnvView<'a> { - /// The height, icon side, padding and gap of a control of `size`. + /// The height, icon side, padding, gap and field widths of a control of `size`. pub(crate) fn control(&self, size: craft_theme::ControlSize) -> craft_behavior::ControlMetrics { self.scoped.control(size) } diff --git a/crates/ui-contract/src/style/cx.rs b/crates/ui-contract/src/style/cx.rs index 7e93534eb..f05691ea1 100644 --- a/crates/ui-contract/src/style/cx.rs +++ b/crates/ui-contract/src/style/cx.rs @@ -257,7 +257,7 @@ impl<'a> StyleCx<'a> { }) } - /// The height, icon side, padding and gap of a control at the ambient size. + /// The height, icon side, padding, gap and field widths of a control at the ambient size. pub fn control(&self) -> ControlMetrics { self.control_of(self.size) } @@ -416,7 +416,7 @@ impl<'a> StyleCx<'a> { } } -/// The height, icon side, padding and gap of a control of `size`. +/// The height, icon side, padding, gap and field widths of a control of `size`. /// /// The height is the size token, or more when the face that leads the interface stack sets taller rows than the /// token's type line: the control's vertical padding (the token height less the label role's line height, which @@ -434,5 +434,7 @@ pub(crate) fn control_metrics(tokens: &UiTokens, size: ControlSize, line_ratio: &BySize { sm: sizes.icon.sm, md: sizes.icon.md }, &BySize { sm: pad, md: pad }, &BySize { sm: gap, md: gap }, + &BySize { sm: sizes.length.field.sm, md: sizes.length.field.md }, + &BySize { sm: sizes.length.number.sm, md: sizes.length.number.md }, ) } diff --git a/crates/ui-patterns/src/patterns/dock/panes/stories.rs b/crates/ui-patterns/src/patterns/dock/panes/stories.rs index 009e56a17..34e339be4 100644 --- a/crates/ui-patterns/src/patterns/dock/panes/stories.rs +++ b/crates/ui-patterns/src/patterns/dock/panes/stories.rs @@ -50,7 +50,7 @@ impl PaneContent for Panes { #[story(PaneArea<'static, u32>, covers = [], drive = Drive::Never)] fn pane_area(ui: &mut Ui, _: &mut StoryData) -> StoryOutput { let size = &Env::of(ui).tokens.size; - let mut content = Panes { float: Vec2::new(size.float.width, size.float.height), side: size.length.field, layers: layer_names() }; + let mut content = Panes { float: Vec2::new(size.float.width, size.float.height), side: size.length.field.md, layers: layer_names() }; let open = [0_u32, 1]; PaneArea::new("Panes", &open, &mut content) .show(ui, |ui, _| { @@ -62,7 +62,7 @@ fn pane_area(ui: &mut Ui, _: &mut StoryData) -> StoryOutput { fn spec(ui: &Ui, title: &str, collection_body: bool) -> PaneSpec { let size = &Env::of(ui).tokens.size; let mut spec = - PaneSpec::new(title.to_owned(), PaneState::docked(PaneEdge::Start, size.length.field), Vec2::new(size.float.width, size.float.height)); + PaneSpec::new(title.to_owned(), PaneState::docked(PaneEdge::Start, size.length.field.md), Vec2::new(size.float.width, size.float.height)); spec.collection_body = collection_body; spec } diff --git a/crates/ui-widgets/src/bars/breadcrumb.rs b/crates/ui-widgets/src/bars/breadcrumb.rs index 06b807140..6e993e622 100644 --- a/crates/ui-widgets/src/bars/breadcrumb.rs +++ b/crates/ui-widgets/src/bars/breadcrumb.rs @@ -186,7 +186,7 @@ impl Component for BreadcrumbBar<'_, K> { gap, joint: icon + 2.0 * gap, ellipsis_pad: 2.0 * gap, - crumb_cap: cx.tokens.size.length.field, + crumb_cap: cx.control().field, } } diff --git a/crates/ui-widgets/src/form/slider_field.rs b/crates/ui-widgets/src/form/slider_field.rs index 9be95711a..3f9eb71fe 100644 --- a/crates/ui-widgets/src/form/slider_field.rs +++ b/crates/ui-widgets/src/form/slider_field.rs @@ -227,10 +227,10 @@ impl Component for SliderField<'_> { let control = cx.control(); SliderFieldStyle { metrics: Metrics::new().gap(control.gap), - field: cx.tokens.size.length.number, + field: control.number, inline_gap: cx.tokens.space.gap.section, row: control.height, - width: cx.tokens.size.length.field, + width: control.field, } } diff --git a/crates/ui-widgets/src/pickers/unit_select.rs b/crates/ui-widgets/src/pickers/unit_select.rs index 7062f5609..3a376b6b8 100644 --- a/crates/ui-widgets/src/pickers/unit_select.rs +++ b/crates/ui-widgets/src/pickers/unit_select.rs @@ -121,7 +121,8 @@ impl Component for UnitSelect<'_> { type Output = UnitSelectOutput; fn style(cx: &StyleCx<'_>, _: UnitSelectStyleKey) -> UnitSelectStyle { - UnitSelectStyle { metrics: Metrics::new().gap(cx.control().gap), number: cx.tokens.size.length.field } + let control = cx.control(); + UnitSelectStyle { metrics: Metrics::new().gap(control.gap), number: control.field } } fn sense(&self) -> Sense { diff --git a/crates/ui-widgets/src/text/mod.rs b/crates/ui-widgets/src/text/mod.rs index 36d50740c..4827fc9c6 100644 --- a/crates/ui-widgets/src/text/mod.rs +++ b/crates/ui-widgets/src/text/mod.rs @@ -34,8 +34,8 @@ use egui::Vec2; pub struct FieldStyle { #[style(surface)] surface: SurfaceLook, - /// Padding, the gap between adornments and the text, a control high, and `size.length.field` wide where the room - /// allows; a row that lacks room narrows it to `size.length.short`. + /// Padding, the gap between adornments and the text, a control high, and `size.length.field` at the control's size + /// wide where the room allows; a row that lacks room narrows it to `size.length.short`. #[style(metrics)] metrics: Metrics, /// A glyph adornment: its side and colour. @@ -53,7 +53,7 @@ impl FieldStyle { .padding(Insets::horizontal(control.pad_x)) .gap(control.gap) .min_size(Vec2::new(cx.tokens.size.length.short, control.height)) - .ideal_width(cx.tokens.size.length.field) + .ideal_width(control.field) // Where a row shrinks it, a field narrows to its padding and one glyph; what it shows there (an // ellipsis, its adornments) its content measure adds. .least_width(2.0 * control.pad_x + control.icon); diff --git a/crates/ui-widgets/src/text/number.rs b/crates/ui-widgets/src/text/number.rs index 3a53fa6a3..80d8f3f6f 100644 --- a/crates/ui-widgets/src/text/number.rs +++ b/crates/ui-widgets/src/text/number.rs @@ -71,6 +71,8 @@ pub struct NumberStyle { field: FieldStyle, /// The colour of the inside label's glyph, a scrub handle. handle: Stateful, + /// The width of one number cell at the control's size (`size.length.number`), padding included. + cell: f32, } /// A number field: a text part over [`NumberCodec`]; empty text is `None`. @@ -352,6 +354,7 @@ impl Component for NumberField<'_, V> { metrics: field.clone().sized_by_content().metrics, unit: TextLook::new(TypeRole::Body, Stateful::new(faint).off(States::new(faint, faint, faint, cx.color(cx.tokens.color.text.disabled)))), handle: Stateful::new(muted).off(States::new(muted, muted, muted, cx.color(cx.tokens.color.text.disabled))), + cell: cx.control().number, field, } } @@ -386,7 +389,7 @@ impl Component for NumberField<'_, V> { return Vec2::new(width, text.y); } let field = cx.style.field.metrics(); - let width = width.max(cx.tokens.size.length.number - field.padding.start - field.padding.end); + let width = width.max(cx.style.cell - field.padding.start - field.padding.end); Vec2::new(width, text.y) } diff --git a/crates/ui-widgets/tests/it/text/mod.rs b/crates/ui-widgets/tests/it/text/mod.rs index fb29061d6..315cb3fc4 100644 --- a/crates/ui-widgets/tests/it/text/mod.rs +++ b/crates/ui-widgets/tests/it/text/mod.rs @@ -9,3 +9,4 @@ mod number; mod number_length; mod selectable; mod text_field; +mod widths; diff --git a/crates/ui-widgets/tests/it/text/widths.rs b/crates/ui-widgets/tests/it/text/widths.rs new file mode 100644 index 000000000..19d05f8d4 --- /dev/null +++ b/crates/ui-widgets/tests/it/text/widths.rs @@ -0,0 +1,32 @@ +//! A field takes the width of its control size: a small field, as an options bar shows it, is narrower than the same +//! field at the standard size, as a dialog shows it. + +use craft_theme::ControlSize; +use craft_ui::contract::{Bind, Entry, Props as _, Show as _}; +use craft_ui::pickers::Select; +use craft_ui::testing::{Frames, trial}; +use craft_ui::text::{NumberField, TextField}; +use std::cell::Cell; + +/// The widths of a text field, a select and a number field shown at `size` in a wide row. +fn widths(size: ControlSize) -> [f32; 3] { + let mut frames = Frames::new(); + let shown = Cell::new([0.0; 3]); + let (mut text, mut number, mut picked) = (String::new(), Some(1.0), 1u8); + let entries = [Entry::new(1u8, "One"), Entry::new(2u8, "Two")]; + frames.idle(3, |ui| { + let text_width = TextField::new("Name", Bind::bound(&mut text)).size(size).id_salt("text").show(ui).response.rect.width(); + let select_width = Select::new("Pick", Bind::bound(&mut picked), &entries).size(size).id_salt("select").show(ui).response.rect.width(); + let number_width = NumberField::new("Size", Bind::bound(&mut number)).size(size).id_salt("number").show(ui).response.rect.width(); + shown.set([text_width, select_width, number_width]); + }); + shown.get() +} + +#[trial] +fn a_small_field_is_narrower_than_a_standard_one() { + let (small, standard) = (widths(ControlSize::Sm), widths(ControlSize::Md)); + for (name, (small, standard)) in ["text field", "select", "number field"].into_iter().zip(small.into_iter().zip(standard)) { + assert!(small > 0.0 && small < standard, "a small {name} is narrower than a standard one: {small} against {standard}"); + } +} diff --git a/docs/craft-framework.md b/docs/craft-framework.md index 2c3c6d296..643d855a2 100644 --- a/docs/craft-framework.md +++ b/docs/craft-framework.md @@ -983,13 +983,15 @@ A theme with its own shape replaces the radii or adds an offset to control, surf | `size.ramp.bar` | Gradient ramp drawn as a bar of its own | | `size.ramp.groove` | Gradient ramp drawn as the groove of a value track | | `size.rail.width`, `size.rail.button` | Tool rail and panel rail | -| `size.length.field`, `size.length.track`, `size.length.short`, `size.length.number` | Text or value field, value track, short field, number field over a slider | +| `size.length.field.sm`, `size.length.field.md` | Text or value field, one width per control size: a field in a small options bar is narrower than one in a dialog | +| `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.notice.width` | Width of a toast card where the room allows | | `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.thumb.card` | The picture side of a tile card at zoom 1 (tile grids, preset browsers, the start screen) | | `space.gap.*`, `space.pad.*` | Gaps between and padding inside components | -Both size sets (`crates/theme/sizes/compact.json` and `comfortable.json`) hold every role above. NumberField is at least `size.length.number` wide; apps set other widths per field. +Both size sets (`crates/theme/sizes/compact.json` and `comfortable.json`) hold every role above. NumberField is at least `size.length.number` at its control size wide; apps set other widths per field. ## Appendix B. Crate and module layout