@skirbi/pinta 0.0.29 → 0.0.31

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.
@@ -483,6 +483,7 @@
483
483
  */
484
484
 
485
485
  [skirbi-theme] {
486
+
486
487
  /**
487
488
  * @styles pinta.color-families Color families
488
489
  * @description
@@ -623,6 +624,7 @@
623
624
  * | Token | Purpose |
624
625
  * | --- | --- |
625
626
  * | `--skirbi-font-sans` | Default sans-serif font stack. |
627
+ * | `--skirbi-font-headers` | The same as font-sans |
626
628
  * | `--skirbi-font-mono` | Default monospace font stack. |
627
629
  * | `--skirbi-font-scale` | Base font scale multiplier. |
628
630
  * | `--skirbi-line-height` | Base line-height. |
@@ -636,7 +638,7 @@
636
638
  */
637
639
 
638
640
  /* Typography knobs */
639
- --skirbi-font-sans: ui-sans-serif, system-ui, -apple-system,
641
+ --skirbi-font-defaults: ui-sans-serif, system-ui, -apple-system,
640
642
  "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji",
641
643
  "Segoe UI Emoji";
642
644
  --skirbi-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco,
@@ -650,6 +652,9 @@
650
652
  --skirbi-prose-gap: 1.25rem;
651
653
  --skirbi-heading-line-height: 1.2;
652
654
  --skirbi-heading-tracking: -0.01em;
655
+ --skirbi-font-sans: var(--skirbi-font-defaults);
656
+ --skirbi-font-headers: var(--skirbi-font-header-defaults);
657
+
653
658
 
654
659
  @media (max-width: 48rem) {
655
660
  --skirbi-font-scale: 1;
@@ -660,6 +665,10 @@
660
665
  }
661
666
 
662
667
 
668
+ /* Diptych layout */
669
+ --skirbi-diptych-aside: 16rem;
670
+ --skirbi-diptych-gap: clamp(1rem, 2vw, 2rem);
671
+
663
672
  /* Triptych layout */
664
673
  --skirbi-triptych-content: 110ch;
665
674
  --skirbi-triptych-aside: 16rem;
@@ -956,16 +965,8 @@
956
965
  color: var(--skirbi-page-fg, var(--skirbi-on-light, #0f172a));
957
966
 
958
967
  /* Typography application */
959
- font-family: var(
960
- --skirbi-font-sans,
961
- ui-sans-serif,
962
- system-ui,
963
- -apple-system,
964
- "Segoe UI",
965
- Roboto,
966
- Helvetica,
967
- Arial
968
- );
968
+ font-family: var(--skirbi-font-sans);
969
+
969
970
  font-size: calc(16px * var(--skirbi-font-scale, 1));
970
971
  line-height: var(--skirbi-line-height, 1.55);
971
972
 
@@ -999,6 +1000,11 @@
999
1000
  font-size: 0.95em;
1000
1001
  }
1001
1002
 
1003
+
1004
+ :where(h1, h2, h3, h4, h5, h6) {
1005
+ font-family: var(--skirbi-font-headers);
1006
+ }
1007
+
1002
1008
  :where(pre) {
1003
1009
  padding: 1rem;
1004
1010
  border: 1px solid var(--skirbi-surface-border-final);
@@ -1047,6 +1053,7 @@
1047
1053
  --skirbi-success-base: #0f766e;
1048
1054
  --skirbi-warn-base: #d97706;
1049
1055
  --skirbi-error-base: #b91c1c;
1056
+
1050
1057
  }
1051
1058
  }
1052
1059
 
@@ -1064,21 +1071,20 @@
1064
1071
 
1065
1072
  @layer skirbi-components {
1066
1073
 
1067
- /**
1068
- * @styles pinta.semtic-panel-tile Semtic panel and tile
1069
- * @description
1070
- *
1071
- * Light surface recipes for `<semtic-panel>` and `<semtic-tile>`.
1072
- *
1073
- * They use final surface tokens and remain easy to override:
1074
- *
1075
- * ```css
1076
- * semtic-panel[login-card] {
1077
- * max-width: 28rem;
1078
- * }
1079
- * ```
1080
- */
1081
-
1074
+ /**
1075
+ * @styles pinta.semtic-panel-tile Semtic panel and tile
1076
+ * @description
1077
+ *
1078
+ * Light surface recipes for `<semtic-panel>` and `<semtic-tile>`.
1079
+ *
1080
+ * They use final surface tokens and remain easy to override:
1081
+ *
1082
+ * ```css
1083
+ * semtic-panel[login-card] {
1084
+ * max-width: 28rem;
1085
+ * }
1086
+ * ```
1087
+ */
1082
1088
  /* semtic-panel / semtic-tile */
1083
1089
  [skirbi-theme] {
1084
1090
  :is(semtic-panel, semtic-tile) {
@@ -1628,36 +1634,95 @@
1628
1634
  color: var(--skirbi-primary-main);
1629
1635
  }
1630
1636
 
1631
- /* Toolbar (search) */
1637
+ /* Toolbar: search on the left, per-page on the right. Both decide what
1638
+ * the query returns, which is why they sit together above the table
1639
+ * rather than with the pager, which only moves through the result. */
1640
+ /* Both the panel and the section it renders: the controls are children
1641
+ * of the section, so that is what has to be the flex container, and the
1642
+ * panel is laid out the same way for the moment before it renders. */
1643
+ [semtic-table-toolbar],
1644
+ [semtic-table-toolbar] > section {
1645
+ margin-bottom: 0;
1646
+ display: flex;
1647
+ flex-wrap: wrap;
1648
+ align-items: center;
1649
+ gap: 0.75rem;
1650
+
1651
+ /* The search box takes the slack, so the two selectors stay together
1652
+ * on the right instead of drifting with its width. */
1653
+ > [semtic-table-search] {
1654
+ margin-inline-end: auto;
1655
+ }
1656
+ }
1657
+
1632
1658
  [semtic-table-toolbar] {
1633
1659
  margin-bottom: 0.75rem;
1634
1660
  }
1635
1661
 
1636
- [semtic-table-search] {
1637
- width: 100%;
1638
- padding: 0.5rem 0.75rem;
1639
- border: 1px solid var(--skirbi-surface-border-final);
1640
- border-radius: 0.375rem;
1641
- background: var(--skirbi-surface-bg-final);
1642
- color: inherit;
1643
- font-size: inherit;
1662
+ /* Size to their own content rather than sharing the row equally: a
1663
+ * per-page list of two-digit numbers does not need the same width as a
1664
+ * page list running into the hundreds. */
1665
+ :is([semtic-table-page-jump], [semtic-table-page-size]) {
1666
+ flex: 0 0 auto;
1667
+ }
1668
+
1669
+ /* A form control always renders its error span, empty or not, so that
1670
+ * label-error-position has something to place. In a form that costs
1671
+ * nothing -- the row is empty and every field pays it equally. Here the
1672
+ * control is sitting next to buttons that have no such row, so the grid
1673
+ * gap under it pushed the visible box up off their centre line by half
1674
+ * a gap. Dropping the empty row is safe for placement: these two are
1675
+ * never going to show a validation error.
1676
+ */
1677
+ :is([semtic-table-page-jump], [semtic-table-page-size]) [semtic-error]:empty {
1678
+ display: none;
1644
1679
  }
1645
1680
 
1646
- /* Pagination */
1681
+ /* Pagination
1682
+ *
1683
+ * Three parts, in reading order: what you are looking at, how much of
1684
+ * it to show, and how to move. The summary takes the slack so the
1685
+ * controls stay together on the right and do not shift as the numbers
1686
+ * in it change width. Wraps rather than overflows on a narrow table.
1687
+ */
1647
1688
  tfoot td {
1648
1689
  padding-top: 0.75rem;
1649
1690
  display: flex;
1691
+ flex-wrap: wrap;
1650
1692
  align-items: center;
1651
1693
  gap: 0.75rem;
1652
1694
  }
1653
1695
 
1654
- [semtic-table-page-info] {
1696
+ /* Prose about the table, so it takes the quieter, smaller treatment --
1697
+ * and the slack, so the pager stays right as the numbers in it change
1698
+ * width. The two selectors are controls, not prose, and keep the size
1699
+ * every other control has: shrinking them made them visibly shorter
1700
+ * than the search box they share a row with. */
1701
+ [semtic-table-summary] {
1702
+ margin-inline-end: auto;
1655
1703
  font-size: 0.875rem;
1656
1704
  color: var(--skirbi-text-muted-final);
1657
1705
  }
1658
1706
 
1659
- /* Loading state */
1660
- [semtic-table-root][semtic-loading] {
1707
+ /* The step buttons and the page selector are different heights -- a
1708
+ * button is padded text, the selector is a full form control with a
1709
+ * label beside it -- so they are centred against each other rather than
1710
+ * sharing a top or a baseline. align-self on the children as well as
1711
+ * align-items on the box, because a stretch coming from anywhere else
1712
+ * would otherwise decide this instead. */
1713
+ [semtic-table-pager] {
1714
+ display: flex;
1715
+ align-items: center;
1716
+ gap: 0.75rem;
1717
+
1718
+ > * {
1719
+ align-self: center;
1720
+ }
1721
+ }
1722
+
1723
+ /* Loading state. On the host now -- there used to be a wrapper div
1724
+ * inside semtic-table whose only job was to carry this attribute. */
1725
+ &[semtic-loading] {
1661
1726
  opacity: 0.6;
1662
1727
  pointer-events: none;
1663
1728
  }
@@ -1761,7 +1826,21 @@
1761
1826
  object-fit: cover;
1762
1827
  }
1763
1828
 
1829
+ @media (max-width: 36rem) {
1830
+ & semtic-nav [semtic-nav-avatar] {
1831
+ aspect-ratio: 1/1;
1832
+ }
1833
+ }
1834
+
1835
+ semtic-nav [semtic-nav-avatar][hero-image='banner'] {
1836
+ width: auto;
1837
+ height: clamp(2rem, 5vw, 4rem);
1838
+ max-height: 12rem;
1839
+ border-radius: 0;
1840
+ }
1841
+
1764
1842
  semtic-nav [semtic-nav-title] {
1843
+ font-family: var(--skirbi-font-headers);
1765
1844
  font-weight: 700;
1766
1845
  font-size: 1rem;
1767
1846
  letter-spacing: -0.01em;
@@ -1823,26 +1902,60 @@
1823
1902
  }
1824
1903
  }
1825
1904
 
1826
- /* semtic-nav-item */
1905
+ /* semtic-nav-item / semtic-nav-item-group */
1827
1906
  [skirbi-theme] {
1828
1907
  semtic-nav-item > li {
1829
1908
  list-style: none;
1830
1909
  display: inline-flex;
1831
1910
  }
1832
1911
 
1833
- semtic-nav-item [semtic-nav-link] {
1912
+ /* Group <li> holds the header link AND the children <ul> — those must
1913
+ stack vertically, not sit side-by-side as inline-flex row items. */
1914
+ semtic-nav-item-group > li {
1915
+ list-style: none;
1834
1916
  display: flex;
1835
- align-items: center;
1917
+ flex-direction: column;
1918
+ align-items: stretch;
1919
+ }
1920
+
1921
+ :is(semtic-nav-item, semtic-nav-item-group) [semtic-nav-link] {
1922
+ display: flex;
1923
+
1924
+ /* Start, not center: a label that wraps to two lines would otherwise
1925
+ * center the marker against the whole block, leaving it floating
1926
+ * between the lines instead of sitting with the first one. */
1927
+ align-items: flex-start;
1928
+
1929
+ /* The button recipe sets nowrap and clips the overflow, so a group
1930
+ * header longer than the sidenav was cut off rather than wrapped.
1931
+ * break-word covers the case a single token is wider than the column,
1932
+ * which nothing else can rescue. */
1933
+ white-space: normal;
1934
+ overflow-wrap: break-word;
1935
+ overflow: visible;
1936
+
1937
+ /* A group header with no href renders as a <button>, so it picks up the
1938
+ * button recipe -- which centers its content. Combined with the
1939
+ * width: 100% below, that centered a group's label in the row instead
1940
+ * of starting it where every other label starts. The rest of that
1941
+ * recipe is already undone further down (text-transform, letter-spacing,
1942
+ * background, border, font); this is the piece that was missed. */
1943
+ justify-content: flex-start;
1944
+
1836
1945
  gap: 0.375rem;
1837
1946
  padding: 0.375rem 0.75rem;
1838
1947
  border-radius: 0.375rem;
1839
1948
  text-decoration: none;
1949
+ text-transform: none;
1950
+ letter-spacing: normal;
1840
1951
  color: inherit;
1841
1952
  background: transparent;
1842
1953
  border: none;
1843
1954
  cursor: pointer;
1844
1955
  font: inherit;
1845
1956
  font-size: 0.9rem;
1957
+ width: 100%;
1958
+ text-align: left;
1846
1959
  transition:
1847
1960
  background var(--skirbi-transition-duration, 160ms)
1848
1961
  var(--skirbi-transition-ease, ease),
@@ -1850,14 +1963,23 @@
1850
1963
  var(--skirbi-transition-ease, ease);
1851
1964
  }
1852
1965
 
1853
- semtic-nav-item [semtic-nav-link]:hover {
1966
+ /* A group header with no href and no action names the items under it
1967
+ * rather than doing anything, so it should not offer the affordances of
1968
+ * one that does: no pointer, no hover response. */
1969
+ :is(semtic-nav-item, semtic-nav-item-group)
1970
+ [semtic-nav-link][semtic-nav-heading] {
1971
+ cursor: default;
1972
+ }
1973
+
1974
+ :is(semtic-nav-item, semtic-nav-item-group)
1975
+ [semtic-nav-link]:not([semtic-nav-heading]):hover {
1854
1976
  background: color-mix(
1855
1977
  in srgb, var(--skirbi-primary-main) 8%, transparent
1856
1978
  );
1857
1979
  color: var(--skirbi-primary-main);
1858
1980
  }
1859
1981
 
1860
- semtic-nav-item :is(
1982
+ :is(semtic-nav-item, semtic-nav-item-group) :is(
1861
1983
  li[aria-current="page"] > [semtic-nav-link],
1862
1984
  [semtic-nav-link][aria-current="page"]
1863
1985
  ) {
@@ -1868,14 +1990,17 @@
1868
1990
  font-weight: 600;
1869
1991
  }
1870
1992
 
1871
- semtic-nav-item [semtic-nav-children] semtic-nav-item [semtic-nav-link]
1872
- ::before {
1993
+ /* The newline before ::before used to be a descendant combinator, so this
1994
+ * marked every element inside the link instead of the link itself -- and
1995
+ * a link holds only text, so nothing was ever marked. */
1996
+ :is(semtic-nav-item, semtic-nav-item-group)
1997
+ [semtic-nav-children] semtic-nav-item [semtic-nav-link]::before {
1873
1998
  content: '›';
1874
1999
  opacity: 0.5;
1875
2000
  font-size: 1em;
1876
2001
  }
1877
2002
 
1878
- semtic-nav-item [semtic-nav-children] {
2003
+ :is(semtic-nav-item, semtic-nav-item-group) [semtic-nav-children] {
1879
2004
  list-style: none;
1880
2005
  margin: 0;
1881
2006
  padding: 0 0 0 1rem;
@@ -1898,6 +2023,22 @@
1898
2023
  color: var(--skirbi-text-muted-final);
1899
2024
  }
1900
2025
 
2026
+ /* A linked section title. It inherits the label's own treatment -- size,
2027
+ * weight, letter-spacing, muted colour -- and only drops the underline,
2028
+ * so linking a section does not turn it into something that reads like an
2029
+ * item. */
2030
+ semtic-nav-section [semtic-nav-section-link] {
2031
+ color: inherit;
2032
+ font: inherit;
2033
+ letter-spacing: inherit;
2034
+ text-transform: inherit;
2035
+ text-decoration: none;
2036
+ }
2037
+
2038
+ semtic-nav-section [semtic-nav-section-link]:hover {
2039
+ text-decoration: underline;
2040
+ }
2041
+
1901
2042
  semtic-nav-section [semtic-nav-section-body] {
1902
2043
  list-style: none;
1903
2044
  margin: 0;
@@ -1968,6 +2109,10 @@
1968
2109
  left: 0;
1969
2110
  top: 0;
1970
2111
  bottom: 0;
2112
+
2113
+ /* Pinned top to bottom, same problem as the desktop rule below. */
2114
+ overflow-y: auto;
2115
+
1971
2116
  transform: translateX(-100%);
1972
2117
  transition: transform var(--skirbi-transition-duration, 160ms)
1973
2118
  var(--skirbi-transition-ease, ease);
@@ -1995,6 +2140,63 @@
1995
2140
  position: sticky;
1996
2141
  top: 0;
1997
2142
  height: 100vh;
2143
+
2144
+ /* Pinned to the viewport height, so a menu taller than the screen has
2145
+ * nowhere to go without this: the items past the fold were simply
2146
+ * unreachable. */
2147
+ overflow-y: auto;
2148
+ }
2149
+ }
2150
+ }
2151
+
2152
+ /**
2153
+ * @styles pinta.semtic-sidenav-indent Semtic sidenav, indented
2154
+ *
2155
+ * Opt-in variant: `<semtic-sidenav indent>`.
2156
+ *
2157
+ * Shows depth as indentation against a shared left edge, rather than as
2158
+ * nested boxes. Every item is prefixed with a marker, and a group's
2159
+ * children start where the group's own label starts, so the markers form a
2160
+ * column per level and the menu reads as an outline. Suits a menu several
2161
+ * levels deep; the default recipe suits a flat one.
2162
+ *
2163
+ * EVENT 2026
2164
+ * > Access
2165
+ * > Divisions
2166
+ * > Mixed
2167
+ * > Teams
2168
+ *
2169
+ * That alignment is why the marker is given an explicit inline-size. As a
2170
+ * bare glyph it is whatever width the font makes it, and the indent below
2171
+ * would have to guess that width to line anything up -- it would drift with
2172
+ * the font and land differently for a different marker. Sized here, one
2173
+ * step is exactly marker + the link's own gap, and the column is
2174
+ * arithmetic rather than a value that looked about right.
2175
+ */
2176
+ [skirbi-theme] {
2177
+ semtic-sidenav[indent] {
2178
+ --skirbi-sidenav-marker-size: 0.75rem;
2179
+
2180
+ /* The gap the link already puts between the marker and its text, so
2181
+ * one step lands the child's marker under the parent's text. */
2182
+ --skirbi-sidenav-marker-gap: 0.375rem;
2183
+
2184
+ [semtic-nav-section-body] {
2185
+ padding-inline-start: var(--skirbi-sidenav-indent, 0.75rem);
2186
+ }
2187
+
2188
+ [semtic-nav-children] {
2189
+ padding-inline-start: calc(
2190
+ var(--skirbi-sidenav-marker-size) + var(--skirbi-sidenav-marker-gap)
2191
+ );
2192
+ }
2193
+
2194
+ [semtic-nav-section-body] [semtic-nav-link]::before {
2195
+ content: '›';
2196
+ inline-size: var(--skirbi-sidenav-marker-size);
2197
+ flex: 0 0 auto;
2198
+ text-align: center;
2199
+ opacity: 0.5;
1998
2200
  }
1999
2201
  }
2000
2202
  }
@@ -2132,8 +2334,6 @@
2132
2334
  --skirbi-toggle-track-height: 1.35rem;
2133
2335
  --skirbi-toggle-thumb-size: 1rem;
2134
2336
  --skirbi-toggle-thumb-offset: 0.175rem;
2135
- --skirbi-toggle-pill-padding-block: 0.3rem;
2136
- --skirbi-toggle-pill-padding-inline: 0.75rem;
2137
2337
  --skirbi-toggle-bg-off: var(--skirbi-surface-border-final);
2138
2338
  --skirbi-toggle-bg-on: var(--skirbi-primary-main);
2139
2339
  --skirbi-toggle-fg-on: var(--skirbi-primary-contrast);
@@ -2194,12 +2394,12 @@
2194
2394
  justify-items: start;
2195
2395
  }
2196
2396
 
2197
- &:not([type="pill"])[label-position="inside"]
2397
+ &[label-position="inside"]
2198
2398
  [semtic-toggle-visual] {
2199
2399
  grid-template-areas: "label thumb";
2200
2400
  }
2201
2401
 
2202
- &:not([type="pill"]) [semtic-toggle-thumb],
2402
+ & [semtic-toggle-thumb],
2203
2403
  &[type="switch"] [semtic-toggle-thumb] {
2204
2404
  position: relative;
2205
2405
  display: inline-block;
@@ -2231,14 +2431,14 @@
2231
2431
  }
2232
2432
  }
2233
2433
 
2234
- &:not([type="pill"]) input[wc-control]:checked
2434
+ & input[wc-control]:checked
2235
2435
  + [semtic-toggle-visual] [semtic-toggle-thumb],
2236
2436
  &[type="switch"] input[wc-control]:checked
2237
2437
  + [semtic-toggle-visual] [semtic-toggle-thumb] {
2238
2438
  background: var(--skirbi-toggle-bg-on);
2239
2439
  }
2240
2440
 
2241
- &:not([type="pill"]) input[wc-control]:checked
2441
+ & input[wc-control]:checked
2242
2442
  + [semtic-toggle-visual] [semtic-toggle-thumb]::before,
2243
2443
  &[type="switch"] input[wc-control]:checked
2244
2444
  + [semtic-toggle-visual] [semtic-toggle-thumb]::before {
@@ -2251,106 +2451,6 @@
2251
2451
  );
2252
2452
  }
2253
2453
 
2254
- &[type="pill"] [semtic-toggle-visual] {
2255
- display: inline-flex;
2256
- align-items: center;
2257
- justify-content: center;
2258
- width: fit-content;
2259
- min-inline-size: 0;
2260
- padding:
2261
- var(--skirbi-toggle-pill-padding-block)
2262
- var(--skirbi-toggle-pill-padding-inline);
2263
- border: 1px solid var(--skirbi-toggle-border);
2264
- border-radius: 999px;
2265
- background: transparent;
2266
- color: inherit;
2267
- line-height: 1.1;
2268
- white-space: nowrap;
2269
- transition:
2270
- background var(--skirbi-transition-duration, 180ms)
2271
- var(--skirbi-transition-ease, ease),
2272
- border-color var(--skirbi-transition-duration, 180ms)
2273
- var(--skirbi-transition-ease, ease),
2274
- color var(--skirbi-transition-duration, 180ms)
2275
- var(--skirbi-transition-ease, ease),
2276
- box-shadow var(--skirbi-transition-duration, 180ms)
2277
- var(--skirbi-transition-ease, ease);
2278
- }
2279
-
2280
- &[type="pill"] [semtic-toggle-thumb] {
2281
- display: none;
2282
- }
2283
-
2284
- &[type="pill"] input[wc-control]:checked
2285
- + [semtic-toggle-visual] {
2286
- background: var(--skirbi-toggle-bg-on);
2287
- border-color: var(--skirbi-toggle-bg-on);
2288
- color: var(--skirbi-toggle-fg-on);
2289
- }
2290
-
2291
- &[type="pill"][label-position="left"] [semtic-toggle-visual],
2292
- &[type="pill"][label-position="right"] [semtic-toggle-visual],
2293
- &[type="pill"][label-position="top"] [semtic-toggle-visual],
2294
- &[type="pill"][label-position="bottom"] [semtic-toggle-visual] {
2295
- display: inline-grid;
2296
- padding: 0;
2297
- border: 0;
2298
- border-radius: 0;
2299
- background: transparent;
2300
- color: inherit;
2301
- }
2302
-
2303
- &[type="pill"][label-position="left"] [semtic-toggle-visual] {
2304
- grid-template-areas: "label thumb";
2305
- }
2306
-
2307
- &[type="pill"][label-position="right"] [semtic-toggle-visual] {
2308
- grid-template-areas: "thumb label";
2309
- }
2310
-
2311
- &[type="pill"][label-position="top"] [semtic-toggle-visual] {
2312
- grid-template-areas:
2313
- "label"
2314
- "thumb";
2315
- justify-items: start;
2316
- }
2317
-
2318
- &[type="pill"][label-position="bottom"] [semtic-toggle-visual] {
2319
- grid-template-areas:
2320
- "thumb"
2321
- "label";
2322
- justify-items: start;
2323
- }
2324
-
2325
- &[type="pill"][label-position="left"] [semtic-toggle-thumb],
2326
- &[type="pill"][label-position="right"] [semtic-toggle-thumb],
2327
- &[type="pill"][label-position="top"] [semtic-toggle-thumb],
2328
- &[type="pill"][label-position="bottom"] [semtic-toggle-thumb] {
2329
- display: inline-flex;
2330
- grid-area: thumb;
2331
- align-items: center;
2332
- justify-content: center;
2333
- min-inline-size: 2rem;
2334
- padding:
2335
- var(--skirbi-toggle-pill-padding-block)
2336
- var(--skirbi-toggle-pill-padding-inline);
2337
- border: 1px solid var(--skirbi-toggle-border);
2338
- border-radius: 999px;
2339
- background: transparent;
2340
- }
2341
-
2342
- &[type="pill"][label-position="left"] input[wc-control]:checked
2343
- + [semtic-toggle-visual] [semtic-toggle-thumb],
2344
- &[type="pill"][label-position="right"] input[wc-control]:checked
2345
- + [semtic-toggle-visual] [semtic-toggle-thumb],
2346
- &[type="pill"][label-position="top"] input[wc-control]:checked
2347
- + [semtic-toggle-visual] [semtic-toggle-thumb],
2348
- &[type="pill"][label-position="bottom"] input[wc-control]:checked
2349
- + [semtic-toggle-visual] [semtic-toggle-thumb] {
2350
- background: var(--skirbi-toggle-bg-on);
2351
- border-color: var(--skirbi-toggle-bg-on);
2352
- }
2353
-
2354
2454
  input[wc-control]:focus-visible + [semtic-toggle-visual],
2355
2455
  input[wc-control]:focus-visible
2356
2456
  + [semtic-toggle-visual] [semtic-toggle-thumb] {
@@ -2362,43 +2462,6 @@
2362
2462
  cursor: not-allowed;
2363
2463
  opacity: 0.55;
2364
2464
  }
2365
-
2366
- &[type="pill"] {
2367
- display: inline-block;
2368
- width: fit-content;
2369
- }
2370
-
2371
- &[type="pill"] > label[semtic-toggle] {
2372
- display: inline-block;
2373
- width: fit-content;
2374
- }
2375
-
2376
- &[type="pill"] > label[semtic-toggle]
2377
- > input[wc-control] + [semtic-toggle-visual] {
2378
- display: inline-flex;
2379
- align-items: center;
2380
- justify-content: center;
2381
- width: fit-content;
2382
- min-width: 0;
2383
- padding: 0.3rem 0.75rem;
2384
- border: 1px solid var(--skirbi-surface-border-final);
2385
- border-radius: 999px;
2386
- background: transparent;
2387
- color: inherit;
2388
- line-height: 1.1;
2389
- white-space: nowrap;
2390
- }
2391
-
2392
- &[type="pill"] [semtic-toggle-thumb] {
2393
- display: none;
2394
- }
2395
-
2396
- &[type="pill"] > label[semtic-toggle]
2397
- > input[wc-control]:checked + [semtic-toggle-visual] {
2398
- background: var(--skirbi-primary-main);
2399
- border-color: var(--skirbi-primary-main);
2400
- color: var(--skirbi-primary-contrast);
2401
- }
2402
2465
  }
2403
2466
  }
2404
2467
 
@@ -2415,17 +2478,44 @@
2415
2478
 
2416
2479
  /* Form controls (label-position) */
2417
2480
  [skirbi-theme] {
2481
+ /* Form controls are two nested grids, not one flex box.
2482
+ *
2483
+ * The host places the definition against the error, per
2484
+ * label-error-position. The definition places the label against the
2485
+ * control, per label-position. Neither knows about the other, so the two
2486
+ * attributes stop multiplying -- as flex they had to be resolved
2487
+ * together, which is how label-position="top" ended up needing its own
2488
+ * bespoke grid while the rest stayed on flex-direction.
2489
+ *
2490
+ * Everything is placed by named area, so nothing depends on source order
2491
+ * and there is no reversed axis: row-reverse used to put the control on
2492
+ * the far side of its own label, which is why anything positioned
2493
+ * against the control landed on the wrong side under
2494
+ * label-position="right".
2495
+ */
2418
2496
  semtic-input,
2419
2497
  semtic-select,
2420
2498
  semtic-textarea,
2421
2499
  semtic-checkbox,
2422
2500
  semtic-radio {
2423
- display: flex;
2424
- flex-direction: row;
2501
+ display: grid;
2502
+ gap: 0.5rem;
2425
2503
  align-items: center;
2504
+ grid-template-areas: "definition" "error";
2505
+ }
2506
+
2507
+ [semtic-input-definition] {
2508
+ display: grid;
2426
2509
  gap: 0.5rem;
2510
+ align-items: center;
2511
+ min-inline-size: 0;
2512
+ grid-area: definition;
2427
2513
  }
2428
2514
 
2515
+ [semtic-label] { grid-area: label; }
2516
+ [semtic-input-container] { grid-area: control; min-inline-size: 0; }
2517
+ [semtic-error] { grid-area: error; }
2518
+
2429
2519
  input[wc-control],
2430
2520
  select[wc-control],
2431
2521
  textarea[wc-control] {
@@ -2433,74 +2523,52 @@
2433
2523
  -webkit-appearance: none;
2434
2524
  }
2435
2525
 
2436
- semtic-input[label-position="left"],
2437
- semtic-select[label-position="left"],
2438
- semtic-textarea[label-position="left"],
2439
- semtic-checkbox[label-position="left"],
2440
- semtic-radio[label-position="left"] {
2441
- flex-direction: row;
2442
- align-items: center;
2443
- }
2444
-
2445
- semtic-input[label-position="right"],
2446
- semtic-select[label-position="right"],
2447
- semtic-textarea[label-position="right"],
2448
- semtic-checkbox[label-position="right"],
2449
- semtic-radio[label-position="right"] {
2450
- flex-direction: row-reverse;
2451
- align-items: center;
2452
- }
2453
-
2454
- semtic-input[label-position="top"],
2455
- semtic-select[label-position="top"],
2456
- semtic-textarea[label-position="top"],
2457
- semtic-checkbox[label-position="top"],
2458
- semtic-radio[label-position="top"] {
2459
- flex-direction: column;
2460
- align-items: flex-start;
2461
- }
2462
-
2463
- semtic-input[label-position="bottom"],
2464
- semtic-select[label-position="bottom"],
2465
- semtic-textarea[label-position="bottom"],
2466
- semtic-checkbox[label-position="bottom"],
2467
- semtic-radio[label-position="bottom"] {
2468
- flex-direction: column-reverse;
2469
- align-items: flex-start;
2470
- }
2471
-
2472
- semtic-input[label-position="top"] input[wc-control],
2473
- semtic-input[label-position="bottom"] input[wc-control],
2474
- semtic-select[label-position="top"] select[wc-control],
2475
- semtic-select[label-position="bottom"] select[wc-control],
2476
- semtic-textarea[label-position="top"] textarea[wc-control],
2477
- semtic-textarea[label-position="bottom"] textarea[wc-control] {
2526
+ /* label-position: label against control, inside the definition. */
2527
+ semtic-input[label-position="top"] [semtic-input-definition],
2528
+ semtic-select[label-position="top"] [semtic-input-definition],
2529
+ semtic-textarea[label-position="top"] [semtic-input-definition],
2530
+ semtic-checkbox[label-position="top"] [semtic-input-definition],
2531
+ semtic-radio[label-position="top"] [semtic-input-definition] {
2532
+ grid-template-areas: "label" "control";
2533
+ grid-template-columns: minmax(0, 1fr);
2534
+ }
2535
+
2536
+ semtic-input[label-position="bottom"] [semtic-input-definition],
2537
+ semtic-select[label-position="bottom"] [semtic-input-definition],
2538
+ semtic-textarea[label-position="bottom"] [semtic-input-definition],
2539
+ semtic-checkbox[label-position="bottom"] [semtic-input-definition],
2540
+ semtic-radio[label-position="bottom"] [semtic-input-definition] {
2541
+ grid-template-areas: "control" "label";
2542
+ grid-template-columns: minmax(0, 1fr);
2543
+ }
2544
+
2545
+ semtic-input[label-position="left"] [semtic-input-definition],
2546
+ semtic-select[label-position="left"] [semtic-input-definition],
2547
+ semtic-textarea[label-position="left"] [semtic-input-definition],
2548
+ semtic-checkbox[label-position="left"] [semtic-input-definition],
2549
+ semtic-radio[label-position="left"] [semtic-input-definition] {
2550
+ grid-template-areas: "label control";
2551
+ grid-template-columns: auto minmax(0, 1fr);
2552
+ }
2553
+
2554
+ semtic-input[label-position="right"] [semtic-input-definition],
2555
+ semtic-select[label-position="right"] [semtic-input-definition],
2556
+ semtic-textarea[label-position="right"] [semtic-input-definition],
2557
+ semtic-checkbox[label-position="right"] [semtic-input-definition],
2558
+ semtic-radio[label-position="right"] [semtic-input-definition] {
2559
+ grid-template-areas: "control label";
2560
+ grid-template-columns: minmax(0, 1fr) auto;
2561
+ }
2562
+
2563
+ /* The control fills its cell in every direction; the cell decides how
2564
+ * wide that is, so this no longer needs to be per label-position. */
2565
+ [semtic-input-container] > input[wc-control],
2566
+ [semtic-input-container] > select[wc-control],
2567
+ [semtic-input-container] > textarea[wc-control] {
2478
2568
  width: 100%;
2479
2569
  box-sizing: border-box;
2480
2570
  }
2481
2571
 
2482
- semtic-toggle[type="pill"][label-position="inside"]
2483
- [semtic-toggle-label] {
2484
- position: absolute;
2485
- top: 0;
2486
- right: 0;
2487
- bottom: 0;
2488
- left: 0;
2489
- display: flex;
2490
- align-items: center;
2491
- justify-content: center;
2492
- pointer-events: none;
2493
- }
2494
-
2495
- semtic-input[label-position="top"],
2496
- semtic-input[label-position="bottom"],
2497
- semtic-select[label-position="top"],
2498
- semtic-select[label-position="bottom"],
2499
- semtic-textarea[label-position="top"],
2500
- semtic-textarea[label-position="bottom"] {
2501
- width: 100%;
2502
- }
2503
-
2504
2572
  semtic-select[label-position="top"] [skirbi-select],
2505
2573
  semtic-select[label-position="bottom"] [skirbi-select] {
2506
2574
  width: 100%;
@@ -2517,6 +2585,14 @@
2517
2585
  color: var(--skirbi-error-base, #b91c1c);
2518
2586
  }
2519
2587
 
2588
+ /* The gap before a required marker is spacing, so it belongs here rather
2589
+ * than in a whitespace text node. A text node separator cannot survive a
2590
+ * morph: rendering appends it as its own node, parsing merges it into the
2591
+ * label text, and the two shapes never match. */
2592
+ [data-required-marker] {
2593
+ margin-inline-start: 0.25em;
2594
+ }
2595
+
2520
2596
  semtic-input:has([semtic-error]:not(:empty)),
2521
2597
  semtic-select:has([semtic-error]:not(:empty)),
2522
2598
  semtic-textarea:has([semtic-error]:not(:empty)) {
@@ -2527,6 +2603,28 @@
2527
2603
  padding: 0.5rem 0.5rem 0.75rem;
2528
2604
  }
2529
2605
 
2606
+ /* A textarea is the one control that is meaningfully taller than its
2607
+ * label, so the shared `align-items: center` reads wrong on it: with the
2608
+ * label beside the control it would float halfway down. Align to the
2609
+ * start instead, on both levels. */
2610
+ semtic-textarea,
2611
+ semtic-textarea [semtic-input-definition] {
2612
+ align-items: start;
2613
+ }
2614
+
2615
+ /* Resizing along the inline axis would take the control out of its grid
2616
+ * column, so keep it to the block axis. */
2617
+ textarea[wc-control] {
2618
+ resize: vertical;
2619
+
2620
+ /* More room below the text than the shared recipe gives. An input is
2621
+ * a single line sitting in the middle of its box, so equal padding
2622
+ * reads as centred; a textarea fills from the top, which leaves the
2623
+ * last line hard against the bottom edge -- and against the resize
2624
+ * handle sitting in that corner. */
2625
+ padding-block-end: var(--skirbi-textarea-padding-block-end, 1.1rem);
2626
+ }
2627
+
2530
2628
  input[wc-control],
2531
2629
  select[wc-control],
2532
2630
  textarea[wc-control] {
@@ -2537,6 +2635,106 @@
2537
2635
  color: var(--skirbi-secondary-dark);
2538
2636
  font: inherit;
2539
2637
  box-sizing: border-box;
2638
+
2639
+ /* Stated, not inherited. `font: inherit` above also hands over the
2640
+ * page's line-height, and a <select> ignores line-height -- it lays its
2641
+ * inner box out at the font's normal whatever we say. So an input next
2642
+ * to a select grew with the page's line-height while the select stayed
2643
+ * put, and the two ended up different heights for no visible reason.
2644
+ * Naming a value close to normal makes them agree, because the one that
2645
+ * ignores it was going to land here anyway.
2646
+ *
2647
+ * Unverified. This was added for a select that looked shorter than the
2648
+ * input beside it, but the cause turned out to be a font-size of
2649
+ * 0.875rem landing on that control and not its neighbour, which is
2650
+ * fixed separately. The reasoning above is sound on its own terms and
2651
+ * the value is close enough to normal to be harmless, but nothing here
2652
+ * has been shown to change a rendered height. Treat it as removable if
2653
+ * it ever gets in the way rather than as load-bearing. */
2654
+ line-height: var(--skirbi-control-line-height, 1.25);
2655
+ }
2656
+
2657
+ /* Except the textarea, which is real running text: 1.25 is tight for
2658
+ * something that wraps. */
2659
+ textarea[wc-control] {
2660
+ line-height: var(--skirbi-textarea-line-height, 1.5);
2661
+ }
2662
+
2663
+ /* Clearable input
2664
+ *
2665
+ * semtic-input renders the control and its clear button inside
2666
+ * [semtic-input-container]. That box is exactly the size of
2667
+ * the control, which is the whole point: the host is not, because it
2668
+ * holds the label and the error as well, and where the control sits
2669
+ * inside it changes with label-position.
2670
+ *
2671
+ * With a box of the right size to position against, one rule covers
2672
+ * every label position -- no per-direction arithmetic, no layout that
2673
+ * depends on whether the button happens to be visible.
2674
+ *
2675
+ * :not([hidden]) stays on the button's own rules: these selectors
2676
+ * outrank the [hidden] guard further down this file, so without it a
2677
+ * clear button could never hide again.
2678
+ */
2679
+ [semtic-input-container] {
2680
+ position: relative;
2681
+ display: flex;
2682
+ align-items: center;
2683
+ min-inline-size: 0;
2684
+ }
2685
+
2686
+ [semtic-input-container] input[wc-control] {
2687
+ inline-size: 100%;
2688
+ padding-inline-end: var(--skirbi-clear-size, 2.25rem);
2689
+ }
2690
+
2691
+ /* type="search" comes with a clear button of its own in WebKit and
2692
+ * Chromium, which [semtic-clear] would otherwise sit next to: two
2693
+ * crosses, one themed and one not, only one of which fires the events
2694
+ * the component dispatches. `appearance: none` on the input does not
2695
+ * reach these -- they are separate shadow pseudo-elements and have to be
2696
+ * turned off by name. */
2697
+ input[wc-control][type="search"]::-webkit-search-cancel-button,
2698
+ input[wc-control][type="search"]::-webkit-search-decoration,
2699
+ input[wc-control][type="search"]::-webkit-search-results-button,
2700
+ input[wc-control][type="search"]::-webkit-search-results-decoration {
2701
+ -webkit-appearance: none;
2702
+ appearance: none;
2703
+ }
2704
+
2705
+ [semtic-clear]:not([hidden]) {
2706
+ position: absolute;
2707
+ inset-inline-end: 0.35rem;
2708
+ inset-block-start: 50%;
2709
+ transform: translateY(-50%);
2710
+ display: inline-flex;
2711
+ align-items: center;
2712
+ justify-content: center;
2713
+ inline-size: var(--skirbi-clear-size, 2.25rem);
2714
+ block-size: var(--skirbi-clear-size, 2.25rem);
2715
+ padding: 0;
2716
+ border: 0;
2717
+ border-radius: 999px;
2718
+ background: none;
2719
+ color: var(--skirbi-secondary-dark);
2720
+ font: inherit;
2721
+ line-height: 1;
2722
+ cursor: pointer;
2723
+ opacity: 0.55;
2724
+ }
2725
+
2726
+ [semtic-clear]:not([hidden]):hover,
2727
+ [semtic-clear]:not([hidden]):focus-visible {
2728
+ opacity: 1;
2729
+ }
2730
+
2731
+ input[wc-control]::placeholder,
2732
+ textarea[wc-control]::placeholder {
2733
+ color: color-mix(
2734
+ in srgb,
2735
+ var(--skirbi-secondary-dark) 65%,
2736
+ var(--skirbi-secondary-light)
2737
+ );
2540
2738
  }
2541
2739
 
2542
2740
  input[wc-control]:focus,
@@ -2549,6 +2747,62 @@
2549
2747
  );
2550
2748
  }
2551
2749
 
2750
+ /* Number inputs — drop the native up/down stepper, keep our own
2751
+ * border/background recipe instead of the browser's inset widget.
2752
+ */
2753
+ :is(
2754
+ semtic-input[type="number"],
2755
+ semtic-input-number
2756
+ ) input[wc-control][type="number"] {
2757
+ appearance: textfield;
2758
+ -moz-appearance: textfield;
2759
+ }
2760
+
2761
+ :is(
2762
+ semtic-input[type="number"],
2763
+ semtic-input-number
2764
+ ) input[wc-control][type="number"]::-webkit-outer-spin-button,
2765
+ :is(
2766
+ semtic-input[type="number"],
2767
+ semtic-input-number
2768
+ ) input[wc-control][type="number"]::-webkit-inner-spin-button {
2769
+ appearance: none;
2770
+ -webkit-appearance: none;
2771
+ margin: 0;
2772
+ }
2773
+
2774
+ /* Select — swap the native chrome for a custom caret so it matches
2775
+ * the rest of the input recipe instead of the OS-drawn widget.
2776
+ */
2777
+ [skirbi-select] {
2778
+ position: relative;
2779
+ display: inline-block;
2780
+ }
2781
+
2782
+ [skirbi-select] select[wc-control] {
2783
+ appearance: none;
2784
+ -webkit-appearance: none;
2785
+ -moz-appearance: none;
2786
+ padding-inline-end: 2.25rem;
2787
+ }
2788
+
2789
+ [skirbi-select]::after {
2790
+ content: "";
2791
+ position: absolute;
2792
+ top: 50%;
2793
+ right: 0.9rem;
2794
+ inline-size: 0.45rem;
2795
+ block-size: 0.45rem;
2796
+ border-right: 2px solid var(--skirbi-secondary-dark);
2797
+ border-bottom: 2px solid var(--skirbi-secondary-dark);
2798
+ transform: translateY(-65%) rotate(45deg);
2799
+ pointer-events: none;
2800
+ }
2801
+
2802
+ [skirbi-select]:has(select[wc-control]:disabled)::after {
2803
+ opacity: 0.55;
2804
+ }
2805
+
2552
2806
  /* Checkbox / radio controls
2553
2807
  *
2554
2808
  * Keep label-position/layout rules above in charge. These styles only
@@ -2560,26 +2814,40 @@
2560
2814
  semtic-input[type="radio"],
2561
2815
  semtic-checkbox,
2562
2816
  semtic-radio
2563
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]) {
2817
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]) {
2564
2818
  appearance: none;
2565
2819
  -webkit-appearance: none;
2566
2820
 
2567
- inline-size: var(--skirbi-choice-size, 0.95rem);
2568
- block-size: var(--skirbi-choice-size, 0.95rem);
2569
- min-inline-size: var(--skirbi-choice-size, 0.95rem);
2570
- min-block-size: var(--skirbi-choice-size, 0.95rem);
2821
+ inline-size: var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7));
2822
+ block-size: var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7));
2823
+ min-inline-size: var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7));
2824
+ min-block-size: var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7));
2571
2825
 
2572
2826
  margin: 0;
2573
2827
  padding: 0;
2828
+ box-sizing: border-box;
2574
2829
 
2575
- border: 1px solid var(--skirbi-choice-border, var(--skirbi-surface-border-final));
2576
- background: var(--skirbi-choice-bg, var(--skirbi-surface-bg-final));
2577
- color: var(--skirbi-choice-accent, var(--skirbi-primary-main));
2830
+ border: 1px solid var(--skirbi-surface-border-final);
2831
+ background: var(--skirbi-choice-background, var(--skirbi-secondary-light));
2832
+
2833
+ /* The contrast colour for the background above, exactly as the text
2834
+ * controls pair secondary-light with secondary-dark. A choice control
2835
+ * is a filled box that has to read against its own fill, so it takes
2836
+ * the same pairing rather than an accent that only happens to be
2837
+ * legible on the default surface.
2838
+ *
2839
+ * This is also the single seam for retinting one: tick, dot, checked
2840
+ * border, checked background tint and hover border are all currentColor
2841
+ * further down, so this one declaration carries the whole control and
2842
+ * an app changing it does not have to restate the recipe. */
2843
+ color: var(--skirbi-choice-color, var(--skirbi-secondary-dark));
2578
2844
 
2579
2845
  display: inline-grid;
2580
2846
  place-content: center;
2581
2847
  flex: 0 0 auto;
2582
2848
  cursor: pointer;
2849
+ user-select: none;
2850
+ caret-color: transparent;
2583
2851
 
2584
2852
  transition:
2585
2853
  border-color var(--skirbi-transition-duration, 180ms)
@@ -2590,25 +2858,48 @@
2590
2858
  var(--skirbi-transition-ease, ease);
2591
2859
  }
2592
2860
 
2861
+ :is(
2862
+ semtic-input[type="checkbox"],
2863
+ semtic-input[type="radio"],
2864
+ semtic-checkbox,
2865
+ semtic-radio
2866
+ ) [semtic-label] {
2867
+ cursor: pointer;
2868
+ user-select: none;
2869
+ }
2870
+
2593
2871
  /* Checkbox shape */
2594
2872
  :is(
2595
2873
  semtic-input[type="checkbox"],
2596
2874
  semtic-checkbox
2597
- ) > input[wc-control][type="checkbox"] {
2598
- border-radius: 0.2rem;
2875
+ ) input[wc-control][type="checkbox"] {
2876
+ border-radius: var(
2877
+ --skirbi-choice-radius,
2878
+ calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.267)
2879
+ );
2599
2880
  }
2600
2881
 
2601
- /* Checkbox tick */
2882
+ /* Checkbox tick — sized proportionally to --skirbi-choice-size so
2883
+ * overriding the box size (e.g. to a larger tap target) keeps the
2884
+ * tick centered and legible instead of shrinking into a corner.
2885
+ *
2886
+ * To change how much of the box the mark fills without touching the box,
2887
+ * set --skirbi-choice-mark-scale (1 = the proportions above). It rides
2888
+ * the reveal transform rather than the dimensions, so the stroke thins
2889
+ * with the mark instead of staying heavy on a smaller tick, and it stays
2890
+ * centered on transform-origin for free.
2891
+ */
2602
2892
  :is(
2603
2893
  semtic-input[type="checkbox"],
2604
2894
  semtic-checkbox
2605
- ) > input[wc-control][type="checkbox"]::before {
2895
+ ) input[wc-control][type="checkbox"]::before {
2606
2896
  content: "";
2607
- inline-size: 0.28rem;
2608
- block-size: 0.52rem;
2897
+ inline-size: calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.373);
2898
+ block-size: calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.693);
2609
2899
 
2610
2900
  border: solid currentColor;
2611
- border-width: 0 0.11rem 0.11rem 0;
2901
+ border-width: 0 calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.147)
2902
+ calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.147) 0;
2612
2903
 
