@slotted/styles 0.1.0-beta.24 → 0.1.0-beta.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slotted/styles",
3
- "version": "0.1.0-beta.24",
3
+ "version": "0.1.0-beta.26",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -94,6 +94,21 @@
94
94
  min-inline-size: 0;
95
95
  }
96
96
 
97
+ /**
98
+ * The width says what the field expects: the control stands no wider than
99
+ * the step, and still shrinks with a narrower field. The control is the
100
+ * child that is another family's root, or the part a consumer wrote.
101
+ */
102
+ [data-ui-field][data-part-root][data-width='short']
103
+ > :is([data-part-control], [data-ui]:not([data-ui-inline-message])) {
104
+ max-inline-size: var(--slotted-field-width-short, 6rem);
105
+ }
106
+
107
+ [data-ui-field][data-part-root][data-width='medium']
108
+ > :is([data-part-control], [data-ui]:not([data-ui-inline-message])) {
109
+ max-inline-size: var(--slotted-field-width-medium, 15rem);
110
+ }
111
+
97
112
  /* ── Size ─────────────────────────────────────────────────────────────
98
113
  *
99
114
  * Three steps, matching the control the field wraps. Fluent ships the same
@@ -36,6 +36,8 @@
36
36
  "--slotted-field-mark-gap",
37
37
  "--slotted-field-mark-text-color",
38
38
  "--slotted-field-row-gap",
39
+ "--slotted-field-width-medium",
40
+ "--slotted-field-width-short",
39
41
  "--slotted-focus-ring-color",
40
42
  "--slotted-focus-ring-offset",
41
43
  "--slotted-focus-ring-width",
package/src/form/form.css CHANGED
@@ -165,6 +165,70 @@
165
165
  margin-block-start: var(--slotted-form-field-gap, var(--slotted-space-6, 1rem));
166
166
  }
167
167
 
168
+ /**
169
+ * Two sections stand apart by a step larger than the one between two fields
170
+ * of a section: at the same 1rem, a form split into topics showed none.
171
+ */
172
+ [data-ui-form][data-part-root] > [data-ui-field-group] + [data-ui-field-group] {
173
+ margin-block-start: var(--slotted-form-section-gap, var(--slotted-space-9, 2rem));
174
+ }
175
+
176
+ /**
177
+ * One column at a bounded measure: a field never spans a wide page, and the
178
+ * summary and the actions end where the fields end.
179
+ */
180
+ [data-ui-form][data-part-root]
181
+ > :is(
182
+ [data-ui-field],
183
+ [data-ui-field-group],
184
+ [data-ui-form][data-part-summary],
185
+ [data-ui-form][data-part-actions]
186
+ ) {
187
+ max-inline-size: var(--slotted-form-measure, 40rem);
188
+ }
189
+
190
+ /* ── The aside ────────────────────────────────────────────────────────
191
+ *
192
+ * A form that holds one is a grid of one column at the measure. The aside's
193
+ * track is implicit: it exists only once the aside is placed in it, which
194
+ * happens from the form's own breakpoint, because the root cannot change its
195
+ * template under a query on itself. Below it the aside follows in source
196
+ * order, after the last field when it is written there.
197
+ */
198
+ [data-ui-form][data-part-root]:has(> [data-ui-form][data-part-aside]) {
199
+ column-gap: var(--slotted-space-9, 2rem);
200
+ display: grid;
201
+ grid-auto-columns: minmax(0, var(--slotted-form-aside-size, 20rem));
202
+ grid-template-columns: minmax(0, var(--slotted-form-measure, 40rem));
203
+ justify-content: space-between;
204
+ }
205
+
206
+ [data-ui-form][data-part-aside] {
207
+ margin-block-start: var(--slotted-form-section-gap, var(--slotted-space-9, 2rem));
208
+ min-inline-size: 0;
209
+ }
210
+
211
+ /**
212
+ * Beside the column, every child of the form keeps to the first track and
213
+ * the aside spans the rows they fill, so it stays in view under the page's
214
+ * chrome while the fields scroll. shortcut: the span covers 100 children of
215
+ * the form; past them the aside stops following.
216
+ */
217
+ @container slotted-form (min-width: 75rem) {
218
+ [data-ui-form][data-part-root]:has(> [data-ui-form][data-part-aside]) > * {
219
+ grid-column: 1;
220
+ }
221
+
222
+ [data-ui-form][data-part-root] > [data-ui-form][data-part-aside] {
223
+ align-self: start;
224
+ grid-column: 2;
225
+ grid-row: 1 / span 100;
226
+ inset-block-start: calc(var(--slotted-page-sticky-top, 0px) + var(--slotted-space-6, 1rem));
227
+ margin-block-start: 0;
228
+ position: sticky;
229
+ }
230
+ }
231
+
168
232
  /* ── The action row ───────────────────────────────────────────────────
169
233
  *
170
234
  * Its own container, because the question it answers is how much room the
@@ -9,8 +9,11 @@
9
9
  "--slotted-font-family-heading",
10
10
  "--slotted-font-family-sans",
11
11
  "--slotted-font-weight-semibold",
12
+ "--slotted-form-aside-size",
12
13
  "--slotted-form-color",
13
14
  "--slotted-form-field-gap",
15
+ "--slotted-form-measure",
16
+ "--slotted-form-section-gap",
14
17
  "--slotted-form-summary-background",
15
18
  "--slotted-form-summary-border-color",
16
19
  "--slotted-form-summary-color",
@@ -26,6 +29,7 @@
26
29
  "--slotted-space-5",
27
30
  "--slotted-space-6",
28
31
  "--slotted-space-8",
32
+ "--slotted-space-9",
29
33
  "--slotted-text",
30
34
  "--slotted-tone-danger-border",
31
35
  "--slotted-tone-danger-surface",