@surflane/css 0.17.0 → 0.19.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/controls.css CHANGED
@@ -24,10 +24,12 @@
24
24
  .surf-control-group {
25
25
  padding: 2px;
26
26
  }
27
+ /* An icon beside a segment's name keeps a step from it. */
27
28
  .surf-segment {
28
29
  display: inline-flex;
29
30
  align-items: center;
30
31
  justify-content: center;
32
+ gap: var(--surf-space-1);
31
33
  min-width: calc(var(--surf-control-height) - 6px);
32
34
  height: calc(var(--surf-control-height) - 6px);
33
35
  padding-inline: var(--surf-space-2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surflane/css",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "Surflane's CSS-only layer: control, layout composition, document typography and presentation classes that work without React, on top of @surflane/design-tokens.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -37,7 +37,7 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "peerDependencies": {
40
- "@surflane/design-tokens": "^0.17.0"
40
+ "@surflane/design-tokens": "^0.19.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -63,8 +63,10 @@
63
63
  color: var(--surf-ink);
64
64
  overflow-wrap: anywhere;
65
65
  }
66
- /* Stacked, and inline on a phone: each term above its value, a pair set apart from
67
- the next by its own padding rather than a row height. */
66
+ /* Stacked: each term above its value, a pair set apart from the next by its own
67
+ padding rather than a row height. On a phone inline pairs take that padding
68
+ too, but a pair stays on one row where it fits; only a value that does not
69
+ moves under its term. */
68
70
  .surf-description-list[data-layout='stacked'] .surf-description-list-item {
69
71
  min-block-size: 0;
70
72
  padding-block: var(--surf-description-list-stack-padding);
@@ -77,8 +79,10 @@
77
79
  min-block-size: 0;
78
80
  padding-block: var(--surf-description-list-stack-padding);
79
81
  }
80
- .surf-description-list .surf-description-list-term {
81
- flex-basis: 100%;
82
+ /* A value is as wide as its content: one that fits beside its term stays there,
83
+ and a longer one moves under it whole rather than breaking beside it. */
84
+ .surf-description-list .surf-description-list-value {
85
+ flex-basis: auto;
82
86
  }
83
87
  }
84
88
  .surf-description-list-value[data-empty] {
@@ -20,9 +20,31 @@
20
20
  min-height: var(--surf-space-6);
21
21
  align-self: stretch;
22
22
  }
23
+ /* A dot between values on one line: a point, not a boundary, sized with the text
24
+ it sits in and with room on each side. Its comma stays in the line, clipped and
25
+ transparent, so it is read and copied with its space but never seen; a hidden
26
+ element taken out of the flow would copy as line breaks. */
27
+ .surf-separator[data-variant='dot'] {
28
+ display: inline-block;
29
+ inline-size: 0.2em;
30
+ block-size: 0.2em;
31
+ min-height: 0;
32
+ margin-inline: var(--surf-space-2);
33
+ overflow: hidden;
34
+ align-self: center;
35
+ vertical-align: middle;
36
+ border-radius: var(--surf-radius-full);
37
+ background: var(--surf-ink-muted);
38
+ color: transparent;
39
+ line-height: 0;
40
+ white-space: pre;
41
+ }
23
42
  @media (forced-colors: active) {
24
43
  .surf-separator {
25
44
  background: CanvasText;
26
45
  }
46
+ .surf-separator[data-variant='dot'] {
47
+ forced-color-adjust: none;
48
+ }
27
49
  }
28
50
  }
@@ -7,7 +7,8 @@
7
7
  .surf-table {
8
8
  width: 100%;
9
9
  border-collapse: separate;
10
- border-spacing: 0 var(--surf-space-1);
10
+ --surf-table-row-space: var(--surf-space-1);
11
+ border-spacing: 0 var(--surf-table-row-space);
11
12
  font: inherit;
12
13
  color: var(--surf-ink-body);
13
14
  /* Columns size to whole words: break-word only splits a word that cannot fit,
@@ -155,12 +156,14 @@
155
156
  [data-density='compact'],
156
157
  :where([data-ui-density='compact'] :not([data-density]))
157
158
  ) {
158
- border-spacing: 0 2px;
159
+ --surf-table-row-space: 2px;
160
+ border-spacing: 0 var(--surf-table-row-space);
159
161
  }
160
162
  /* Lined, grid and striped rows meet edge to edge, square, so lines and stripes
161
163
  * run unbroken. Lines stay inside the table: none above the header, below the
162
164
  * last row or at its sides. */
163
165
  .surf-table[data-variant] {
166
+ --surf-table-row-space: 0px;
164
167
  border-spacing: 0;
165
168
  }
166
169
  .surf-table[data-variant] > .surf-table-body > .surf-table-row > * {
@@ -234,7 +237,9 @@
234
237
  > .surf-table-row
235
238
  > .surf-table-cell {
236
239
  position: sticky;
237
- inset-block-start: 0;
240
+ /* A header of more rows stacks them: the Container measures where each row
241
+ sits under the ones above it. */
242
+ inset-block-start: var(--surf-table-sticky-top, 0px);
238
243
  z-index: 1;
239
244
  background: var(
240
245
  --surf-table-surface,
@@ -242,6 +247,20 @@
242
247
  );
243
248
  box-shadow: inset 0 -1px var(--surf-line);
244
249
  }
250
+ /* A lower header row covers the space between it and the row above, so nothing
251
+ that scrolls under the header shows between its rows. */
252
+ .surf-table[data-sticky-header]
253
+ > .surf-table-head
254
+ > .surf-table-row
255
+ + .surf-table-row
256
+ > .surf-table-cell::before {
257
+ content: '';
258
+ position: absolute;
259
+ inset-inline: 0;
260
+ inset-block-end: 100%;
261
+ block-size: var(--surf-table-row-space);
262
+ background: inherit;
263
+ }
245
264
  /* A sticky first column stays at the inline start while the rest scrolls under it,
246
265
  * on the surface behind the table. The fill has no specificity, so a stripe or a
247
266
  * selection still paints over it. Under a sticky header the header sits above the
@@ -277,6 +296,31 @@
277
296
  > :first-child {
278
297
  z-index: 3;
279
298
  }
299
+ /* When the first header cell spans the header's rows, the first cell of a lower
300
+ header row is a data column's: it scrolls with the rest. */
301
+ .surf-table[data-sticky-column]:has(
302
+ > .surf-table-head
303
+ > .surf-table-row:first-child
304
+ > :first-child[rowspan]:not([rowspan='1'])
305
+ )
306
+ > .surf-table-head
307
+ > .surf-table-row
308
+ + .surf-table-row
309
+ > :first-child {
310
+ inset-inline-start: auto;
311
+ z-index: 2;
312
+ }
313
+ .surf-table[data-sticky-column]:has(
314
+ > .surf-table-head
315
+ > .surf-table-row:first-child
316
+ > :first-child[rowspan]:not([rowspan='1'])
317
+ )
318
+ > .surf-table-head
319
+ > .surf-table-row
320
+ + .surf-table-row
321
+ > :first-child::after {
322
+ display: none;
323
+ }
280
324
  /* Once rows pass under the column, a line marks its edge. */
281
325
  .surf-table[data-sticky-column]
282
326
  > :is(.surf-table-head, .surf-table-body, .surf-table-foot)