2613
2904
  transform: rotate(45deg) scale(0);
2614
2905
  transform-origin: center;
@@ -2620,18 +2911,18 @@
2620
2911
  :is(
2621
2912
  semtic-input[type="radio"],
2622
2913
  semtic-radio
2623
- ) > input[wc-control][type="radio"] {
2914
+ ) input[wc-control][type="radio"] {
2624
2915
  border-radius: 50%;
2625
2916
  }
2626
2917
 
2627
- /* Radio dot */
2918
+ /* Radio dot — proportional for the same reason as the checkbox tick. */
2628
2919
  :is(
2629
2920
  semtic-input[type="radio"],
2630
2921
  semtic-radio
2631
- ) > input[wc-control][type="radio"]::before {
2922
+ ) input[wc-control][type="radio"]::before {
2632
2923
  content: "";
2633
- inline-size: 0.42rem;
2634
- block-size: 0.42rem;
2924
+ inline-size: calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.56);
2925
+ block-size: calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.56);
2635
2926
  border-radius: 50%;
2636
2927
  background: currentColor;
2637
2928
 
@@ -2646,27 +2937,27 @@
2646
2937
  semtic-input[type="radio"],
2647
2938
  semtic-checkbox,
2648
2939
  semtic-radio
2649
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]):checked {
2940
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]):checked {
2650
2941
  border-color: currentColor;
2651
2942
  background: color-mix(
2652
2943
  in srgb,
2653
2944
  currentColor 7%,
2654
- var(--skirbi-surface-bg-final)
2945
+ var(--skirbi-secondary-light)
2655
2946
  );
2656
2947
  }
