@slotted/styles 0.1.0-beta.1 → 0.1.0-beta.2

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.1",
3
+ "version": "0.1.0-beta.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -787,6 +787,20 @@
787
787
  * content card begins, and nothing to its left.
788
788
  */
789
789
  [data-ui='app-shell'][data-canvas='inset'] > [data-part='nav'] {
790
+ /* The navigation stands on the sunken frame, which the secondary tone's
791
+ hover is 0.011 lighter than in the light scheme: a row's hover was the
792
+ frame itself. Both steps are recomputed from the ground it stands on. */
793
+ --slotted-tone-secondary-subtle-hover: color-mix(
794
+ in oklab,
795
+ var(--slotted-app-shell-nav-surface, var(--_frame)),
796
+ var(--slotted-text) 4%
797
+ );
798
+ --slotted-tone-secondary-subtle-active: color-mix(
799
+ in oklab,
800
+ var(--slotted-app-shell-nav-surface, var(--_frame)),
801
+ var(--slotted-text) 7%
802
+ );
803
+
790
804
  /* Invisible on the transparent default; a product that paints the column
791
805
  gets a region with the plane's corners rather than a square block. */
792
806
  border-radius: var(--_radius);
@@ -746,6 +746,18 @@
746
746
 
747
747
  /* ── Options ──────────────────────────────────────────────────────────── */
748
748
 
749
+ /**
750
+ * An option the query rejected, and a group whose options all went. Both
751
+ * carry `hidden` — Angular hides each rejected option rather than leaving the
752
+ * list, and both bindings hide an emptied group — and `display: grid` on
753
+ * either beats the user agent's own `[hidden] { display: none }`, because an
754
+ * author rule wins over the user agent sheet.
755
+ */
756
+ [data-ui='combobox'] [data-part='item'][hidden],
757
+ [data-ui='combobox'] [data-part='group'][hidden] {
758
+ display: none;
759
+ }
760
+
749
761
  [data-ui='combobox'] [data-part='item'] {
750
762
  align-content: center;
751
763
  border-radius: var(--_item-radius);
@@ -350,8 +350,11 @@
350
350
  }
351
351
 
352
352
  /* While a widget is carried or pulled the lattice is what it snaps to, so
353
- it comes forward. */
354
- [data-ui='dashboard-grid'][data-gesture] > [data-part='grid']::before {
353
+ it comes forward. The attribute is on the grid, in the compound it styles:
354
+ a browser invalidates by attribute name, and on the root ahead of
355
+ `> [data-part='grid']` it restyled every element with a `data-part`
356
+ under the root as a widget was picked up and as it was dropped. */
357
+ [data-ui='dashboard-grid'] > [data-part='grid'][data-gesture]::before {
355
358
  opacity: 1;
356
359
  }
357
360
 
@@ -654,20 +657,18 @@
654
657
  /* ── Editing: a widget in hand ───────────────────────────────────────── */
655
658
 
656
659
  /**
657
- * A widget carried or pulled leaves its cell and floats over the grid: it
658
- * is placed where it was picked up, `--_dg-origin-*`, and follows the pointer
659
- * by `--_dg-lift-*`, all written by script. The cell it would land in is the
660
- * placeholder, and the widgets around it make room as the placeholder moves.
660
+ * A widget carried or pulled leaves its cell and floats over the grid. The
661
+ * script writes where it was picked up (`inset-inline-start`,
662
+ * `inset-block-start`, `inline-size`, `block-size`) and how far the pointer
663
+ * took it (`translate`) on the widget itself. A custom property in their
664
+ * place restyled everything under the widget on every frame. The cell it
665
+ * would land in is the placeholder, and the widgets around it make room as
666
+ * the placeholder moves.
661
667
  */
662
668
  [data-ui='dashboard-grid'] [data-part='widget']:is([data-dragging], [data-resizing]) {
663
- block-size: var(--_dg-origin-block-size);
664
669
  grid-column: auto;
665
670
  grid-row: auto;
666
- inline-size: var(--_dg-origin-inline-size);
667
- inset-block-start: var(--_dg-origin-block-start);
668
- inset-inline-start: var(--_dg-origin-inline-start);
669
671
  position: absolute;
670
- translate: var(--_dg-lift-x, 0) var(--_dg-lift-y, 0);
671
672
  z-index: 3;
672
673
  }
673
674
 
@@ -746,3 +747,37 @@
746
747
  min-block-size: calc(var(--_row) * 2 + var(--_gap));
747
748
  }
748
749
  }
750
+
751
+ /**
752
+ * A widget's cell, written on the widget by script and read only by the
753
+ * widget's own placement. Unregistered, each one inherited into the card and
754
+ * everything in it, and a preview that moved a widget restyled its whole
755
+ * content. Registered without inheritance and without a type, a widget no
756
+ * script placed still takes the fallback of `var()`. These sit outside
757
+ * `@layer slotted.components` because `@property` is a registration, not a
758
+ * rule a cascade layer holds.
759
+ */
760
+ @property --_dg-x {
761
+ syntax: '*';
762
+ inherits: false;
763
+ }
764
+
765
+ @property --_dg-y {
766
+ syntax: '*';
767
+ inherits: false;
768
+ }
769
+
770
+ @property --_dg-w {
771
+ syntax: '*';
772
+ inherits: false;
773
+ }
774
+
775
+ @property --_dg-h {
776
+ syntax: '*';
777
+ inherits: false;
778
+ }
779
+
780
+ @property --_dg-span-medium {
781
+ syntax: '*';
782
+ inherits: false;
783
+ }
@@ -323,6 +323,9 @@
323
323
  touch-action: none;
