@canonical/react-ds-global-form 0.37.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/dist/esm/density.css +320 -302
- package/dist/esm/docs/examples/density-examples.css +19 -14
- package/dist/esm/index.css +361 -335
- package/dist/esm/lib/_work_in_progress/DensityTestbed/baseline-system.css +71 -64
- package/dist/esm/lib/_work_in_progress/DensityTestbed/density.testbed.css +127 -123
- package/dist/esm/lib/common/Wrapper/ToggleWrapper.css +73 -54
- package/dist/esm/lib/common/Wrapper/styles.css +35 -31
- package/dist/esm/lib/component/ChoicesField/common/Option/Option.js +4 -1
- package/dist/esm/lib/component/ChoicesField/common/Option/Option.js.map +1 -1
- package/dist/esm/lib/component/ChoicesField/styles.css +195 -163
- package/dist/esm/lib/component/RangeField/common/RangeControl/styles.css +39 -35
- package/dist/esm/lib/component/RichChoicesField/styles.css +93 -89
- package/dist/esm/lib/subcomponent/CheckboxInput/styles.css +115 -111
- package/dist/esm/lib/subcomponent/ColorInput/styles.css +177 -173
- package/dist/esm/lib/subcomponent/ComboboxInput/SingleCombobox.js.map +1 -1
- package/dist/esm/lib/subcomponent/ComboboxInput/common/List/styles.css +33 -29
- package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/styles.css +21 -17
- package/dist/esm/lib/subcomponent/ComboboxInput/styles.css +59 -55
- package/dist/esm/lib/subcomponent/DateInput/styles.css +23 -19
- package/dist/esm/lib/subcomponent/DateTimeInput/styles.css +24 -20
- package/dist/esm/lib/subcomponent/Field/Description/styles.css +9 -5
- package/dist/esm/lib/subcomponent/Field/Error/styles.css +9 -5
- package/dist/esm/lib/subcomponent/Field/Label/Label.js +2 -2
- package/dist/esm/lib/subcomponent/Field/Label/Label.js.map +1 -1
- package/dist/esm/lib/subcomponent/Field/Label/styles.css +25 -21
- package/dist/esm/lib/subcomponent/FileUploadInput/styles.css +125 -119
- package/dist/esm/lib/subcomponent/NumberInput/styles.css +32 -28
- package/dist/esm/lib/subcomponent/PasswordInput/styles.css +58 -54
- package/dist/esm/lib/subcomponent/PhoneInput/styles.css +53 -49
- package/dist/esm/lib/subcomponent/RadioInput/styles.css +70 -66
- package/dist/esm/lib/subcomponent/RangeInput/styles.css +74 -70
- package/dist/esm/lib/subcomponent/RatingInput/styles.css +132 -128
- package/dist/esm/lib/subcomponent/SelectInput/styles.css +44 -40
- package/dist/esm/lib/subcomponent/SwitchInput/styles.css +90 -86
- package/dist/esm/lib/subcomponent/TextInput/styles.css +30 -26
- package/dist/esm/lib/subcomponent/TextareaInput/styles.css +14 -10
- package/dist/esm/lib/subcomponent/TimeInput/styles.css +19 -15
- package/dist/esm/lib/utils/middleware/addRESTValidation.js +1 -1
- package/dist/esm/lib/utils/middleware/addRESTValidation.js.map +1 -1
- package/dist/types/lib/component/ChoicesField/common/Option/Option.d.ts.map +1 -1
- package/dist/types/lib/subcomponent/ComboboxInput/SingleCombobox.d.ts.map +1 -1
- package/package.json +17 -16
package/dist/esm/density.css
CHANGED
|
@@ -22,336 +22,354 @@
|
|
|
22
22
|
* @canonical/styles (--control-seat-line/-basis): no fixed heights; border +
|
|
23
23
|
* seat pads + line-height add up to the density cell. Zero-JS (cap-unit
|
|
24
24
|
* approximation); holds to the cap tolerance.
|
|
25
|
+
*
|
|
26
|
+
* Layer: ds.components.global (@canonical/styles README, "Cascade layers").
|
|
25
27
|
*/
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
@layer ds.components.global {
|
|
30
|
+
/* ── TRANSITIONAL: the fixed-height box (direct date/time chromes only) ──────
|
|
31
|
+
* The ORIGINAL density box: a FIXED grid-multiple height with border-box so the
|
|
32
|
+
* border is absorbed into the height. The composite text family, the select and
|
|
33
|
+
* the textarea have all moved OFF this rule onto the intrinsic seat (their
|
|
34
|
+
* equal-specificity rules further down override it); it still governs the
|
|
35
|
+
* remaining direct chromes — date, time, datetime — whose multi-part UA
|
|
36
|
+
* internals need their own measured pass before they join.
|
|
37
|
+
*
|
|
38
|
+
* Controls no longer carry `.p` — the density system supplies the body font tier
|
|
39
|
+
* (font-size / weight / family) here. */
|
|
40
|
+
/* NB `.ds.input.textarea` is EXCLUDED: the textarea seats intrinsically (its own
|
|
41
|
+
* rule below) and must keep its multi-row min-height. */
|
|
42
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input:not(.textarea) {
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
/* Same effective line-height the target-baseline uses (single source of the
|
|
45
|
+
fallback chain), so a bare context class keeps a valid box height too. */
|
|
46
|
+
--density-box-height: var(--density-line-height-effective);
|
|
47
|
+
block-size: var(--density-box-height);
|
|
48
|
+
min-block-size: var(--density-box-height);
|
|
49
|
+
align-items: flex-start;
|
|
50
|
+
justify-content: flex-start;
|
|
51
|
+
/* Kill the UA BOTTOM padding only. Do NOT zero padding-block-start here: this
|
|
52
|
+
selector is more specific (0,4,0) than the placement rule below (0,2,0), so a
|
|
53
|
+
`padding-block: 0` shorthand would out-specify and WIPE the placement's
|
|
54
|
+
`padding-block-start: var(--space-before)` — leaving the label pinned to the
|
|
55
|
+
box top (off the baseline). The placement rule owns the start. */
|
|
56
|
+
padding-block-end: 0;
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
58
|
+
/* Body font tier — what `.p` used to supply. */
|
|
59
|
+
font-size: var(--typography-text-primary-font-size);
|
|
60
|
+
font-family: var(--typography-text-primary-font-family);
|
|
61
|
+
}
|
|
59
62
|
|
|
60
|
-
/* The input WRAPPER is the box (like the button element): don't stretch its
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.text,
|
|
64
|
-
:is(.comfortable, .dense, .app, .site, .docs) .ds.input {
|
|
65
|
-
|
|
66
|
-
}
|
|
63
|
+
/* The input WRAPPER is the box (like the button element): don't stretch its
|
|
64
|
+
* child, top-reference it so the input's own space-before governs. Needs to beat
|
|
65
|
+
* the TextInput's `.ds.input.text { align-items: stretch }` (0,3,0). */
|
|
66
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.text,
|
|
67
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input {
|
|
68
|
+
align-items: flex-start;
|
|
69
|
+
}
|
|
67
70
|
|
|
68
|
-
/* The <input> is the text carrier — treat it exactly like the button label:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
:is(.comfortable, .dense, .app, .site, .docs) .ds.input > input {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
71
|
+
/* The <input> is the text carrier — treat it exactly like the button label:
|
|
72
|
+
* same body font tier, and normalised so only the space-before (below) positions
|
|
73
|
+
* its text. (It's content-box with an intrinsic height, so reset that.) */
|
|
74
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input > input {
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
min-block-size: 0;
|
|
77
|
+
block-size: auto;
|
|
78
|
+
margin-block: 0;
|
|
79
|
+
font-size: var(--typography-text-primary-font-size);
|
|
80
|
+
font-family: var(--typography-text-primary-font-family);
|
|
81
|
+
}
|
|
79
82
|
|
|
80
|
-
/* ── Baseline placement: `.baseline` nudge + `--space-before` ───────────────
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
/* Body font tier for the field label/description/error
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
83
|
+
/* ── Baseline placement: `.baseline` nudge + `--space-before` ───────────────
|
|
84
|
+
* Two parts, the combination that put controls ON the grid:
|
|
85
|
+
*
|
|
86
|
+
* 1. NUDGE (the DS.01 `.baseline` mechanism): --bl-start-nudge snaps the text's
|
|
87
|
+
* first baseline onto the NEAREST grid line, computed from the element's own
|
|
88
|
+
* font (1cap + line-height) — font-relative, so it's exact at any size and
|
|
89
|
+
* needs no per-element fudge. This is what lands text exactly on a line.
|
|
90
|
+
*
|
|
91
|
+
* 2. --space-before: whole baselines added to move that snapped baseline DOWN to
|
|
92
|
+
* the density TARGET line (round-up of the remaining distance), less the box's
|
|
93
|
+
* own top border.
|
|
94
|
+
*
|
|
95
|
+
* padding-block-start = bl-start-nudge + space-before − border-top
|
|
96
|
+
* space-before = round(up, target − bl-start-nudge − border-top, baseline)
|
|
97
|
+
*
|
|
98
|
+
* Applies to the button, the input, and the field label/description/error — i.e.
|
|
99
|
+
* CONTROL-like text only. Bare prose (p / .p / h1–h6) is DELIBERATELY NOT here:
|
|
100
|
+
* running text belongs to the typography engine, which already seats it on the
|
|
101
|
+
* grid (snapped --computed-line-height + --start/--end-nudge) and lets `.editorial`
|
|
102
|
+
* add its inter-block margins. Density crushing prose to line-height:1 fought that
|
|
103
|
+
* engine (and only ever put the FIRST line on-grid — wrapped lines drifted). By
|
|
104
|
+
* partitioning prose OUT, density and the engine write to disjoint element sets,
|
|
105
|
+
* so `.editorial` composes with density with no specificity war. `:is()` (not
|
|
106
|
+
* `:where()`) still gives the control seat the specificity to beat a control's own
|
|
107
|
+
* centring (e.g. the Button's `align-items: center`). */
|
|
108
|
+
/* Body font tier for the field label/description/error plus the toggle control
|
|
109
|
+
row (its own line metrics must match the label's so the control row centres
|
|
110
|
+
exactly), which lost `.p`. Scoped to just these (NOT the headings, which
|
|
111
|
+
keep their own tier). */
|
|
112
|
+
:is(.comfortable, .dense, .app, .site, .docs)
|
|
113
|
+
:is(
|
|
114
|
+
.ds.field-label,
|
|
115
|
+
.ds.field-description,
|
|
116
|
+
.ds.field-error,
|
|
117
|
+
.ds.field-toggle,
|
|
118
|
+
.ds.option
|
|
119
|
+
) {
|
|
120
|
+
font-size: var(--typography-text-primary-font-size);
|
|
121
|
+
font-family: var(--typography-text-primary-font-family);
|
|
122
|
+
}
|
|
112
123
|
|
|
113
|
-
:is(.comfortable, .dense, .app, .site, .docs)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
:is(.comfortable, .dense, .app, .site, .docs)
|
|
125
|
+
:is(
|
|
126
|
+
.ds.field-label,
|
|
127
|
+
.ds.field-description,
|
|
128
|
+
.ds.field-error,
|
|
129
|
+
.ds.field-toggle,
|
|
130
|
+
.ds.option
|
|
131
|
+
) {
|
|
132
|
+
line-height: 1;
|
|
133
|
+
/* Baseline within a line-height:1 box (font-relative cap approximation). */
|
|
134
|
+
--natural-baseline: calc((1em + 1cap) / 2);
|
|
135
|
+
/* Pad the top so the baseline lands at the density target, less the box's own
|
|
136
|
+
top border. */
|
|
137
|
+
--space-before: max(
|
|
138
|
+
0px,
|
|
139
|
+
calc(
|
|
140
|
+
var(--density-target-baseline-px, 0px) -
|
|
141
|
+
var(--natural-baseline) -
|
|
142
|
+
var(--border-top-width, 0px)
|
|
143
|
+
)
|
|
144
|
+
);
|
|
145
|
+
padding-block-start: var(--space-before);
|
|
146
|
+
padding-block-end: 0;
|
|
147
|
+
}
|
|
131
148
|
|
|
132
|
-
/* ── Intrinsic control seat: the composite text-input family ─────────────────
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
:is(.comfortable, .dense, .app, .site, .docs)
|
|
149
|
+
/* ── Intrinsic control seat: the composite text-input family ─────────────────
|
|
150
|
+
* The single-line <input> no longer uses the line-height:1 crush + space-before
|
|
151
|
+
* padding above (that rule is now labels-only). Instead it consumes the SHARED
|
|
152
|
+
* control seat from @canonical/styles (modifiers.density.css): the input's own
|
|
153
|
+
* line box (cell − 2 baselines) is the control interior, `--control-seat-before`
|
|
154
|
+
* seats its baseline on the density target, and the CHROME closes the box with
|
|
155
|
+
* `--control-seat-after` — so the chrome's height is INTRINSIC (no fixed
|
|
156
|
+
* block-size) yet lands exactly on the density cell, both edges on the grid.
|
|
157
|
+
*
|
|
158
|
+
* Placed AFTER the fixed-height box rule above so this (equal-specificity)
|
|
159
|
+
* rule wins for the text family. Direct chromes (select/date/time) and the
|
|
160
|
+
* textarea keep the previous model until their own cutover pass. */
|
|
161
|
+
:is(.comfortable, .dense, .app, .site, .docs)
|
|
145
162
|
.ds.input:is(.text, .number, .password, .phone) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
163
|
+
/* The COMPOSITE chrome family — every wrapper with an inner <input> leaf
|
|
164
|
+
(text, number, password, phone). One selector, one seat: the wrapper is
|
|
165
|
+
the box, the leaf carries the line. */
|
|
149
166
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
167
|
+
/* NO drift term here — deliberately. The old ~2px "native input renders low"
|
|
168
|
+
compensation was an artifact of the line-height:1 crush structure: give the
|
|
169
|
+
<input> a real line box (--control-seat-line below) and it renders its text
|
|
170
|
+
exactly like a <span> (measured; see the drift note at the end of this
|
|
171
|
+
file). Subtracting the stale 2px lifted the text 2px too high. */
|
|
155
172
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
173
|
+
/* The UA enforces a line-height FLOOR of `normal` (1.2em for Ubuntu) on a
|
|
174
|
+
single-line <input> — a specified line-height below it is silently clamped
|
|
175
|
+
(measured: dense's 16px line rendered 16.8px tall, pushing the chrome to
|
|
176
|
+
24.8). So the seat computes with the FLOORED line the UA will actually
|
|
177
|
+
use; the box then closes to the cell exactly in every density cell. */
|
|
178
|
+
--seat-line-floored: max(var(--control-seat-line), 1.2em);
|
|
162
179
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
180
|
+
/* The chrome's border folds in HERE (a var() inside a custom property
|
|
181
|
+
substitutes at its declaring element, so the shared layer cannot read it).
|
|
182
|
+
Derived from the target directly — not --control-seat-basis — because the
|
|
183
|
+
basis assumes the unfloored line. Both the leaf's top pad and the chrome's
|
|
184
|
+
closing pad read this SAME `--seat-before`, keeping the complement
|
|
185
|
+
consistent. Rounded to ¼px so the pad is exactly representable in 1/64px
|
|
186
|
+
layout units (the fractional 1cap term otherwise leaves ~1/60px residues
|
|
187
|
+
on the box height). */
|
|
188
|
+
--seat-before: round(
|
|
189
|
+
nearest,
|
|
190
|
+
max(
|
|
191
|
+
0px,
|
|
192
|
+
calc(
|
|
193
|
+
var(--density-target-baseline-px, 0px) -
|
|
194
|
+
(var(--seat-line-floored) + 1cap) /
|
|
195
|
+
2 -
|
|
196
|
+
var(--form-input-border-width, 0px)
|
|
197
|
+
)
|
|
198
|
+
),
|
|
199
|
+
0.25px
|
|
200
|
+
);
|
|
201
|
+
--seat-after: max(
|
|
174
202
|
0px,
|
|
175
203
|
calc(
|
|
176
|
-
var(--density-
|
|
177
|
-
|
|
178
|
-
|
|
204
|
+
var(--density-line-height-effective) -
|
|
205
|
+
var(--seat-line-floored) -
|
|
206
|
+
var(--seat-before) -
|
|
207
|
+
2 *
|
|
179
208
|
var(--form-input-border-width, 0px)
|
|
180
209
|
)
|
|
181
|
-
)
|
|
182
|
-
0.25px
|
|
183
|
-
);
|
|
184
|
-
--seat-after: max(
|
|
185
|
-
0px,
|
|
186
|
-
calc(
|
|
187
|
-
var(--density-line-height-effective) -
|
|
188
|
-
var(--seat-line-floored) -
|
|
189
|
-
var(--seat-before) -
|
|
190
|
-
2 *
|
|
191
|
-
var(--form-input-border-width, 0px)
|
|
192
|
-
)
|
|
193
|
-
);
|
|
210
|
+
);
|
|
194
211
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
:is(.comfortable, .dense, .app, .site, .docs)
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
212
|
+
block-size: auto;
|
|
213
|
+
min-block-size: 0;
|
|
214
|
+
padding-block-end: var(--seat-after);
|
|
215
|
+
/* Stretch (not the box rule's flex-start): a prefix/suffix — the password's
|
|
216
|
+
reveal-toggle, the number's unit affix — spans the leaf's column and its
|
|
217
|
+
own `align-items: center` centres its icon on the TEXT, which is the
|
|
218
|
+
optical pairing (centring on the box would float it into the asymmetric
|
|
219
|
+
closing pad). The old fixed-height model needed flex-start to top-pin the
|
|
220
|
+
crushed leaf; the intrinsic leaf seats itself, so stretch is safe again. */
|
|
221
|
+
align-items: stretch;
|
|
222
|
+
}
|
|
223
|
+
:is(.comfortable, .dense, .app, .site, .docs)
|
|
224
|
+
.ds.input:is(.text, .number, .password, .phone)
|
|
225
|
+
> input {
|
|
226
|
+
line-height: var(--seat-line-floored);
|
|
227
|
+
padding-block-start: var(--seat-before);
|
|
228
|
+
padding-block-end: 0;
|
|
229
|
+
}
|
|
213
230
|
|
|
214
|
-
/* ── Textarea: many rows of the SAME intrinsic seat ──────────────────────────
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.textarea {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
231
|
+
/* ── Textarea: many rows of the SAME intrinsic seat ──────────────────────────
|
|
232
|
+
* The textarea is a single element (it carries the chrome itself), so it seats
|
|
233
|
+
* like the button: the interior line box is `--control-seat-line` — which is a
|
|
234
|
+
* WHOLE baseline multiple in every cell (cell − 2 bU) — so EVERY row advances
|
|
235
|
+
* one grid interval, not just the first. The complement pad closes the box so
|
|
236
|
+
* border + seat-before + N·line + seat-after + border ends on a grid line for
|
|
237
|
+
* ANY row count N: the N-independent part equals (cell − line) ≡ 0 (mod 1 bU).
|
|
238
|
+
* One seat, no multi-line special case.
|
|
239
|
+
*
|
|
240
|
+
* Two deliberate differences from the single-line input:
|
|
241
|
+
* · NO line-height floor — the UA's `normal` clamp is specific to single-line
|
|
242
|
+
* <input>; a textarea honours its specified line-height, and a floored
|
|
243
|
+
* 16.8px line would knock every dense row off the grid.
|
|
244
|
+
* · NO drift term — like the single-line input, the old ~2px knob was an
|
|
245
|
+
* artifact of the crush-era structure (see the drift note below).
|
|
246
|
+
*
|
|
247
|
+
* The previous revision seated the first row via --td-space-before ON TOP of
|
|
248
|
+
* the chrome's 8px block padding, targeting the OLD round(up) table; under the
|
|
249
|
+
* round(nearest) targets that formula clamps to zero in every cell (the full
|
|
250
|
+
* cell line-height puts the natural baseline below the target), which left the
|
|
251
|
+
* textarea unseated entirely. The interior line box makes the target reachable
|
|
252
|
+
* again. */
|
|
253
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.textarea {
|
|
254
|
+
line-height: var(--control-seat-line);
|
|
255
|
+
font-size: var(--typography-text-primary-font-size);
|
|
256
|
+
font-family: var(--typography-text-primary-font-family);
|
|
240
257
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
258
|
+
--seat-before: round(
|
|
259
|
+
nearest,
|
|
260
|
+
max(
|
|
261
|
+
0px,
|
|
262
|
+
calc(var(--control-seat-basis) - var(--form-input-border-width, 0px))
|
|
263
|
+
),
|
|
264
|
+
0.25px
|
|
265
|
+
);
|
|
266
|
+
--seat-after: max(
|
|
244
267
|
0px,
|
|
245
|
-
calc(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
var(--control-seat-line) -
|
|
254
|
-
var(--seat-before) -
|
|
255
|
-
2 *
|
|
256
|
-
var(--form-input-border-width, 0px)
|
|
257
|
-
)
|
|
258
|
-
);
|
|
268
|
+
calc(
|
|
269
|
+
var(--density-line-height-effective) -
|
|
270
|
+
var(--control-seat-line) -
|
|
271
|
+
var(--seat-before) -
|
|
272
|
+
2 *
|
|
273
|
+
var(--form-input-border-width, 0px)
|
|
274
|
+
)
|
|
275
|
+
);
|
|
259
276
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
277
|
+
block-size: auto;
|
|
278
|
+
padding-block: var(--seat-before) var(--seat-after);
|
|
279
|
+
/* Five whole rows + the closing geometry (border-box), so the default box
|
|
280
|
+
ends on-grid with the last row fully visible: 4·line + cell. */
|
|
281
|
+
min-block-size: calc(
|
|
282
|
+
4 *
|
|
283
|
+
var(--control-seat-line) +
|
|
284
|
+
var(--density-line-height-effective)
|
|
285
|
+
);
|
|
286
|
+
}
|
|
270
287
|
|
|
271
|
-
/* ── Select: a single-element direct chrome on the intrinsic seat ────────────
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.select {
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
/* ── Select: a single-element direct chrome on the intrinsic seat ────────────
|
|
289
|
+
* The <select> IS the chrome (border and text on one element), so it seats
|
|
290
|
+
* like the button: interior line box + seat pads, height emerging as exactly
|
|
291
|
+
* the density cell. Replaces the old fixed-height + 8px-block-padding path,
|
|
292
|
+
* which never seated the option text at all and CLIPPED it in apps/dense
|
|
293
|
+
* (24px fixed box − 8px pad left too little room for the line).
|
|
294
|
+
* The line is floored like the single-line input's: a <select> shows one line,
|
|
295
|
+
* so if the UA imposes a `normal` floor the formula already matches it, and if
|
|
296
|
+
* it does not the specified floor is simply what renders — correct either way
|
|
297
|
+
* (unlike the textarea, where flooring would break the multi-row rhythm).
|
|
298
|
+
* Remaining direct chromes (date/time/datetime) stay on the previous model
|
|
299
|
+
* until their own pass — their multi-part UA internals need their own
|
|
300
|
+
* measurement. */
|
|
301
|
+
:is(.comfortable, .dense, .app, .site, .docs) .ds.input.select {
|
|
302
|
+
--seat-line-floored: max(var(--control-seat-line), 1.2em);
|
|
303
|
+
line-height: var(--seat-line-floored);
|
|
287
304
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
305
|
+
--seat-before: round(
|
|
306
|
+
nearest,
|
|
307
|
+
max(
|
|
308
|
+
0px,
|
|
309
|
+
calc(
|
|
310
|
+
var(--density-target-baseline-px, 0px) -
|
|
311
|
+
(var(--seat-line-floored) + 1cap) /
|
|
312
|
+
2 -
|
|
313
|
+
var(--form-input-border-width, 0px)
|
|
314
|
+
)
|
|
315
|
+
),
|
|
316
|
+
0.25px
|
|
317
|
+
);
|
|
318
|
+
--seat-after: max(
|
|
291
319
|
0px,
|
|
292
320
|
calc(
|
|
293
|
-
var(--density-
|
|
294
|
-
|
|
295
|
-
|
|
321
|
+
var(--density-line-height-effective) -
|
|
322
|
+
var(--seat-line-floored) -
|
|
323
|
+
var(--seat-before) -
|
|
324
|
+
2 *
|
|
296
325
|
var(--form-input-border-width, 0px)
|
|
297
326
|
)
|
|
298
|
-
)
|
|
299
|
-
0.25px
|
|
300
|
-
);
|
|
301
|
-
--seat-after: max(
|
|
302
|
-
0px,
|
|
303
|
-
calc(
|
|
304
|
-
var(--density-line-height-effective) -
|
|
305
|
-
var(--seat-line-floored) -
|
|
306
|
-
var(--seat-before) -
|
|
307
|
-
2 *
|
|
308
|
-
var(--form-input-border-width, 0px)
|
|
309
|
-
)
|
|
310
|
-
);
|
|
327
|
+
);
|
|
311
328
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
329
|
+
block-size: auto;
|
|
330
|
+
min-block-size: 0;
|
|
331
|
+
padding-block: var(--seat-before) var(--seat-after);
|
|
332
|
+
}
|
|
316
333
|
|
|
317
|
-
/* ── Bottom rhythm: density-seated flow text only (NOT prose) ─────────────────
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
:is(.comfortable, .dense, .app, .site, .docs)
|
|
334
|
+
/* ── Bottom rhythm: density-seated flow text only (NOT prose) ─────────────────
|
|
335
|
+
* A BORDERED control (button, input wrapper) has a fixed `block-size` that is
|
|
336
|
+
* already a whole baseline multiple, so its bottom rhythm is the box height —
|
|
337
|
+
* no bottom padding needed (and it would be inert against the fixed height).
|
|
338
|
+
*
|
|
339
|
+
* The field label/description/error are density-seated with line-height:1, so
|
|
340
|
+
* their box ends at the text descender; with `padding-block-end: 0` a following
|
|
341
|
+
* grid/flow sibling (e.g. the textarea below a field label) resumes off-grid.
|
|
342
|
+
* Fill the box out to a whole density line-height so its bottom lands on a grid
|
|
343
|
+
* line. The `- 1em` term is correct precisely because these are line-height:1.
|
|
344
|
+
*
|
|
345
|
+
* Bare prose (p / .p / h1–h6) is NOT here: it is no longer density-seated (see the
|
|
346
|
+
* partition above), so its box is its OWN snapped line-height and the engine's
|
|
347
|
+
* --end-nudge already lands its bottom on the grid. Adding a density fill on top
|
|
348
|
+
* would double-pad. Prose bottom rhythm belongs to the engine / `.editorial`. */
|
|
349
|
+
:is(.comfortable, .dense, .app, .site, .docs)
|
|
333
350
|
:is(.ds.field-label, .ds.field-description, .ds.field-error) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
351
|
+
padding-block-end: max(
|
|
352
|
+
0px,
|
|
353
|
+
calc(
|
|
354
|
+
var(
|
|
355
|
+
--density-line-height,
|
|
356
|
+
var(--density-lh-comfy, calc(var(--baseline-height) * 8))
|
|
357
|
+
) -
|
|
358
|
+
var(--space-before) -
|
|
359
|
+
1em
|
|
360
|
+
)
|
|
361
|
+
);
|
|
362
|
+
}
|
|
346
363
|
|
|
347
|
-
/* ── The native-control text drift — RESOLVED for single-line inputs ──────────
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
364
|
+
/* ── The native-control text drift — RESOLVED for single-line inputs ──────────
|
|
365
|
+
* The old ~2px "native <input> renders its text lower than a <span> at
|
|
366
|
+
* byte-identical CSS" compensation (--control-text-drift-AVOID-USAGE) turned
|
|
367
|
+
* out to be an artifact of the line-height:1 crush structure, NOT an inherent
|
|
368
|
+
* UA quirk: with a real line box (line-height: --control-seat-line, the
|
|
369
|
+
* intrinsic seat above) the <input> positions its text exactly like a <span>
|
|
370
|
+
* (measured: input baseline == label baseline to 0.01px with no drift term).
|
|
371
|
+
* That answers TODO(#15)'s "find the structural cause and delete it": the
|
|
372
|
+
* intrinsic seat carries NO drift anywhere — the textarea's local copy went
|
|
373
|
+
* with its old parallel seat when it joined the intrinsic model. The knob no
|
|
374
|
+
* longer exists in this file. */
|
|
375
|
+
}
|