2657
2948
 
2658
2949
  :is(
2659
2950
  semtic-input[type="checkbox"],
2660
2951
  semtic-checkbox
2661
- ) > input[wc-control][type="checkbox"]:checked::before {
2662
- transform: rotate(45deg) scale(1);
2952
+ ) input[wc-control][type="checkbox"]:checked::before {
2953
+ transform: rotate(45deg) scale(var(--skirbi-choice-mark-scale, 1));
2663
2954
  }
2664
2955
 
2665
2956
  :is(
2666
2957
  semtic-input[type="radio"],
2667
2958
  semtic-radio
2668
- ) > input[wc-control][type="radio"]:checked::before {
2669
- transform: scale(1);
2959
+ ) input[wc-control][type="radio"]:checked::before {
2960
+ transform: scale(var(--skirbi-choice-mark-scale, 1));
2670
2961
  }
2671
2962
 
2672
2963
  /* Hover/focus */
@@ -2675,7 +2966,7 @@
2675
2966
  semtic-input[type="radio"],
2676
2967
  semtic-checkbox,
2677
2968
  semtic-radio
2678
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]):hover {
2969
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]):hover {
2679
2970
  border-color: currentColor;
2680
2971
  }
2681
2972
 
@@ -2684,7 +2975,7 @@
2684
2975
  semtic-input[type="radio"],