324
324
  transition: color var(--slotted-control-transition-duration)
325
325
  var(--slotted-control-transition-easing);
326
+ /* Its own bidi run: as a flex container its text is a new block, and a
327
+ mark of more than one character read backwards in a right-to-left page. */
328
+ unicode-bidi: plaintext;
326
329
  user-select: none;
327
330
  -webkit-user-select: none;
328
331
  }
@@ -123,8 +123,9 @@
123
123
  * scheme instead, because the ink is the far end of each scheme's own
124
124
  * range. Twenty-four per cent is measured rather than chosen: it is the
125
125
  * lowest ratio at which the track separates from the page in all three
126
- * schemes at the 2-pixel `sm` thickness, and low enough that a column of
127
- * bars does not read as a column of filled bars.
126
+ * schemes at a 2-pixel bar, half the thinnest one this family draws,
127
+ * and low enough that a column of bars does not read as a column of
128
+ * filled bars.
128
129
  */
129
130
  --_track-color: var(
130
131
  --slotted-progress-indicator-track-color,
@@ -152,14 +153,14 @@
152
153
  --_font-size: var(--slotted-control-font-size-md, 13px);
153
154
  --_text-gap: var(--slotted-space-4, 0.5rem);
154
155
  --_row-gap: var(--slotted-space-3, 0.375rem);
155
- --_thickness: var(--slotted-progress-indicator-thickness, var(--slotted-space-2, 0.25rem));
156
+ --_thickness: var(--slotted-progress-indicator-thickness, var(--slotted-space-3, 0.375rem));
156
157
  --_size: var(--slotted-progress-indicator-size, var(--slotted-control-height-md, 34px));
157
158
  --_radius: var(--slotted-progress-indicator-radius, var(--slotted-radius-full, 9999px));
158
159
  /**
159
160
  * M3's indicator–track gap, and the stop indicator's diameter, are both
160
161
  * 4dp at the 4dp track. Making them one thickness is the proportional form
161
- * of that decision rather than a copy of the number: a 4-pixel gap in a
162
- * 2-pixel bar would be wider than the bar is tall.
162
+ * of that decision rather than a copy of the number: a fixed 4-pixel gap
163
+ * would be the whole `sm` bar and half the `lg` one.
163
164
  */
164
165
  --_gap: var(--slotted-progress-indicator-gap, var(--_thickness));
165
166
 
@@ -278,7 +279,7 @@
278
279
  /* ── Size ─────────────────────────────────────────────────────────────
279
280
  *
280
281
  * One axis, three geometries. The bar reads a thickness from the space
281
- * scale — 2, 4 and 8 pixels, and M3's own default track is the middle one —
282
+ * scale — 4, 6 and 8 pixels, so no step draws a hairline in a table cell —
282
283
  * while the circle and the loader read the control height scale, so a
283
284
  * spinner standing beside a button is the same height as the button at
284
285
  * every density. Neither needs a scale of this family's own, and the
@@ -288,7 +289,7 @@
288
289
  [data-ui='progress-indicator'][data-part='root'][data-size='sm'] {
289
290
  --_font-size: var(--slotted-control-font-size-sm, 12px);
290
291
  --_text-gap: var(--slotted-space-3, 0.375rem);
291
- --_thickness: var(--slotted-progress-indicator-thickness, var(--slotted-space-1, 0.125rem));
292
+ --_thickness: var(--slotted-progress-indicator-thickness, var(--slotted-space-2, 0.25rem));
292
293
  --_size: var(--slotted-progress-indicator-size, var(--slotted-control-height-sm, 30px));
293
294
  }
294
295
 
@@ -35,7 +35,6 @@
35
35
  "--slotted-progress-indicator-wave-phase",
36
36
  "--slotted-radius-full",
37
37
  "--slotted-radius-none",
38
- "--slotted-space-1",
39
38
  "--slotted-space-2",
40
39
  "--slotted-space-3",
41
40
  "--slotted-space-4",
@@ -383,6 +383,24 @@
383
383
  margin-inline-start: auto;
384
384
  }
385
385
 
386
+ /* On a finger the card's one control is a full target among 44-pixel
387
+ controls: a transparent `::before` centred on the link or button — the
388
+ part itself when `render` made it one — reaches
389
+ the comfortable size in both axes, and the header keeps its height. */
390
+ @media (pointer: coarse) {
391
+ [data-ui='stat-card']
392
+ :is([data-part='action']:is(a, button), [data-part='action'] > :is(a, button)) {
393
+ position: relative;
394
+ }
395
+
396
+ [data-ui='stat-card']
397
+ :is([data-part='action']:is(a, button), [data-part='action'] > :is(a, button))::before {
398
+ content: '';
399
+ inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
400
+ position: absolute;
401
+ }
402
+ }
403
+
386
404
  /* ── Figure: the value, its unit, the delta ───────────────────────────── */
387
405
 
388
406
  /**
@@ -85,6 +85,7 @@
85
85
  "--slotted-stat-card-value-line-height-sm",
86
86
  "--slotted-surface-raised",
87
87
  "--slotted-surface-sunken",
88
+ "--slotted-target-comfortable",
88
89
  "--slotted-text",
89
90
  "--slotted-text-muted",
90
91
  "--slotted-tone-accent-text",
package/src/tabs/tabs.css CHANGED
@@ -631,12 +631,14 @@
631
631
  * through `aria-keyshortcuts`.
632
632
  *
633
633
  * It is aligned by its mark rather than by its box. The box overhangs the X
634
- * on every side, so a box set flush against the label leaves a hole where the
635
- * overhang is; both margins take the overhang back, which puts the mark one
636
- * inner gap from the last letter and the tab's own inset from the end of the
637
- * item. The first capture showed the other arrangement: a square the height of
638
- * the control, hard against the words, with the whole tab's padding on the
639
- * far side of it.
634
+ * on every side, and both margins take the overhang back, which puts the mark
635
+ * the tab's own inset from the last letter and from the end of the item. An
636
+ * inner gap before the mark left the round ground of the hover touching the
637
+ * words; the first capture showed a square the height of the control, hard
638
+ * against the words, with the whole tab's padding on the far side of it.
639
+ *
640
+ * Neutral, as the dialog's close and the paging controls: removing a tab
641
+ * closes a view and destroys nothing, so the danger tone overstated it.
640
642
  */
641
643
  [data-ui='tabs']
642
644
  > :where([data-part='list'])
@@ -650,7 +652,7 @@
650
652
  background-color: transparent;
651
653
  block-size: var(--_dismiss-size);
652
654
  border: 0;
653
- border-radius: var(--slotted-control-radius, 4px);
655
+ border-radius: var(--slotted-radius-full, 9999px);
654
656
  color: var(--slotted-tabs-dismiss-color, var(--slotted-text-muted, GrayText));
655
657
  cursor: pointer;
656
658
  display: inline-flex;
@@ -658,7 +660,7 @@
658
660
  inline-size: var(--_dismiss-size);
659
661
  justify-content: center;
660
662
  margin-inline-end: calc(var(--_padding-inline) - var(--_dismiss-overhang));
661
- margin-inline-start: max(0px, calc(var(--_inner-gap) - var(--_dismiss-overhang)));
663
+ margin-inline-start: calc(var(--_padding-inline) - var(--_dismiss-overhang));
662
664
  padding: 0;
663
665
  transition:
664
666
  background-color var(--slotted-control-transition-duration)
@@ -693,9 +695,9 @@
693
695
  > [data-part='dismiss']:not(:disabled):hover {
694
696
  background-color: var(
695
697
  --slotted-tabs-dismiss-hover-background,
696
- var(--slotted-tone-danger-surface)
698
+ var(--slotted-tone-secondary-subtle-hover)
697
699
  );
698
- color: var(--slotted-tabs-dismiss-hover-color, var(--slotted-tone-danger-text));
700
+ color: var(--slotted-tabs-dismiss-hover-color, var(--slotted-text, CanvasText));
699
701
  }
700
702
 
701
703
  [data-ui='tabs']
@@ -704,9 +706,9 @@
704
706
  > [data-part='dismiss']:not(:disabled):active {
705
707
  background-color: var(
706
708
  --slotted-tabs-dismiss-active-background,
707
- var(--slotted-tone-danger-border)
709
+ var(--slotted-tone-secondary-subtle-active)
708
710
  );
709
- color: var(--slotted-tabs-dismiss-active-color, var(--slotted-text-inverse));
711
+ color: var(--slotted-tabs-dismiss-active-color, var(--slotted-text, CanvasText));
710
712
  }
711
713
 
712
714
  [data-ui='tabs']
@@ -36,6 +36,7 @@
36
36
  "--slotted-focus-ring-color",
37
37
  "--slotted-focus-ring-offset",
38
38
  "--slotted-focus-ring-width",
39
+ "--slotted-radius-full",
39
40
  "--slotted-radius-md",
40
41
  "--slotted-radius-sm",
41
42
  "--slotted-radius-xs",
@@ -70,13 +71,9 @@
70
71
  "--slotted-target-comfortable",
71
72
  "--slotted-target-min",
72
73
  "--slotted-text",
73
- "--slotted-text-inverse",
74
74
  "--slotted-text-muted",
75
75
  "--slotted-tone-accent-solid",
76
76
  "--slotted-tone-accent-text",
77
- "--slotted-tone-danger-border",
78
- "--slotted-tone-danger-surface",
79
- "--slotted-tone-danger-text",
80
77
  "--slotted-tone-secondary-subtle-active",
81
78
  "--slotted-tone-secondary-subtle-hover"
82
79
  ]