mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 04:04:25 +00:00
Theme: shape.wells, the shape of a colour well that stands on its own; SwatchPair draws round wells where the theme says so (Adwaita, Breeze, Soft)
This commit is contained in:
@@ -970,6 +970,8 @@ A theme with its own shape replaces the radii or adds an offset to control, surf
|
||||
|
||||
`shape.knob` is the shape of a value track's thumb (Slider, RangeSlider): `round`, the control's glyph across, or `tab`, an upright tab the control's icon side tall. Classic sets `tab`.
|
||||
|
||||
`shape.wells` is the shape of a colour well that stands on its own (SwatchPair's foreground and background): `square`, with the small radius, or `round`, a circle. Adwaita, Breeze and Soft set `round`.
|
||||
|
||||
### Size roles
|
||||
|
||||
| Role | Components |
|
||||
|
||||
@@ -56,7 +56,7 @@ the app's pins (`apps.<id>`), then the theme's high-contrast pins, then the app'
|
||||
| `variants` | no | `"both"` (default), `"light"` or `"dark"` |
|
||||
| `contrast_intent` | no | `"standard"` (default) or `"low"`: the theme is meant to be soft, and pickers label it "Low contrast" |
|
||||
| `seeds` | yes | `neutral`, `accent` and `status.good/warn/bad/info`, all required |
|
||||
| `shape` | no | `null`, or `{ "radius": { control, popup, window, panel, button, pill? }, "radius_offset": { control?, popup?, window? }, "edge": "flat" or {"bevel": {"width": 1}}, "rows": "divided" or "rounded", "knob": "round" or "tab" }`; `knob` is the shape of a value track's thumb (default `"round"`; Classic's `"tab"` is an upright tab); a radius is a number or `"full"`; `radius` needs the first five keys when present and fixes the radii at every Size; `radius_offset` (numbers, negative allowed, missing keys 0) is added to the control, popup and window radii in force, so the theme keeps its own shape at every Size (Soft: control +1, popup +2, window +2, which makes 7/10/14 at Comfortable and 4/6/8 at Compact); a "full" radius and `panel`, `button` and `pill` are not offset, and a sum below 0 is 0; `pill` (switch, slider, progress and badge shapes, clamped to half the part's height) defaults to `"full"`, and Classic sets it to 0 |
|
||||
| `shape` | no | `null`, or `{ "radius": { control, popup, window, panel, button, pill? }, "radius_offset": { control?, popup?, window? }, "edge": "flat" or {"bevel": {"width": 1}}, "rows": "divided" or "rounded", "knob": "round" or "tab", "wells": "square" or "round" }`; `knob` is the shape of a value track's thumb (default `"round"`; Classic's `"tab"` is an upright tab); `wells` is the shape of a colour well that stands on its own, SwatchPair's (default `"square"`; Adwaita, Breeze and Soft are `"round"`); a radius is a number or `"full"`; `radius` needs the first five keys when present and fixes the radii at every Size; `radius_offset` (numbers, negative allowed, missing keys 0) is added to the control, popup and window radii in force, so the theme keeps its own shape at every Size (Soft: control +1, popup +2, window +2, which makes 7/10/14 at Comfortable and 4/6/8 at Compact); a "full" radius and `panel`, `button` and `pill` are not offset, and a sum below 0 is 0; `pill` (switch, slider, progress and badge shapes, clamped to half the part's height) defaults to `"full"`, and Classic sets it to 0 |
|
||||
| `light`, `dark` | no | colour pins: dotted token path to `#RRGGBB`, `#RRGGBBAA` or a reference `"{token.path}"` (see References); surfaces (`surface.*` except `surface.scrim`) must be opaque. A `seeds` key holds that mode's seed overrides: `neutral`, `accent` and `status.good/warn/bad/info`, each optional; a field it names replaces the theme's `seeds` value in that mode and the rest fall through |
|
||||
| `high_contrast` | no | `{ "light": {...}, "dark": {...} }`, pins used only in high contrast; no `seeds` key (it is an error there and in `apps`) |
|
||||
| `apps` | no | per-app `{ light, dark, high_contrast }`, applied over the theme's values for that app; its `high_contrast` pins apply after the theme's |
|
||||
|
||||
Reference in New Issue
Block a user