2685
2976
  semtic-checkbox,
2686
2977
  semtic-radio
2687
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]):focus-visible {
2978
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]):focus-visible {
2688
2979
  outline: none;
2689
2980
  box-shadow: 0 0 0 2px color-mix(
2690
2981
  in srgb,
@@ -2699,7 +2990,7 @@
2699
2990
  semtic-input[type="radio"],
2700
2991
  semtic-checkbox,
2701
2992
  semtic-radio
2702
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]):disabled {
2993
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]):disabled {
2703
2994
  opacity: 0.55;
2704
2995
  cursor: not-allowed;
2705
2996
  }
@@ -2733,126 +3024,78 @@
2733
3024
 
2734
3025
  /* Form controls (label-error-position) */
2735
3026
  [skirbi-theme] {
2736
- semtic-input[label-error-position="inline"][label-position="top"],
2737
- semtic-select[label-error-position="inline"][label-position="top"],
2738
- semtic-textarea[label-error-position="inline"][label-position="top"] {
2739
- display: grid;
2740
- grid-template-areas:
2741
- "label error"
2742
- "input input";
2743
- grid-template-columns: auto 1fr;
2744
- align-items: baseline;
2745
- }
2746
-
2747
- semtic-input[label-error-position="inline"] [semtic-label],
2748
- semtic-select[label-error-position="inline"] [semtic-label],
2749
- semtic-textarea[label-error-position="inline"] [semtic-label] {
2750
- grid-area: label;
2751
- }
2752
-
2753
- semtic-input[label-error-position="inline"] input[wc-control],
2754
- semtic-select[label-error-position="inline"] select[wc-control],
2755
- semtic-textarea[label-error-position="inline"] textarea[wc-control] {
2756
- grid-area: input;
2757
- }
2758
-
2759
- semtic-input[label-error-position="inline"] [semtic-error],
2760
- semtic-select[label-error-position="inline"] [semtic-error],
2761
- semtic-textarea[label-error-position="inline"] [semtic-error] {
2762
- grid-area: error;
2763
- text-align: right;
2764
- align-self: baseline;
2765
- }
2766
-
2767
- semtic-input[label-error-position="bottom"] [semtic-error],
2768
- semtic-select[label-error-position="bottom"] [semtic-error],
2769
- semtic-textarea[label-error-position="bottom"] [semtic-error] {
2770
- order: 99;
2771
- width: 100%;
2772
- }
2773
-
3027
+ /* label-error-position: the definition against the error, on the host.
3028
+ *
3029
+ * Independent of label-position, which arranges the inside of the
3030
+ * definition. That separation is the point of the two levels: these two
3031
+ * attributes used to have to be resolved together, so every combination
3032
+ * needed its own rule.
3033
+ *
3034
+ * "bottom" is the base template, so it needs nothing here.
3035
+ */
2774
3036
  semtic-input[label-error-position="top"],
2775
3037
  semtic-select[label-error-position="top"],
2776
- semtic-textarea[label-error-position="top"] {
2777
- display: grid;
2778
- grid-template-areas:
2779
- "error"
2780
- "label"
2781
- "input";
2782
- }
2783
-
2784
- semtic-input[label-error-position="top"] [semtic-label],
2785
- semtic-select[label-error-position="top"] [semtic-label],
2786
- semtic-textarea[label-error-position="top"] [semtic-label] {
2787
- grid-area: label;
2788
- }
2789
-
2790
- semtic-input[label-error-position="top"] input[wc-control],
2791
- semtic-select[label-error-position="top"] select[wc-control],
2792
- semtic-textarea[label-error-position="top"] textarea[wc-control] {
2793
- grid-area: input;
2794
- }
2795
-
2796
- semtic-input[label-error-position="top"] [semtic-error],
2797
- semtic-select[label-error-position="top"] [semtic-error],
2798
- semtic-textarea[label-error-position="top"] [semtic-error] {
2799
- grid-area: error;
3038
+ semtic-textarea[label-error-position="top"],
3039
+ semtic-checkbox[label-error-position="top"],
3040
+ semtic-radio[label-error-position="top"] {
3041
+ grid-template-areas: "error" "definition";
3042
+ grid-template-columns: minmax(0, 1fr);
2800
3043
  }
2801
3044
 
2802
3045
  semtic-input[label-error-position="left"],
2803
3046
  semtic-select[label-error-position="left"],
2804
- semtic-textarea[label-error-position="left"] {
2805
- display: grid;
2806
- grid-template-areas:
2807
- "label input"
2808
- "error input";
2809
- grid-template-columns: auto 1fr;
2810
- }
2811
-
2812
- semtic-input[label-error-position="left"] [semtic-label],
2813
- semtic-select[label-error-position="left"] [semtic-label],
2814
- semtic-textarea[label-error-position="left"] [semtic-label] {
2815
- grid-area: label;
2816
- }
2817
-
2818
- semtic-input[label-error-position="left"] input[wc-control],
2819
- semtic-select[label-error-position="left"] select[wc-control],
2820
- semtic-textarea[label-error-position="left"] textarea[wc-control] {
2821
- grid-area: input;
2822
- }
2823
-
2824
- semtic-input[label-error-position="left"] [semtic-error],
2825
- semtic-select[label-error-position="left"] [semtic-error],
2826
- semtic-textarea[label-error-position="left"] [semtic-error] {
2827
- grid-area: error;
3047
+ semtic-textarea[label-error-position="left"],
3048
+ semtic-checkbox[label-error-position="left"],
3049
+ semtic-radio[label-error-position="left"] {
3050
+ grid-template-areas: "error definition";
3051
+ grid-template-columns: auto minmax(0, 1fr);
2828
3052
  }
2829
3053
 
2830
3054
  semtic-input[label-error-position="right"],
2831
3055
  semtic-select[label-error-position="right"],
2832
- semtic-textarea[label-error-position="right"] {
2833
- display: grid;
2834
- grid-template-areas:
2835
- "label input"
2836
- "input error";
2837
- grid-template-columns: 1fr auto;
3056
+ semtic-textarea[label-error-position="right"],
3057
+ semtic-checkbox[label-error-position="right"],
3058
+ semtic-radio[label-error-position="right"] {
3059
+ grid-template-areas: "definition error";
3060
+ grid-template-columns: minmax(0, 1fr) auto;
2838
3061
  }
2839
3062
 
2840
- semtic-input[label-error-position="right"] [semtic-label],
2841
- semtic-select[label-error-position="right"] [semtic-label],
2842
- semtic-textarea[label-error-position="right"] [semtic-label] {
2843
- grid-area: label;
2844
- }
3063
+ /* inline: the error shares the label's row, right-aligned, so it reads
3064
+ * as an annotation on the label rather than a line of its own.
3065
+ *
3066
+ * This is the one value where the two levels cannot stay independent.
3067
+ * The label lives inside the definition and the error is a sibling of
3068
+ * it, so putting them on the same row means putting them in the same
3069
+ * grid -- hence display: contents on the definition, which hands its
3070
+ * three children up to the host. Only the vertical label positions can
3071
+ * do this: with the label beside the control there is no label row for
3072
+ * the error to share, so those fall through to the base template and
3073
+ * the error takes its own row underneath.
3074
+ */
3075
+ :is(
3076
+ semtic-input, semtic-select, semtic-textarea,
3077
+ semtic-checkbox, semtic-radio
3078
+ )[label-error-position="inline"]:is(
3079
+ :not([label-position]), [label-position="top"], [label-position="bottom"]
3080
+ ) {
3081
+ grid-template-areas: "label error" "control control";
3082
+ grid-template-columns: auto minmax(0, 1fr);
3083
+ align-items: baseline;
2845
3084
 
2846
- semtic-input[label-error-position="right"] input[wc-control],
2847
- semtic-select[label-error-position="right"] select[wc-control],
2848
- semtic-textarea[label-error-position="right"] textarea[wc-control] {
2849
- grid-area: input;
3085
+ & > [semtic-input-definition] {
3086
+ display: contents;
3087
+ }
3088
+
3089
+ & > [semtic-error] {
3090
+ text-align: right;
3091
+ }
2850
3092
  }
2851
3093
 
2852
- semtic-input[label-error-position="right"] [semtic-error],
2853
- semtic-select[label-error-position="right"] [semtic-error],
2854
- semtic-textarea[label-error-position="right"] [semtic-error] {
2855
- grid-area: error;
3094
+ :is(
3095
+ semtic-input, semtic-select, semtic-textarea,
3096
+ semtic-checkbox, semtic-radio
3097
+ )[label-error-position="inline"][label-position="bottom"] {
3098
+ grid-template-areas: "control control" "label error";
2856
3099
  }
2857
3100
  }
2858
3101
 
@@ -3407,26 +3650,6 @@
3407
3650
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--skirbi-primary-main) 25%, transparent);
3408
3651
  }
3409
3652
 
3410
- semtic-input[label-position="top"] {
3411
- display: grid;
3412
- grid-template-areas:
3413
- "label error"
3414
- "input input";
3415
- grid-template-columns: auto 1fr;
3416
- }
3417
-
3418
- semtic-input[label-position="top"] [semtic-label] {
3419
- grid-area: label;
3420
- }
3421
-
3422
- semtic-input[label-position="top"] input[wc-control] {
3423
- grid-area: input;
3424
- }
3425
-
3426
- semtic-input[label-position="top"] [semtic-error] {
3427
- grid-area: error;
3428
- text-align: right;
3429
- }
3430
3653
 
3431
3654
  }
3432
3655
 
@@ -3714,6 +3937,45 @@
3714
3937
  }
3715
3938
  }
3716
3939
 
3940
+ /**
3941
+ * @styles pinta.semtic-grid-diptych Diptych grid
3942
+ * @description
3943
+ *
3944
+ * Two-region grid primitive: a flexible content column and a fixed-width
3945
+ * aside (e.g. a sidenav). Content is expected first in DOM/reading order
3946
+ * so screen readers and keyboard navigation reach it before the aside;
3947
+ * the aside is repositioned to the visual left via `grid-area`, not by
3948
+ * reordering the DOM. On narrow screens the regions stack as content,
3949
+ * then aside.
3950
+ *
3951
+ * | Token | Purpose |
3952
+ * | --- | --- |
3953
+ * | `--skirbi-diptych-aside` | Width of the aside column. |
3954
+ * | `--skirbi-diptych-gap` | Gap between regions. |
3955
+ */
3956
+
3957
+ [skirbi-theme] {
3958
+ semtic-grid[diptych] {
3959
+ display: grid;
3960
+ grid-template-areas: "aside content";
3961
+ grid-template-columns:
3962
+ minmax(10rem, var(--skirbi-diptych-aside))
3963
+ minmax(0, 1fr);
3964
+ gap: var(--skirbi-diptych-gap);
3965
+ align-items: start;
3966
+
3967
+ > :first-child {
3968
+ grid-area: content;
3969
+ min-inline-size: 0;
3970
+ }
3971
+
3972
+ > :nth-child(2) {
3973
+ grid-area: aside;
3974
+ min-inline-size: 0;
3975
+ }
3976
+ }
3977
+ }
3978
+
3717
3979
  /**
3718
3980
  * @styles pinta.semtic-grid-triptych Triptych grid
3719
3981
  * @description
@@ -3785,13 +4047,13 @@
3785
4047
  }
3786
4048
  }
3787
4049
 
3788
- /**
3789
- * @styles pinta.heading-quote Heading quote
3790
- * @description
3791
- *
3792
- * Tightens a paragraph blockquote immediately following a heading and presents
3793
- * it as compact italic supporting text.
3794
- */
4050
+ /**
4051
+ * @styles pinta.heading-quote Heading quote
4052
+ * @description
4053
+ *
4054
+ * Tightens a paragraph blockquote immediately following a heading and presents
4055
+ * it as compact italic supporting text.
4056
+ */
3795
4057
 
3796
4058
  [skirbi-theme] {
3797
4059
  :is(h1, h2, h3, h4, h5, h6):has(+ blockquote p) {
@@ -3809,13 +4071,13 @@
3809
4071
  }
3810
4072
  }
3811
4073
 
3812
- /**
3813
- * @styles pinta.semtic-grid-layout Catalogue grid
3814
- * @description
3815
- *
3816
- * Four-column catalogue grid used when `<semtic-grid>` has a `layout`
3817
- * attribute. Card-span assignment remains the responsibility of the caller.
3818
- */
4074
+ /**
4075
+ * @styles pinta.semtic-grid-layout Catalogue grid
4076
+ * @description
4077
+ *
4078
+ * Four-column catalogue grid used when `<semtic-grid>` has a `layout`
4079
+ * attribute. Card-span assignment remains the responsibility of the caller.
4080
+ */
3819
4081
 
3820
4082
  [skirbi-theme] {
3821
4083
  semtic-grid[layout] {
@@ -3857,4 +4119,39 @@
3857
4119
  }
3858
4120
  }
3859
4121
 
4122
+ /*
4123
+ * Guard against component recipes above that set `display` without
4124
+ * excluding `[hidden]`. Author CSS always beats the UA stylesheet's
4125
+ * `[hidden] { display: none }`, so any unqualified `display` rule
4126
+ * silently defeats the native hidden behavior. This attribute selector
4127
+ * outranks plain element selectors, so it wins regardless of source
4128
+ * order above.
4129
+ */
4130
+ [skirbi-theme] [hidden] {
4131
+ display: none;
4132
+ }
4133
+
4134
+ [skirbi-theme] {
4135
+ semtic-form-row {
4136
+ display: grid;
4137
+ gap: var(--skirbi-grid-gap, 1rem);
4138
+ grid-template-columns: repeat(
4139
+ var(--skirbi-form-row-columns, 2),
4140
+ minmax(0, 1fr)
4141
+ );
4142
+
4143
+ /* Trailing space so consecutive rows do not run together. */
4144
+ padding-block-end: var(--skirbi-form-row-spacing, 1rem);
4145
+ }
4146
+
4147
+ /* A nested row is a cell of the row around it, so the outer row's gap
4148
+ * already separates it from whatever follows. Its own trailing space
4149
+ * lands inside that gap and reads as a double one -- and against the
4150
+ * bottom of the outer row it is trailing space with nothing after it
4151
+ * to separate from. */
4152
+ semtic-form-row semtic-form-row {
4153
+ padding-block-end: 0;
4154
+ }
4155
+ }
4156
+
3860
4157
  }