@skirbi/pinta 0.0.30 → 0.0.32

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.
@@ -53,6 +53,30 @@
53
53
  * | `skirbi-transform` | Derived colors and final tokens. |
54
54
  * | `skirbi-components` | Light recipes for Semtic elements. |
55
55
  * | `skirbi-app` | Application overrides. Always comes last. |
56
+ *
57
+ * ## Breakpoints
58
+ *
59
+ * Three tiers, two shared thresholds -- not four (no separate "wide"
60
+ * tier: a wide window is still normally a narrow browser column, not a
61
+ * canvas to fill; `semtic-grid[triptych]`'s own max content width
62
+ * already handles the "don't stretch too wide" case directly instead).
63
+ * Reuse these two values for any new layout-affecting media query
64
+ * rather than picking a nearby one -- that drift is exactly how
65
+ * `semtic-grid[diptych]` (48rem) and `semtic-nav` (previously 47.999rem)
66
+ * ended up responding to viewport width one pixel apart on the same
67
+ * page.
68
+ *
69
+ * | Tier | Range | `max-width` to use |
70
+ * | --- | --- | --- |
71
+ * | mobile | up to 48rem (768px) | `48rem` |
72
+ * | tablet | 48rem-64rem (768-1024px) | `64rem` (as `min-width` for the tablet-and-up half) |
73
+ * | desktop | above 64rem | -- |
74
+ *
75
+ * A component may still have its own finer-grained breakpoint for a
76
+ * detail that isn't a layout tier (`semtic-nav-avatar`'s `36rem`
77
+ * aspect-ratio fix, e.g.) -- that's a narrower, self-contained tweak
78
+ * inside the mobile tier, not a competing definition of where mobile
79
+ * ends.
56
80
  */
57
81
 
58
82
  @layer skirbi-base, skirbi-theme, skirbi-transform, skirbi-components,
@@ -665,6 +689,10 @@
665
689
  }
666
690
 
667
691
 
692
+ /* Diptych layout */
693
+ --skirbi-diptych-aside: 16rem;
694
+ --skirbi-diptych-gap: clamp(1rem, 2vw, 2rem);
695
+
668
696
  /* Triptych layout */
669
697
  --skirbi-triptych-content: 110ch;
670
698
  --skirbi-triptych-aside: 16rem;
@@ -961,7 +989,7 @@
961
989
  color: var(--skirbi-page-fg, var(--skirbi-on-light, #0f172a));
962
990
 
963
991
  /* Typography application */
964
- font-family: var(--skirbi-font-defaults);
992
+ font-family: var(--skirbi-font-sans);
965
993
 
966
994
  font-size: calc(16px * var(--skirbi-font-scale, 1));
967
995
  line-height: var(--skirbi-line-height, 1.55);
@@ -1067,21 +1095,20 @@
1067
1095
 
1068
1096
  @layer skirbi-components {
1069
1097
 
1070
- /**
1071
- * @styles pinta.semtic-panel-tile Semtic panel and tile
1072
- * @description
1073
- *
1074
- * Light surface recipes for `<semtic-panel>` and `<semtic-tile>`.
1075
- *
1076
- * They use final surface tokens and remain easy to override:
1077
- *
1078
- * ```css
1079
- * semtic-panel[login-card] {
1080
- * max-width: 28rem;
1081
- * }
1082
- * ```
1083
- */
1084
-
1098
+ /**
1099
+ * @styles pinta.semtic-panel-tile Semtic panel and tile
1100
+ * @description
1101
+ *
1102
+ * Light surface recipes for `<semtic-panel>` and `<semtic-tile>`.
1103
+ *
1104
+ * They use final surface tokens and remain easy to override:
1105
+ *
1106
+ * ```css
1107
+ * semtic-panel[login-card] {
1108
+ * max-width: 28rem;
1109
+ * }
1110
+ * ```
1111
+ */
1085
1112
  /* semtic-panel / semtic-tile */
1086
1113
  [skirbi-theme] {
1087
1114
  :is(semtic-panel, semtic-tile) {
@@ -1631,36 +1658,95 @@
1631
1658
  color: var(--skirbi-primary-main);
1632
1659
  }
1633
1660
 
1634
- /* Toolbar (search) */
1661
+ /* Toolbar: search on the left, per-page on the right. Both decide what
1662
+ * the query returns, which is why they sit together above the table
1663
+ * rather than with the pager, which only moves through the result. */
1664
+ /* Both the panel and the section it renders: the controls are children
1665
+ * of the section, so that is what has to be the flex container, and the
1666
+ * panel is laid out the same way for the moment before it renders. */
1667
+ [semtic-table-toolbar],
1668
+ [semtic-table-toolbar] > section {
1669
+ margin-bottom: 0;
1670
+ display: flex;
1671
+ flex-wrap: wrap;
1672
+ align-items: center;
1673
+ gap: 0.75rem;
1674
+
1675
+ /* The search box takes the slack, so the two selectors stay together
1676
+ * on the right instead of drifting with its width. */
1677
+ > [semtic-table-search] {
1678
+ margin-inline-end: auto;
1679
+ }
1680
+ }
1681
+
1635
1682
  [semtic-table-toolbar] {
1636
1683
  margin-bottom: 0.75rem;
1637
1684
  }
1638
1685
 
1639
- [semtic-table-search] {
1640
- width: 100%;
1641
- padding: 0.5rem 0.75rem;
1642
- border: 1px solid var(--skirbi-surface-border-final);
1643
- border-radius: 0.375rem;
1644
- background: var(--skirbi-surface-bg-final);
1645
- color: inherit;
1646
- font-size: inherit;
1686
+ /* Size to their own content rather than sharing the row equally: a
1687
+ * per-page list of two-digit numbers does not need the same width as a
1688
+ * page list running into the hundreds. */
1689
+ :is([semtic-table-page-jump], [semtic-table-page-size]) {
1690
+ flex: 0 0 auto;
1647
1691
  }
1648
1692
 
1649
- /* Pagination */
1693
+ /* A form control always renders its error span, empty or not, so that
1694
+ * label-error-position has something to place. In a form that costs
1695
+ * nothing -- the row is empty and every field pays it equally. Here the
1696
+ * control is sitting next to buttons that have no such row, so the grid
1697
+ * gap under it pushed the visible box up off their centre line by half
1698
+ * a gap. Dropping the empty row is safe for placement: these two are
1699
+ * never going to show a validation error.
1700
+ */
1701
+ :is([semtic-table-page-jump], [semtic-table-page-size]) [semtic-error]:empty {
1702
+ display: none;
1703
+ }
1704
+
1705
+ /* Pagination
1706
+ *
1707
+ * Three parts, in reading order: what you are looking at, how much of
1708
+ * it to show, and how to move. The summary takes the slack so the
1709
+ * controls stay together on the right and do not shift as the numbers
1710
+ * in it change width. Wraps rather than overflows on a narrow table.
1711
+ */
1650
1712
  tfoot td {
1651
1713
  padding-top: 0.75rem;
1652
1714
  display: flex;
1715
+ flex-wrap: wrap;
1653
1716
  align-items: center;
1654
1717
  gap: 0.75rem;
1655
1718
  }
1656
1719
 
1657
- [semtic-table-page-info] {
1720
+ /* Prose about the table, so it takes the quieter, smaller treatment --
1721
+ * and the slack, so the pager stays right as the numbers in it change
1722
+ * width. The two selectors are controls, not prose, and keep the size
1723
+ * every other control has: shrinking them made them visibly shorter
1724
+ * than the search box they share a row with. */
1725
+ [semtic-table-summary] {
1726
+ margin-inline-end: auto;
1658
1727
  font-size: 0.875rem;
1659
1728
  color: var(--skirbi-text-muted-final);
1660
1729
  }
1661
1730
 
1662
- /* Loading state */
1663
- [semtic-table-root][semtic-loading] {
1731
+ /* The step buttons and the page selector are different heights -- a
1732
+ * button is padded text, the selector is a full form control with a
1733
+ * label beside it -- so they are centred against each other rather than
1734
+ * sharing a top or a baseline. align-self on the children as well as
1735
+ * align-items on the box, because a stretch coming from anywhere else
1736
+ * would otherwise decide this instead. */
1737
+ [semtic-table-pager] {
1738
+ display: flex;
1739
+ align-items: center;
1740
+ gap: 0.75rem;
1741
+
1742
+ > * {
1743
+ align-self: center;
1744
+ }
1745
+ }
1746
+
1747
+ /* Loading state. On the host now -- there used to be a wrapper div
1748
+ * inside semtic-table whose only job was to carry this attribute. */
1749
+ &[semtic-loading] {
1664
1750
  opacity: 0.6;
1665
1751
  pointer-events: none;
1666
1752
  }
@@ -1713,7 +1799,18 @@
1713
1799
  *
1714
1800
  * Default navigation recipe for `<semtic-nav>`.
1715
1801
  *
1716
- * Includes brand, links, social navigation, and small-screen wrapping rules.
1802
+ * Includes brand, links, social navigation, and a mobile hamburger toggle
1803
+ * (below the mobile breakpoint) that opens the link list as a 3-column
1804
+ * dropdown. `hamburger="left"` (default) or `hamburger="right"` picks
1805
+ * which side of the bar the toggle sits on.
1806
+ *
1807
+ * | Token | Purpose |
1808
+ * | --- | --- |
1809
+ * | `--skirbi-nav-mobile-bg` | Background of the open mobile dropdown. |
1810
+ * | `--skirbi-nav-mobile-border` | Border between the dropdown and the bar above it. |
1811
+ * | `--skirbi-nav-mobile-item-bg` | Resting background of each item tile in the open dropdown. |
1812
+ * | `--skirbi-nav-mobile-item-border` | Border of each item tile in the open dropdown. |
1813
+ * | `--skirbi-nav-mobile-item-active-bg` | Background of an item tile while pressed. |
1717
1814
  */
1718
1815
 
1719
1816
  /* semtic-nav */
@@ -1828,38 +1925,258 @@
1828
1925
  display: contents;
1829
1926
  }
1830
1927
 
1831
- @media (max-width: 47.999rem) {
1928
+ /* [semtic-nav-links] is a real box (not display: contents), unlike
1929
+ * semtic-nav-item -- it's the one thing the mobile recipe below needs
1930
+ * to collapse/expand as a unit, regardless of what's authored inside
1931
+ * it (a bare list of items, a <ul>, semtic-nav-section, ...). */
1932
+ semtic-nav [semtic-nav-links] {
1933
+ display: flex;
1934
+ align-items: center;
1935
+ gap: 0.25rem;
1936
+ }
1937
+
1938
+ semtic-nav [semtic-nav-toggle] {
1939
+ display: none;
1940
+ align-items: center;
1941
+ justify-content: center;
1942
+ inline-size: 2.25rem;
1943
+ block-size: 2.25rem;
1944
+ padding: 0;
1945
+ border: 1px solid var(--skirbi-surface-border-final);
1946
+ border-radius: 0.375rem;
1947
+ background: var(--skirbi-surface-base, #fff);
1948
+ color: inherit;
1949
+ cursor: pointer;
1950
+ }
1951
+
1952
+ semtic-nav [semtic-nav-toggle-bar] {
1953
+ position: relative;
1954
+ display: block;
1955
+ inline-size: 1.1rem;
1956
+ block-size: 2px;
1957
+ background: currentColor;
1958
+
1959
+ &::before,
1960
+ &::after {
1961
+ content: '';
1962
+ position: absolute;
1963
+ left: 0;
1964
+ inline-size: 100%;
1965
+ block-size: 2px;
1966
+ background: currentColor;
1967
+ }
1968
+
1969
+ &::before {
1970
+ top: -6px;
1971
+ }
1972
+
1973
+ &::after {
1974
+ top: 6px;
1975
+ }
1976
+ }
1977
+
1978
+ /* 48rem, matching the diptych/triptych stacking breakpoint below --
1979
+ * this used to be 47.999rem, a fraction under, which meant a page
1980
+ * combining this nav with a diptych/triptych (every real page in
1981
+ * eekboek-www, for one) had its layout stack and its nav collapse at
1982
+ * two DIFFERENT widths, with a sliver of viewport width where one
1983
+ * had already responded and the other hadn't yet. */
1984
+ @media (max-width: 48rem) {
1985
+ /* A 2-column/2-row grid, not flex-wrap -- flex-wrap only breaks a
1986
+ * line once the current line actually runs out of room, so
1987
+ * whether [semtic-nav-links] (however wide its own content makes
1988
+ * it) landed on the bar's own line or wrapped below it depended on
1989
+ * viewport width: wide enough for toggle+brand+links together
1990
+ * (roughly 511-767px, with eekboek-www's own item list) and it
1991
+ * sat right next to the brand instead of below it. Explicit grid
1992
+ * placement makes "toggle+brand on row 1, links on row 2" true at
1993
+ * every width in this query, never a function of how much content
1994
+ * happens to fit. */
1832
1995
  semtic-nav > nav {
1833
- flex-wrap: wrap;
1834
- gap: 0.75rem;
1996
+ display: grid;
1997
+ grid-template-columns: auto 1fr;
1998
+ align-items: center;
1999
+ }
2000
+
2001
+ /* hamburger="right" swaps the two columns' roles rather than just
2002
+ * reordering within a fixed track list -- with the toggle's own
2003
+ * column staying `auto`-sized and the other `1fr`, either side
2004
+ * gets the same "hug the button, give the brand the rest" sizing
2005
+ * regardless of which one it is. */
2006
+ semtic-nav[hamburger="right"] > nav {
2007
+ grid-template-columns: 1fr auto;
2008
+ }
2009
+
2010
+ semtic-nav > nav > [semtic-nav-toggle] {
2011
+ display: inline-flex;
2012
+ grid-column: 1;
2013
+ grid-row: 1;
2014
+ }
2015
+
2016
+ semtic-nav[hamburger="right"] > nav > [semtic-nav-toggle] {
2017
+ grid-column: 2;
2018
+ }
2019
+
2020
+ /* Nothing to open -- a brand-only nav (no items authored at all)
2021
+ * would otherwise still show a toggle that reveals an empty panel.
2022
+ * Relies on semtic-nav.mjs's own connectedCallbackSugar dropping
2023
+ * whitespace-only text nodes rather than moving them into
2024
+ * [semtic-nav-links] -- otherwise a stray newline left over from
2025
+ * the authored HTML's own formatting (e.g. between the brand and
2026
+ * an `<%= include ... %>` that rendered nothing while logged out)
2027
+ * would keep this from ever matching `:empty`. (`:has(*)` inside
2028
+ * this same :has() would have sufficed too and dodged that
2029
+ * dependency, but :has() can't nest inside :has() -- invalid
2030
+ * selector, silently never matches.) */
2031
+ semtic-nav:has(> nav > [semtic-nav-links]:empty) > nav > [semtic-nav-toggle] {
2032
+ display: none;
2033
+ }
2034
+
2035
+ semtic-nav > nav > [semtic-nav-brand] {
2036
+ grid-column: 2;
2037
+ grid-row: 1;
2038
+ }
2039
+
2040
+ semtic-nav[hamburger="right"] > nav > [semtic-nav-brand] {
2041
+ grid-column: 1;
2042
+ }
2043
+
2044
+ semtic-nav > nav > [semtic-nav-links] {
2045
+ display: none;
2046
+ }
2047
+
2048
+ /* A 3-per-row grid, not a single stacked column -- with a longer
2049
+ * item list (see eekboek-www's Sales/Purchases/Bank/... top nav)
2050
+ * one-per-line ran the open dropdown well past the fold before the
2051
+ * last couple of items were even reachable. The grid lands on
2052
+ * [semtic-nav-links] itself, so it doesn't matter whether the
2053
+ * items are its direct children (the bare-items case this
2054
+ * component's own tests use) or grouped under an authored <ul>
2055
+ * (a common pattern; see eekboek-www's main_nav.html.ep) -- an
2056
+ * authored <ul> is flattened out of the box model entirely
2057
+ * (`display: contents`) so its <li>s become grid items of
2058
+ * [semtic-nav-links] directly, same as the bare-items case. */
2059
+ semtic-nav[semtic-nav-open] > nav > [semtic-nav-links] {
2060
+ display: grid;
2061
+ grid-column: 1 / -1;
2062
+ grid-row: 2;
2063
+ /* Tiles size to their own label, not stretched to fill an equal
2064
+ * share of the row -- `justify-self: center` (not `justify-
2065
+ * content`, which centers tracks WITHIN a box, not the box
2066
+ * itself) then centers the now content-sized box within its
2067
+ * full-width grid area, same idea as `margin: auto` on a block
2068
+ * box but the grid-native way to do it for a grid ITEM. */
2069
+ justify-self: center;
2070
+ width: fit-content;
2071
+ grid-template-columns: repeat(3, max-content);
2072
+ gap: 0.25rem;
2073
+ /* A real panel, not a see-through overlay on whatever's
2074
+ * scrolled underneath -- the dropdown sits on top of page
2075
+ * content (it's still inside <nav>, not a separate layer), so
2076
+ * without an opaque background the open menu's own text and
2077
+ * the page's own would visually run together. */
2078
+ background: var(--skirbi-nav-mobile-bg, var(--skirbi-surface-bg-final));
2079
+ border: 1px solid var(--skirbi-nav-mobile-border, var(--skirbi-surface-border-final));
2080
+ border-radius: 0.5rem;
2081
+ padding: 0.75rem;
2082
+ margin-block-start: 0.75rem;
2083
+ }
2084
+
2085
+ semtic-nav[semtic-nav-open] > nav > [semtic-nav-links] > ul {
2086
+ display: contents;
2087
+ }
2088
+
2089
+ /* The inline "𐄁" separator between items reads fine in a single
2090
+ * row; stacked one-per-line in the open dropdown it just leaves a
2091
+ * stray mark floating before each label. */
2092
+ semtic-nav[semtic-nav-open] semtic-nav-item + semtic-nav-item::before {
2093
+ content: none;
2094
+ }
2095
+
2096
+ /* [semtic-nav-link] already gets the shared item recipe's hover/
2097
+ * current-page tint (see :is(semtic-nav-item, semtic-nav-item-group)
2098
+ * [semtic-nav-link] above), but that's a :hover effect -- with no
2099
+ * mouse to hover with, a tapped item on a touch device never shows
2100
+ * it, so a mobile-open item needs its own resting affordance to
2101
+ * read as a tile at all instead of plain stacked text. */
2102
+ semtic-nav[semtic-nav-open] > nav > [semtic-nav-links] [semtic-nav-link] {
2103
+ background: var(--skirbi-nav-mobile-item-bg, var(--skirbi-surface-base, #fff));
2104
+ border: 1px solid var(--skirbi-nav-mobile-item-border, var(--skirbi-surface-border-final));
2105
+ }
2106
+
2107
+ semtic-nav[semtic-nav-open] > nav > [semtic-nav-links] [semtic-nav-link]:active {
2108
+ background: var(--skirbi-nav-mobile-item-active-bg, color-mix(
2109
+ in srgb, var(--skirbi-primary-main) 12%, transparent
2110
+ ));
1835
2111
  }
1836
2112
 
1837
- semtic-nav [semtic-nav-brand] {
1838
- flex: 1 0 100%;
2113
+ /* Topbar links otherwise have no marker at all (that's only ever
2114
+ * been a sidenav-submenu thing, see the nested-children rule
2115
+ * further down) -- the mobile dropdown tile needs its own "leads
2116
+ * somewhere" affordance since it doesn't get one from anywhere
2117
+ * else. */
2118
+ semtic-nav[semtic-nav-open] > nav > [semtic-nav-links] [semtic-nav-link]:not([semtic-nav-heading])::before {
2119
+ content: var(--skirbi-nav-marker, '›');
2120
+ opacity: 0.5;
2121
+ font-size: 1em;
1839
2122
  }
1840
2123
  }
1841
2124
  }
1842
2125
 
1843
- /* semtic-nav-item */
2126
+ /* semtic-nav-item / semtic-nav-item-group */
1844
2127
  [skirbi-theme] {
1845
2128
  semtic-nav-item > li {
1846
2129
  list-style: none;
1847
2130
  display: inline-flex;
1848
2131
  }
1849
2132
 
1850
- semtic-nav-item [semtic-nav-link] {
2133
+ /* Group <li> holds the header link AND the children <ul> — those must
2134
+ stack vertically, not sit side-by-side as inline-flex row items. */
2135
+ semtic-nav-item-group > li {
2136
+ list-style: none;
2137
+ display: flex;
2138
+ flex-direction: column;
2139
+ align-items: stretch;
2140
+ }
2141
+
2142
+ :is(semtic-nav-item, semtic-nav-item-group) [semtic-nav-link] {
1851
2143
  display: flex;
1852
- align-items: center;
2144
+
2145
+ /* Start, not center: a label that wraps to two lines would otherwise
2146
+ * center the marker against the whole block, leaving it floating
2147
+ * between the lines instead of sitting with the first one. */
2148
+ align-items: flex-start;
2149
+
2150
+ /* The button recipe sets nowrap and clips the overflow, so a group
2151
+ * header longer than the sidenav was cut off rather than wrapped.
2152
+ * break-word covers the case a single token is wider than the column,
2153
+ * which nothing else can rescue. */
2154
+ white-space: normal;
2155
+ overflow-wrap: break-word;
2156
+ overflow: visible;
2157
+
2158
+ /* A group header with no href renders as a <button>, so it picks up the
2159
+ * button recipe -- which centers its content. Combined with the
2160
+ * width: 100% below, that centered a group's label in the row instead
2161
+ * of starting it where every other label starts. The rest of that
2162
+ * recipe is already undone further down (text-transform, letter-spacing,
2163
+ * background, border, font); this is the piece that was missed. */
2164
+ justify-content: flex-start;
2165
+
1853
2166
  gap: 0.375rem;
1854
2167
  padding: 0.375rem 0.75rem;
1855
2168
  border-radius: 0.375rem;
1856
2169
  text-decoration: none;
2170
+ text-transform: none;
2171
+ letter-spacing: normal;
1857
2172
  color: inherit;
1858
2173
  background: transparent;
1859
2174
  border: none;
1860
2175
  cursor: pointer;
1861
2176
  font: inherit;
1862
2177
  font-size: 0.9rem;
2178
+ width: 100%;
2179
+ text-align: left;
1863
2180
  transition:
1864
2181
  background var(--skirbi-transition-duration, 160ms)
1865
2182
  var(--skirbi-transition-ease, ease),
@@ -1867,14 +2184,23 @@
1867
2184
  var(--skirbi-transition-ease, ease);
1868
2185
  }
1869
2186
 
1870
- semtic-nav-item [semtic-nav-link]:hover {
2187
+ /* A group header with no href and no action names the items under it
2188
+ * rather than doing anything, so it should not offer the affordances of
2189
+ * one that does: no pointer, no hover response. */
2190
+ :is(semtic-nav-item, semtic-nav-item-group)
2191
+ [semtic-nav-link][semtic-nav-heading] {
2192
+ cursor: default;
2193
+ }
2194
+
2195
+ :is(semtic-nav-item, semtic-nav-item-group)
2196
+ [semtic-nav-link]:not([semtic-nav-heading]):hover {
1871
2197
  background: color-mix(
1872
2198
  in srgb, var(--skirbi-primary-main) 8%, transparent
1873
2199
  );
1874
2200
  color: var(--skirbi-primary-main);
1875
2201
  }
1876
2202
 
1877
- semtic-nav-item :is(
2203
+ :is(semtic-nav-item, semtic-nav-item-group) :is(
1878
2204
  li[aria-current="page"] > [semtic-nav-link],
1879
2205
  [semtic-nav-link][aria-current="page"]
1880
2206
  ) {
@@ -1885,14 +2211,28 @@
1885
2211
  font-weight: 600;
1886
2212
  }
1887
2213
 
1888
- semtic-nav-item [semtic-nav-children] semtic-nav-item [semtic-nav-link]
1889
- ::before {
1890
- content: '›';
2214
+ /* Sidenav items always get the marker (not just nested children) --
2215
+ * unlike the topbar (see semtic-nav's own mobile-only rule), a
2216
+ * sidenav's whole reason for existing is "this leads to a page", so
2217
+ * the affordance is always relevant there, not just below the topbar's
2218
+ * mobile breakpoint. */
2219
+ semtic-sidenav [semtic-nav-link]:not([semtic-nav-heading])::before {
2220
+ content: var(--skirbi-nav-marker, '›');
2221
+ opacity: 0.5;
2222
+ font-size: 1em;
2223
+ }
2224
+
2225
+ /* The newline before ::before used to be a descendant combinator, so this
2226
+ * marked every element inside the link instead of the link itself -- and
2227
+ * a link holds only text, so nothing was ever marked. */
2228
+ :is(semtic-nav-item, semtic-nav-item-group)
2229
+ [semtic-nav-children] semtic-nav-item [semtic-nav-link]::before {
2230
+ content: var(--skirbi-nav-marker, '›');
1891
2231
  opacity: 0.5;
1892
2232
  font-size: 1em;
1893
2233
  }
1894
2234
 
1895
- semtic-nav-item [semtic-nav-children] {
2235
+ :is(semtic-nav-item, semtic-nav-item-group) [semtic-nav-children] {
1896
2236
  list-style: none;
1897
2237
  margin: 0;
1898
2238
  padding: 0 0 0 1rem;
@@ -1915,6 +2255,22 @@
1915
2255
  color: var(--skirbi-text-muted-final);
1916
2256
  }
1917
2257
 
2258
+ /* A linked section title. It inherits the label's own treatment -- size,
2259
+ * weight, letter-spacing, muted colour -- and only drops the underline,
2260
+ * so linking a section does not turn it into something that reads like an
2261
+ * item. */
2262
+ semtic-nav-section [semtic-nav-section-link] {
2263
+ color: inherit;
2264
+ font: inherit;
2265
+ letter-spacing: inherit;
2266
+ text-transform: inherit;
2267
+ text-decoration: none;
2268
+ }
2269
+
2270
+ semtic-nav-section [semtic-nav-section-link]:hover {
2271
+ text-decoration: underline;
2272
+ }
2273
+
1918
2274
  semtic-nav-section [semtic-nav-section-body] {
1919
2275
  list-style: none;
1920
2276
  margin: 0;
@@ -1985,6 +2341,10 @@
1985
2341
  left: 0;
1986
2342
  top: 0;
1987
2343
  bottom: 0;
2344
+
2345
+ /* Pinned top to bottom, same problem as the desktop rule below. */
2346
+ overflow-y: auto;
2347
+
1988
2348
  transform: translateX(-100%);
1989
2349
  transition: transform var(--skirbi-transition-duration, 160ms)
1990
2350
  var(--skirbi-transition-ease, ease);
@@ -2012,6 +2372,63 @@
2012
2372
  position: sticky;
2013
2373
  top: 0;
2014
2374
  height: 100vh;
2375
+
2376
+ /* Pinned to the viewport height, so a menu taller than the screen has
2377
+ * nowhere to go without this: the items past the fold were simply
2378
+ * unreachable. */
2379
+ overflow-y: auto;
2380
+ }
2381
+ }
2382
+ }
2383
+
2384
+ /**
2385
+ * @styles pinta.semtic-sidenav-indent Semtic sidenav, indented
2386
+ *
2387
+ * Opt-in variant: `<semtic-sidenav indent>`.
2388
+ *
2389
+ * Shows depth as indentation against a shared left edge, rather than as
2390
+ * nested boxes. Every item is prefixed with a marker, and a group's
2391
+ * children start where the group's own label starts, so the markers form a
2392
+ * column per level and the menu reads as an outline. Suits a menu several
2393
+ * levels deep; the default recipe suits a flat one.
2394
+ *
2395
+ * EVENT 2026
2396
+ * > Access
2397
+ * > Divisions
2398
+ * > Mixed
2399
+ * > Teams
2400
+ *
2401
+ * That alignment is why the marker is given an explicit inline-size. As a
2402
+ * bare glyph it is whatever width the font makes it, and the indent below
2403
+ * would have to guess that width to line anything up -- it would drift with
2404
+ * the font and land differently for a different marker. Sized here, one
2405
+ * step is exactly marker + the link's own gap, and the column is
2406
+ * arithmetic rather than a value that looked about right.
2407
+ */
2408
+ [skirbi-theme] {
2409
+ semtic-sidenav[indent] {
2410
+ --skirbi-sidenav-marker-size: 0.75rem;
2411
+
2412
+ /* The gap the link already puts between the marker and its text, so
2413
+ * one step lands the child's marker under the parent's text. */
2414
+ --skirbi-sidenav-marker-gap: 0.375rem;
2415
+
2416
+ [semtic-nav-section-body] {
2417
+ padding-inline-start: var(--skirbi-sidenav-indent, 0.75rem);
2418
+ }
2419
+
2420
+ [semtic-nav-children] {
2421
+ padding-inline-start: calc(
2422
+ var(--skirbi-sidenav-marker-size) + var(--skirbi-sidenav-marker-gap)
2423
+ );
2424
+ }
2425
+
2426
+ [semtic-nav-section-body] [semtic-nav-link]::before {
2427
+ content: '›';
2428
+ inline-size: var(--skirbi-sidenav-marker-size);
2429
+ flex: 0 0 auto;
2430
+ text-align: center;
2431
+ opacity: 0.5;
2015
2432
  }
2016
2433
  }
2017
2434
  }
@@ -2149,8 +2566,6 @@
2149
2566
  --skirbi-toggle-track-height: 1.35rem;
2150
2567
  --skirbi-toggle-thumb-size: 1rem;
2151
2568
  --skirbi-toggle-thumb-offset: 0.175rem;
2152
- --skirbi-toggle-pill-padding-block: 0.3rem;
2153
- --skirbi-toggle-pill-padding-inline: 0.75rem;
2154
2569
  --skirbi-toggle-bg-off: var(--skirbi-surface-border-final);
2155
2570
  --skirbi-toggle-bg-on: var(--skirbi-primary-main);
2156
2571
  --skirbi-toggle-fg-on: var(--skirbi-primary-contrast);
@@ -2211,12 +2626,12 @@
2211
2626
  justify-items: start;
2212
2627
  }
2213
2628
 
2214
- &:not([type="pill"])[label-position="inside"]
2629
+ &[label-position="inside"]
2215
2630
  [semtic-toggle-visual] {
2216
2631
  grid-template-areas: "label thumb";
2217
2632
  }
2218
2633
 
2219
- &:not([type="pill"]) [semtic-toggle-thumb],
2634
+ & [semtic-toggle-thumb],
2220
2635
  &[type="switch"] [semtic-toggle-thumb] {
2221
2636
  position: relative;
2222
2637
  display: inline-block;
@@ -2248,14 +2663,14 @@
2248
2663
  }
2249
2664
  }
2250
2665
 
2251
- &:not([type="pill"]) input[wc-control]:checked
2666
+ & input[wc-control]:checked
2252
2667
  + [semtic-toggle-visual] [semtic-toggle-thumb],
2253
2668
  &[type="switch"] input[wc-control]:checked
2254
2669
  + [semtic-toggle-visual] [semtic-toggle-thumb] {
2255
2670
  background: var(--skirbi-toggle-bg-on);
2256
2671
  }
2257
2672
 
2258
- &:not([type="pill"]) input[wc-control]:checked
2673
+ & input[wc-control]:checked
2259
2674
  + [semtic-toggle-visual] [semtic-toggle-thumb]::before,
2260
2675
  &[type="switch"] input[wc-control]:checked
2261
2676
  + [semtic-toggle-visual] [semtic-toggle-thumb]::before {
@@ -2268,106 +2683,6 @@
2268
2683
  );
2269
2684
  }
2270
2685
 
2271
- &[type="pill"] [semtic-toggle-visual] {
2272
- display: inline-flex;
2273
- align-items: center;
2274
- justify-content: center;
2275
- width: fit-content;
2276
- min-inline-size: 0;
2277
- padding:
2278
- var(--skirbi-toggle-pill-padding-block)
2279
- var(--skirbi-toggle-pill-padding-inline);
2280
- border: 1px solid var(--skirbi-toggle-border);
2281
- border-radius: 999px;
2282
- background: transparent;
2283
- color: inherit;
2284
- line-height: 1.1;
2285
- white-space: nowrap;
2286
- transition:
2287
- background var(--skirbi-transition-duration, 180ms)
2288
- var(--skirbi-transition-ease, ease),
2289
- border-color var(--skirbi-transition-duration, 180ms)
2290
- var(--skirbi-transition-ease, ease),
2291
- color var(--skirbi-transition-duration, 180ms)
2292
- var(--skirbi-transition-ease, ease),
2293
- box-shadow var(--skirbi-transition-duration, 180ms)
2294
- var(--skirbi-transition-ease, ease);
2295
- }
2296
-
2297
- &[type="pill"] [semtic-toggle-thumb] {
2298
- display: none;
2299
- }
2300
-
2301
- &[type="pill"] input[wc-control]:checked
2302
- + [semtic-toggle-visual] {
2303
- background: var(--skirbi-toggle-bg-on);
2304
- border-color: var(--skirbi-toggle-bg-on);
2305
- color: var(--skirbi-toggle-fg-on);
2306
- }
2307
-
2308
- &[type="pill"][label-position="left"] [semtic-toggle-visual],
2309
- &[type="pill"][label-position="right"] [semtic-toggle-visual],
2310
- &[type="pill"][label-position="top"] [semtic-toggle-visual],
2311
- &[type="pill"][label-position="bottom"] [semtic-toggle-visual] {
2312
- display: inline-grid;
2313
- padding: 0;
2314
- border: 0;
2315
- border-radius: 0;
2316
- background: transparent;
2317
- color: inherit;
2318
- }
2319
-
2320
- &[type="pill"][label-position="left"] [semtic-toggle-visual] {
2321
- grid-template-areas: "label thumb";
2322
- }
2323
-
2324
- &[type="pill"][label-position="right"] [semtic-toggle-visual] {
2325
- grid-template-areas: "thumb label";
2326
- }
2327
-
2328
- &[type="pill"][label-position="top"] [semtic-toggle-visual] {
2329
- grid-template-areas:
2330
- "label"
2331
- "thumb";
2332
- justify-items: start;
2333
- }
2334
-
2335
- &[type="pill"][label-position="bottom"] [semtic-toggle-visual] {
2336
- grid-template-areas:
2337
- "thumb"
2338
- "label";
2339
- justify-items: start;
2340
- }
2341
-
2342
- &[type="pill"][label-position="left"] [semtic-toggle-thumb],
2343
- &[type="pill"][label-position="right"] [semtic-toggle-thumb],
2344
- &[type="pill"][label-position="top"] [semtic-toggle-thumb],
2345
- &[type="pill"][label-position="bottom"] [semtic-toggle-thumb] {
2346
- display: inline-flex;
2347
- grid-area: thumb;
2348
- align-items: center;
2349
- justify-content: center;
2350
- min-inline-size: 2rem;
2351
- padding:
2352
- var(--skirbi-toggle-pill-padding-block)
2353
- var(--skirbi-toggle-pill-padding-inline);
2354
- border: 1px solid var(--skirbi-toggle-border);
2355
- border-radius: 999px;
2356
- background: transparent;
2357
- }
2358
-
2359
- &[type="pill"][label-position="left"] input[wc-control]:checked
2360
- + [semtic-toggle-visual] [semtic-toggle-thumb],
2361
- &[type="pill"][label-position="right"] input[wc-control]:checked
2362
- + [semtic-toggle-visual] [semtic-toggle-thumb],
2363
- &[type="pill"][label-position="top"] input[wc-control]:checked
2364
- + [semtic-toggle-visual] [semtic-toggle-thumb],
2365
- &[type="pill"][label-position="bottom"] input[wc-control]:checked
2366
- + [semtic-toggle-visual] [semtic-toggle-thumb] {
2367
- background: var(--skirbi-toggle-bg-on);
2368
- border-color: var(--skirbi-toggle-bg-on);
2369
- }
2370
-
2371
2686
  input[wc-control]:focus-visible + [semtic-toggle-visual],
2372
2687
  input[wc-control]:focus-visible
2373
2688
  + [semtic-toggle-visual] [semtic-toggle-thumb] {
@@ -2379,43 +2694,6 @@
2379
2694
  cursor: not-allowed;
2380
2695
  opacity: 0.55;
2381
2696
  }
2382
-
2383
- &[type="pill"] {
2384
- display: inline-block;
2385
- width: fit-content;
2386
- }
2387
-
2388
- &[type="pill"] > label[semtic-toggle] {
2389
- display: inline-block;
2390
- width: fit-content;
2391
- }
2392
-
2393
- &[type="pill"] > label[semtic-toggle]
2394
- > input[wc-control] + [semtic-toggle-visual] {
2395
- display: inline-flex;
2396
- align-items: center;
2397
- justify-content: center;
2398
- width: fit-content;
2399
- min-width: 0;
2400
- padding: 0.3rem 0.75rem;
2401
- border: 1px solid var(--skirbi-surface-border-final);
2402
- border-radius: 999px;
2403
- background: transparent;
2404
- color: inherit;
2405
- line-height: 1.1;
2406
- white-space: nowrap;
2407
- }
2408
-
2409
- &[type="pill"] [semtic-toggle-thumb] {
2410
- display: none;
2411
- }
2412
-
2413
- &[type="pill"] > label[semtic-toggle]
2414
- > input[wc-control]:checked + [semtic-toggle-visual] {
2415
- background: var(--skirbi-primary-main);
2416
- border-color: var(--skirbi-primary-main);
2417
- color: var(--skirbi-primary-contrast);
2418
- }
2419
2697
  }
2420
2698
  }
2421
2699
 
@@ -2432,17 +2710,45 @@
2432
2710
 
2433
2711
  /* Form controls (label-position) */
2434
2712
  [skirbi-theme] {
2713
+ /* Form controls are two nested grids, not one flex box.
2714
+ *
2715
+ * The host places the definition against the error, per
2716
+ * label-error-position. The definition places the label against the
2717
+ * control, per label-position. Neither knows about the other, so the two
2718
+ * attributes stop multiplying -- as flex they had to be resolved
2719
+ * together, which is how label-position="top" ended up needing its own
2720
+ * bespoke grid while the rest stayed on flex-direction.
2721
+ *
2722
+ * Everything is placed by named area, so nothing depends on source order
2723
+ * and there is no reversed axis: row-reverse used to put the control on
2724
+ * the far side of its own label, which is why anything positioned
2725
+ * against the control landed on the wrong side under
2726
+ * label-position="right".
2727
+ */
2435
2728
  semtic-input,
2729
+ semtic-input-number,
2436
2730
  semtic-select,
2437
2731
  semtic-textarea,
2438
2732
  semtic-checkbox,
2439
2733
  semtic-radio {
2440
- display: flex;
2441
- flex-direction: row;
2734
+ display: grid;
2735
+ gap: 0.5rem;
2442
2736
  align-items: center;
2737
+ grid-template-areas: "definition" "error";
2738
+ }
2739
+
2740
+ [semtic-input-definition] {
2741
+ display: grid;
2443
2742
  gap: 0.5rem;
2743
+ align-items: center;
2744
+ min-inline-size: 0;
2745
+ grid-area: definition;
2444
2746
  }
2445
2747
 
2748
+ [semtic-label] { grid-area: label; }
2749
+ [semtic-input-container] { grid-area: control; min-inline-size: 0; }
2750
+ [semtic-error] { grid-area: error; }
2751
+
2446
2752
  input[wc-control],
2447
2753
  select[wc-control],
2448
2754
  textarea[wc-control] {
@@ -2450,74 +2756,59 @@
2450
2756
  -webkit-appearance: none;
2451
2757
  }
2452
2758
 
2453
- semtic-input[label-position="left"],
2454
- semtic-select[label-position="left"],
2455
- semtic-textarea[label-position="left"],
2456
- semtic-checkbox[label-position="left"],
2457
- semtic-radio[label-position="left"] {
2458
- flex-direction: row;
2459
- align-items: center;
2460
- }
2461
-
2462
- semtic-input[label-position="right"],
2463
- semtic-select[label-position="right"],
2464
- semtic-textarea[label-position="right"],
2465
- semtic-checkbox[label-position="right"],
2466
- semtic-radio[label-position="right"] {
2467
- flex-direction: row-reverse;
2468
- align-items: center;
2469
- }
2470
-
2471
- semtic-input[label-position="top"],
2472
- semtic-select[label-position="top"],
2473
- semtic-textarea[label-position="top"],
2474
- semtic-checkbox[label-position="top"],
2475
- semtic-radio[label-position="top"] {
2476
- flex-direction: column;
2477
- align-items: flex-start;
2478
- }
2479
-
2480
- semtic-input[label-position="bottom"],
2481
- semtic-select[label-position="bottom"],
2482
- semtic-textarea[label-position="bottom"],
2483
- semtic-checkbox[label-position="bottom"],
2484
- semtic-radio[label-position="bottom"] {
2485
- flex-direction: column-reverse;
2486
- align-items: flex-start;
2487
- }
2488
-
2489
- semtic-input[label-position="top"] input[wc-control],
2490
- semtic-input[label-position="bottom"] input[wc-control],
2491
- semtic-select[label-position="top"] select[wc-control],
2492
- semtic-select[label-position="bottom"] select[wc-control],
2493
- semtic-textarea[label-position="top"] textarea[wc-control],
2494
- semtic-textarea[label-position="bottom"] textarea[wc-control] {
2759
+ /* label-position: label against control, inside the definition.
2760
+ * semtic-input-number was missing from every one of these lists --
2761
+ * added after this file, never wired in -- so label-position had
2762
+ * silently done nothing for it until now. */
2763
+ semtic-input[label-position="top"] [semtic-input-definition],
2764
+ semtic-input-number[label-position="top"] [semtic-input-definition],
2765
+ semtic-select[label-position="top"] [semtic-input-definition],
2766
+ semtic-textarea[label-position="top"] [semtic-input-definition],
2767
+ semtic-checkbox[label-position="top"] [semtic-input-definition],
2768
+ semtic-radio[label-position="top"] [semtic-input-definition] {
2769
+ grid-template-areas: "label" "control";
2770
+ grid-template-columns: minmax(0, 1fr);
2771
+ }
2772
+
2773
+ semtic-input[label-position="bottom"] [semtic-input-definition],
2774
+ semtic-input-number[label-position="bottom"] [semtic-input-definition],
2775
+ semtic-select[label-position="bottom"] [semtic-input-definition],
2776
+ semtic-textarea[label-position="bottom"] [semtic-input-definition],
2777
+ semtic-checkbox[label-position="bottom"] [semtic-input-definition],
2778
+ semtic-radio[label-position="bottom"] [semtic-input-definition] {
2779
+ grid-template-areas: "control" "label";
2780
+ grid-template-columns: minmax(0, 1fr);
2781
+ }
2782
+
2783
+ semtic-input[label-position="left"] [semtic-input-definition],
2784
+ semtic-input-number[label-position="left"] [semtic-input-definition],
2785
+ semtic-select[label-position="left"] [semtic-input-definition],
2786
+ semtic-textarea[label-position="left"] [semtic-input-definition],
2787
+ semtic-checkbox[label-position="left"] [semtic-input-definition],
2788
+ semtic-radio[label-position="left"] [semtic-input-definition] {
2789
+ grid-template-areas: "label control";
2790
+ grid-template-columns: auto minmax(0, 1fr);
2791
+ }
2792
+
2793
+ semtic-input[label-position="right"] [semtic-input-definition],
2794
+ semtic-input-number[label-position="right"] [semtic-input-definition],
2795
+ semtic-select[label-position="right"] [semtic-input-definition],
2796
+ semtic-textarea[label-position="right"] [semtic-input-definition],
2797
+ semtic-checkbox[label-position="right"] [semtic-input-definition],
2798
+ semtic-radio[label-position="right"] [semtic-input-definition] {
2799
+ grid-template-areas: "control label";
2800
+ grid-template-columns: minmax(0, 1fr) auto;
2801
+ }
2802
+
2803
+ /* The control fills its cell in every direction; the cell decides how
2804
+ * wide that is, so this no longer needs to be per label-position. */
2805
+ [semtic-input-container] > input[wc-control],
2806
+ [semtic-input-container] > select[wc-control],
2807
+ [semtic-input-container] > textarea[wc-control] {
2495
2808
  width: 100%;
2496
2809
  box-sizing: border-box;
2497
2810
  }
2498
2811
 
2499
- semtic-toggle[type="pill"][label-position="inside"]
2500
- [semtic-toggle-label] {
2501
- position: absolute;
2502
- top: 0;
2503
- right: 0;
2504
- bottom: 0;
2505
- left: 0;
2506
- display: flex;
2507
- align-items: center;
2508
- justify-content: center;
2509
- pointer-events: none;
2510
- }
2511
-
2512
- semtic-input[label-position="top"],
2513
- semtic-input[label-position="bottom"],
2514
- semtic-select[label-position="top"],
2515
- semtic-select[label-position="bottom"],
2516
- semtic-textarea[label-position="top"],
2517
- semtic-textarea[label-position="bottom"] {
2518
- width: 100%;
2519
- }
2520
-
2521
2812
  semtic-select[label-position="top"] [skirbi-select],
2522
2813
  semtic-select[label-position="bottom"] [skirbi-select] {
2523
2814
  width: 100%;
@@ -2529,12 +2820,22 @@
2529
2820
  }
2530
2821
 
2531
2822
  semtic-input:has([semtic-error]:not(:empty)) [semtic-label],
2823
+ semtic-input-number:has([semtic-error]:not(:empty)) [semtic-label],
2532
2824
  semtic-select:has([semtic-error]:not(:empty)) [semtic-label],
2533
2825
  semtic-textarea:has([semtic-error]:not(:empty)) [semtic-label] {
2534
2826
  color: var(--skirbi-error-base, #b91c1c);
2535
2827
  }
2536
2828
 
2829
+ /* The gap before a required marker is spacing, so it belongs here rather
2830
+ * than in a whitespace text node. A text node separator cannot survive a
2831
+ * morph: rendering appends it as its own node, parsing merges it into the
2832
+ * label text, and the two shapes never match. */
2833
+ [data-required-marker] {
2834
+ margin-inline-start: 0.25em;
2835
+ }
2836
+
2537
2837
  semtic-input:has([semtic-error]:not(:empty)),
2838
+ semtic-input-number:has([semtic-error]:not(:empty)),
2538
2839
  semtic-select:has([semtic-error]:not(:empty)),
2539
2840
  semtic-textarea:has([semtic-error]:not(:empty)) {
2540
2841
  background: color-mix(
@@ -2544,6 +2845,28 @@
2544
2845
  padding: 0.5rem 0.5rem 0.75rem;
2545
2846
  }
2546
2847
 
2848
+ /* A textarea is the one control that is meaningfully taller than its
2849
+ * label, so the shared `align-items: center` reads wrong on it: with the
2850
+ * label beside the control it would float halfway down. Align to the
2851
+ * start instead, on both levels. */
2852
+ semtic-textarea,
2853
+ semtic-textarea [semtic-input-definition] {
2854
+ align-items: start;
2855
+ }
2856
+
2857
+ /* Resizing along the inline axis would take the control out of its grid
2858
+ * column, so keep it to the block axis. */
2859
+ textarea[wc-control] {
2860
+ resize: vertical;
2861
+
2862
+ /* More room below the text than the shared recipe gives. An input is
2863
+ * a single line sitting in the middle of its box, so equal padding
2864
+ * reads as centred; a textarea fills from the top, which leaves the
2865
+ * last line hard against the bottom edge -- and against the resize
2866
+ * handle sitting in that corner. */
2867
+ padding-block-end: var(--skirbi-textarea-padding-block-end, 1.1rem);
2868
+ }
2869
+
2547
2870
  input[wc-control],
2548
2871
  select[wc-control],
2549
2872
  textarea[wc-control] {
@@ -2554,6 +2877,154 @@
2554
2877
  color: var(--skirbi-secondary-dark);
2555
2878
  font: inherit;
2556
2879
  box-sizing: border-box;
2880
+
2881
+ /* Stated, not inherited. `font: inherit` above also hands over the
2882
+ * page's line-height, and a <select> ignores line-height -- it lays its
2883
+ * inner box out at the font's normal whatever we say. So an input next
2884
+ * to a select grew with the page's line-height while the select stayed
2885
+ * put, and the two ended up different heights for no visible reason.
2886
+ * Naming a value close to normal makes them agree, because the one that
2887
+ * ignores it was going to land here anyway. */
2888
+ line-height: var(--skirbi-control-line-height, 1.25);
2889
+ }
2890
+
2891
+ /* Belt-and-suspenders on top of the shared padding/border/line-height
2892
+ * recipe above: a <select> is still a native, UA-drawn control, and
2893
+ * even with identical box-sizing/padding/border/line-height, browsers
2894
+ * are free to add their own fraction of a pixel to its content box
2895
+ * for the option list's internal metrics -- so it can render a hair
2896
+ * taller or shorter than an <input> sitting right next to it despite
2897
+ * every CSS value agreeing on paper. Stating the block-size outright,
2898
+ * from the exact same padding/border numbers as the recipe above,
2899
+ * removes that degree of freedom instead of chasing it per browser. */
2900
+ input[wc-control],
2901
+ select[wc-control] {
2902
+ block-size: calc(
2903
+ 1em * var(--skirbi-control-line-height, 1.25) + 2 * 0.6rem + 2px
2904
+ );
2905
+ }
2906
+
2907
+ /* Except the textarea, which is real running text: 1.25 is tight for
2908
+ * something that wraps. */
2909
+ textarea[wc-control] {
2910
+ line-height: var(--skirbi-textarea-line-height, 1.5);
2911
+ }
2912
+
2913
+ /* Clearable input
2914
+ *
2915
+ * semtic-input renders the control and its clear button inside
2916
+ * [semtic-input-container]. That box is exactly the size of
2917
+ * the control, which is the whole point: the host is not, because it
2918
+ * holds the label and the error as well, and where the control sits
2919
+ * inside it changes with label-position.
2920
+ *
2921
+ * With a box of the right size to position against, one rule covers
2922
+ * every label position -- no per-direction arithmetic, no layout that
2923
+ * depends on whether the button happens to be visible.
2924
+ *
2925
+ * :not([hidden]) stays on the button's own rules: these selectors
2926
+ * outrank the [hidden] guard further down this file, so without it a
2927
+ * clear button could never hide again.
2928
+ */
2929
+ [semtic-input-container] {
2930
+ position: relative;
2931
+ display: flex;
2932
+ align-items: center;
2933
+ min-inline-size: 0;
2934
+ }
2935
+
2936
+ [semtic-input-container] input[wc-control] {
2937
+ inline-size: 100%;
2938
+ padding-inline-end: var(--skirbi-clear-size, 2.25rem);
2939
+ }
2940
+
2941
+ /* A number input has real step buttons on either side of the control,
2942
+ * rather than an overlaid clear button. Give the input the remaining
2943
+ * space explicitly and restore its normal horizontal padding; otherwise
2944
+ * its 100% width plus clear-button allowance leaves no visible text in a
2945
+ * compact field. */
2946
+ semtic-input-number [semtic-input-container] {
2947
+ display: grid;
2948
+ grid-template-columns: auto minmax(0, 1fr) auto;
2949
+ }
2950
+
2951
+ semtic-input-number [semtic-input-container] input[wc-control] {
2952
+ min-inline-size: 0;
2953
+ padding-inline: 0.75rem;
2954
+ }
2955
+
2956
+ semtic-input-number :is([semtic-decrement], [semtic-increment]) {
2957
+ display: inline-flex;
2958
+ align-items: center;
2959
+ justify-content: center;
2960
+ min-inline-size: var(--skirbi-number-step-size, 2rem);
2961
+ block-size: 100%;
2962
+ padding: 0;
2963
+ border: 1px solid var(--skirbi-secondary-main);
2964
+ background: var(--skirbi-secondary-light);
2965
+ color: var(--skirbi-secondary-dark);
2966
+ font: inherit;
2967
+ line-height: 1;
2968
+ cursor: pointer;
2969
+ }
2970
+
2971
+ semtic-input-number [semtic-decrement] {
2972
+ border-inline-end: 0;
2973
+ border-radius: 0.375rem 0 0 0.375rem;
2974
+ }
2975
+
2976
+ semtic-input-number [semtic-increment] {
2977
+ border-inline-start: 0;
2978
+ border-radius: 0 0.375rem 0.375rem 0;
2979
+ }
2980
+
2981
+ /* type="search" comes with a clear button of its own in WebKit and
2982
+ * Chromium, which [semtic-clear] would otherwise sit next to: two
2983
+ * crosses, one themed and one not, only one of which fires the events
2984
+ * the component dispatches. `appearance: none` on the input does not
2985
+ * reach these -- they are separate shadow pseudo-elements and have to be
2986
+ * turned off by name. */
2987
+ input[wc-control][type="search"]::-webkit-search-cancel-button,
2988
+ input[wc-control][type="search"]::-webkit-search-decoration,
2989
+ input[wc-control][type="search"]::-webkit-search-results-button,
2990
+ input[wc-control][type="search"]::-webkit-search-results-decoration {
2991
+ -webkit-appearance: none;
2992
+ appearance: none;
2993
+ }
2994
+
2995
+ [semtic-clear]:not([hidden]) {
2996
+ position: absolute;
2997
+ inset-inline-end: 0.35rem;
2998
+ inset-block-start: 50%;
2999
+ transform: translateY(-50%);
3000
+ display: inline-flex;
3001
+ align-items: center;
3002
+ justify-content: center;
3003
+ inline-size: var(--skirbi-clear-size, 2.25rem);
3004
+ block-size: var(--skirbi-clear-size, 2.25rem);
3005
+ padding: 0;
3006
+ border: 0;
3007
+ border-radius: 999px;
3008
+ background: none;
3009
+ color: var(--skirbi-secondary-dark);
3010
+ font: inherit;
3011
+ line-height: 1;
3012
+ cursor: pointer;
3013
+ opacity: 0.55;
3014
+ }
3015
+
3016
+ [semtic-clear]:not([hidden]):hover,
3017
+ [semtic-clear]:not([hidden]):focus-visible {
3018
+ opacity: 1;
3019
+ }
3020
+
3021
+ input[wc-control]::placeholder,
3022
+ textarea[wc-control]::placeholder {
3023
+ color: color-mix(
3024
+ in srgb,
3025
+ var(--skirbi-secondary-dark) 65%,
3026
+ var(--skirbi-secondary-light)
3027
+ );
2557
3028
  }
2558
3029
 
2559
3030
  input[wc-control]:focus,
@@ -2566,6 +3037,123 @@
2566
3037
  );
2567
3038
  }
2568
3039
 
3040
+ /* Number inputs — drop the native up/down stepper, keep our own
3041
+ * border/background recipe instead of the browser's inset widget.
3042
+ */
3043
+ :is(
3044
+ semtic-input[type="number"],
3045
+ semtic-input-number
3046
+ ) input[wc-control][type="number"] {
3047
+ appearance: textfield;
3048
+ -moz-appearance: textfield;
3049
+ }
3050
+
3051
+ :is(
3052
+ semtic-input[type="number"],
3053
+ semtic-input-number
3054
+ ) input[wc-control][type="number"]::-webkit-outer-spin-button,
3055
+ :is(
3056
+ semtic-input[type="number"],
3057
+ semtic-input-number
3058
+ ) input[wc-control][type="number"]::-webkit-inner-spin-button {
3059
+ appearance: none;
3060
+ -webkit-appearance: none;
3061
+ margin: 0;
3062
+ }
3063
+
3064
+ /* File — the native control is two visually unrelated pieces (an
3065
+ * OS-themed "Choose File" button plus a plain filename readout).
3066
+ * Rather than styling the button as its own separate pill sitting
3067
+ * next to the field (which just reads as "a button and a box",
3068
+ * still two things), it's inset flush INTO the field -- no border,
3069
+ * no gap, no radius of its own -- so it reads as one control with
3070
+ * a segment inside it, the same way a search field's embedded icon
3071
+ * button does. overflow: hidden on the input
3072
+ * clips the (square-cornered) button to the input's own outer
3073
+ * radius instead of it poking a square corner out past the curve.
3074
+ */
3075
+ input[wc-control][type="file"] {
3076
+ display: flex;
3077
+ align-items: center;
3078
+ gap: 0.75rem;
3079
+ /* Block padding zeroed, not just inline-start -- the shared
3080
+ * recipe's own padding-block otherwise insets the flex content
3081
+ * area from the input's top/bottom edge, so align-self: stretch
3082
+ * below only ever reached that inset content box, not the
3083
+ * control's real edges. Invisible while the button matched the
3084
+ * input's own background; a solid gap once it didn't. */
3085
+ padding-block: 0;
3086
+ padding-inline-start: 0;
3087
+ overflow: hidden;
3088
+ cursor: pointer;
3089
+ }
3090
+
3091
+ input[wc-control][type="file"]::file-selector-button {
3092
+ align-self: stretch;
3093
+ block-size: 100%;
3094
+ /* margin-inline-end, not the container's `gap` -- the caption
3095
+ * text after the button is the browser's own internal content,
3096
+ * not a real flex item, so `gap` never reaches it. */
3097
+ margin: 0;
3098
+ margin-inline-end: 0.75rem;
3099
+ padding: 0 1rem;
3100
+ border: 0;
3101
+ border-radius: 0;
3102
+ /* Same colors as [lead] (the primary-action button recipe) --
3103
+ * a slight but deliberate offset from the input's own
3104
+ * background, rather than blending into it, so this segment
3105
+ * still reads as the one actionable part of the control. */
3106
+ background: var(--skirbi-button-lead-bg, var(--skirbi-primary-main));
3107
+ color: var(--skirbi-button-lead-color, var(--skirbi-primary-contrast));
3108
+ font: inherit;
3109
+ font-size: 0.75rem;
3110
+ font-weight: 700;
3111
+ letter-spacing: 0.05em;
3112
+ text-transform: uppercase;
3113
+ cursor: pointer;
3114
+ transition: background var(--skirbi-transition-duration, 180ms)
3115
+ var(--skirbi-transition-ease, ease);
3116
+ }
3117
+
3118
+ input[wc-control][type="file"]::file-selector-button:hover {
3119
+ background: var(--skirbi-button-lead-hover-bg,
3120
+ var(--skirbi-secondary-main));
3121
+ color: var(--skirbi-button-lead-hover-color,
3122
+ var(--skirbi-secondary-contrast));
3123
+ }
3124
+
3125
+ /* Select — swap the native chrome for a custom caret so it matches
3126
+ * the rest of the input recipe instead of the OS-drawn widget.
3127
+ */
3128
+ [skirbi-select] {
3129
+ position: relative;
3130
+ display: inline-block;
3131
+ }
3132
+
3133
+ [skirbi-select] select[wc-control] {
3134
+ appearance: none;
3135
+ -webkit-appearance: none;
3136
+ -moz-appearance: none;
3137
+ padding-inline-end: 2.25rem;
3138
+ }
3139
+
3140
+ [skirbi-select]::after {
3141
+ content: "";
3142
+ position: absolute;
3143
+ top: 50%;
3144
+ right: 0.9rem;
3145
+ inline-size: 0.45rem;
3146
+ block-size: 0.45rem;
3147
+ border-right: 2px solid var(--skirbi-secondary-dark);
3148
+ border-bottom: 2px solid var(--skirbi-secondary-dark);
3149
+ transform: translateY(-65%) rotate(45deg);
3150
+ pointer-events: none;
3151
+ }
3152
+
3153
+ [skirbi-select]:has(select[wc-control]:disabled)::after {
3154
+ opacity: 0.55;
3155
+ }
3156
+
2569
3157
  /* Checkbox / radio controls
2570
3158
  *
2571
3159
  * Keep label-position/layout rules above in charge. These styles only
@@ -2577,26 +3165,40 @@
2577
3165
  semtic-input[type="radio"],
2578
3166
  semtic-checkbox,
2579
3167
  semtic-radio
2580
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]) {
3168
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]) {
2581
3169
  appearance: none;
2582
3170
  -webkit-appearance: none;
2583
3171
 
2584
- inline-size: var(--skirbi-choice-size, 0.75rem);
2585
- block-size: var(--skirbi-choice-size, 0.75rem);
2586
- min-inline-size: var(--skirbi-choice-size, 0.75rem);
2587
- min-block-size: var(--skirbi-choice-size, 0.75rem);
3172
+ inline-size: var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7));
3173
+ block-size: var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7));
3174
+ min-inline-size: var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7));
3175
+ min-block-size: var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7));
2588
3176
 
2589
3177
  margin: 0;
2590
3178
  padding: 0;
3179
+ box-sizing: border-box;
2591
3180
 
2592
- border: 1px solid var(--skirbi-choice-border, var(--skirbi-surface-border-final));
2593
- background: var(--skirbi-choice-bg, var(--skirbi-surface-bg-final));
2594
- color: var(--skirbi-choice-accent, var(--skirbi-primary-main));
3181
+ border: 1px solid var(--skirbi-surface-border-final);
3182
+ background: var(--skirbi-choice-background, var(--skirbi-secondary-light));
3183
+
3184
+ /* The contrast colour for the background above, exactly as the text
3185
+ * controls pair secondary-light with secondary-dark. A choice control
3186
+ * is a filled box that has to read against its own fill, so it takes
3187
+ * the same pairing rather than an accent that only happens to be
3188
+ * legible on the default surface.
3189
+ *
3190
+ * This is also the single seam for retinting one: tick, dot, checked
3191
+ * border, checked background tint and hover border are all currentColor
3192
+ * further down, so this one declaration carries the whole control and
3193
+ * an app changing it does not have to restate the recipe. */
3194
+ color: var(--skirbi-choice-color, var(--skirbi-secondary-dark));
2595
3195
 
2596
3196
  display: inline-grid;
2597
3197
  place-content: center;
2598
3198
  flex: 0 0 auto;
2599
3199
  cursor: pointer;
3200
+ user-select: none;
3201
+ caret-color: transparent;
2600
3202
 
2601
3203
  transition:
2602
3204
  border-color var(--skirbi-transition-duration, 180ms)
@@ -2607,25 +3209,48 @@
2607
3209
  var(--skirbi-transition-ease, ease);
2608
3210
  }
2609
3211
 
3212
+ :is(
3213
+ semtic-input[type="checkbox"],
3214
+ semtic-input[type="radio"],
3215
+ semtic-checkbox,
3216
+ semtic-radio
3217
+ ) [semtic-label] {
3218
+ cursor: pointer;
3219
+ user-select: none;
3220
+ }
3221
+
2610
3222
  /* Checkbox shape */
2611
3223
  :is(
2612
3224
  semtic-input[type="checkbox"],
2613
3225
  semtic-checkbox
2614
- ) > input[wc-control][type="checkbox"] {
2615
- border-radius: 0.2rem;
3226
+ ) input[wc-control][type="checkbox"] {
3227
+ border-radius: var(
3228
+ --skirbi-choice-radius,
3229
+ calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.267)
3230
+ );
2616
3231
  }
2617
3232
 
2618
- /* Checkbox tick */
3233
+ /* Checkbox tick — sized proportionally to --skirbi-choice-size so
3234
+ * overriding the box size (e.g. to a larger tap target) keeps the
3235
+ * tick centered and legible instead of shrinking into a corner.
3236
+ *
3237
+ * To change how much of the box the mark fills without touching the box,
3238
+ * set --skirbi-choice-mark-scale (1 = the proportions above). It rides
3239
+ * the reveal transform rather than the dimensions, so the stroke thins
3240
+ * with the mark instead of staying heavy on a smaller tick, and it stays
3241
+ * centered on transform-origin for free.
3242
+ */
2619
3243
  :is(
2620
3244
  semtic-input[type="checkbox"],
2621
3245
  semtic-checkbox
2622
- ) > input[wc-control][type="checkbox"]::before {
3246
+ ) input[wc-control][type="checkbox"]::before {
2623
3247
  content: "";
2624
- inline-size: 0.28rem;
2625
- block-size: 0.52rem;
3248
+ inline-size: calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.373);
3249
+ block-size: calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.693);
2626
3250
 
2627
3251
  border: solid currentColor;
2628
- border-width: 0 0.11rem 0.11rem 0;
3252
+ border-width: 0 calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.147)
3253
+ calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.147) 0;
2629
3254
 
2630
3255
  transform: rotate(45deg) scale(0);
2631
3256
  transform-origin: center;
@@ -2637,18 +3262,18 @@
2637
3262
  :is(
2638
3263
  semtic-input[type="radio"],
2639
3264
  semtic-radio
2640
- ) > input[wc-control][type="radio"] {
3265
+ ) input[wc-control][type="radio"] {
2641
3266
  border-radius: 50%;
2642
3267
  }
2643
3268
 
2644
- /* Radio dot */
3269
+ /* Radio dot — proportional for the same reason as the checkbox tick. */
2645
3270
  :is(
2646
3271
  semtic-input[type="radio"],
2647
3272
  semtic-radio
2648
- ) > input[wc-control][type="radio"]::before {
3273
+ ) input[wc-control][type="radio"]::before {
2649
3274
  content: "";
2650
- inline-size: 0.42rem;
2651
- block-size: 0.42rem;
3275
+ inline-size: calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.56);
3276
+ block-size: calc(var(--skirbi-choice-size, calc((1.325rem + 1em) * 6 / 7)) * 0.56);
2652
3277
  border-radius: 50%;
2653
3278
  background: currentColor;
2654
3279
 
@@ -2663,27 +3288,27 @@
2663
3288
  semtic-input[type="radio"],
2664
3289
  semtic-checkbox,
2665
3290
  semtic-radio
2666
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]):checked {
3291
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]):checked {
2667
3292
  border-color: currentColor;
2668
3293
  background: color-mix(
2669
3294
  in srgb,
2670
3295
  currentColor 7%,
2671
- var(--skirbi-surface-bg-final)
3296
+ var(--skirbi-secondary-light)
2672
3297
  );
2673
3298
  }
2674
3299
 
2675
3300
  :is(
2676
3301
  semtic-input[type="checkbox"],
2677
3302
  semtic-checkbox
2678
- ) > input[wc-control][type="checkbox"]:checked::before {
2679
- transform: rotate(45deg) scale(1);
3303
+ ) input[wc-control][type="checkbox"]:checked::before {
3304
+ transform: rotate(45deg) scale(var(--skirbi-choice-mark-scale, 1));
2680
3305
  }
2681
3306
 
2682
3307
  :is(
2683
3308
  semtic-input[type="radio"],
2684
3309
  semtic-radio
2685
- ) > input[wc-control][type="radio"]:checked::before {
2686
- transform: scale(1);
3310
+ ) input[wc-control][type="radio"]:checked::before {
3311
+ transform: scale(var(--skirbi-choice-mark-scale, 1));
2687
3312
  }
2688
3313
 
2689
3314
  /* Hover/focus */
@@ -2692,7 +3317,7 @@
2692
3317
  semtic-input[type="radio"],
2693
3318
  semtic-checkbox,
2694
3319
  semtic-radio
2695
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]):hover {
3320
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]):hover {
2696
3321
  border-color: currentColor;
2697
3322
  }
2698
3323
 
@@ -2701,7 +3326,7 @@
2701
3326
  semtic-input[type="radio"],
2702
3327
  semtic-checkbox,
2703
3328
  semtic-radio
2704
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]):focus-visible {
3329
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]):focus-visible {
2705
3330
  outline: none;
2706
3331
  box-shadow: 0 0 0 2px color-mix(
2707
3332
  in srgb,
@@ -2716,7 +3341,7 @@
2716
3341
  semtic-input[type="radio"],
2717
3342
  semtic-checkbox,
2718
3343
  semtic-radio
2719
- ) > input[wc-control]:is([type="checkbox"], [type="radio"]):disabled {
3344
+ ) input[wc-control]:is([type="checkbox"], [type="radio"]):disabled {
2720
3345
  opacity: 0.55;
2721
3346
  cursor: not-allowed;
2722
3347
  }
@@ -2750,126 +3375,78 @@
2750
3375
 
2751
3376
  /* Form controls (label-error-position) */
2752
3377
  [skirbi-theme] {
2753
- semtic-input[label-error-position="inline"][label-position="top"],
2754
- semtic-select[label-error-position="inline"][label-position="top"],
2755
- semtic-textarea[label-error-position="inline"][label-position="top"] {
2756
- display: grid;
2757
- grid-template-areas:
2758
- "label error"
2759
- "input input";
2760
- grid-template-columns: auto 1fr;
2761
- align-items: baseline;
2762
- }
2763
-
2764
- semtic-input[label-error-position="inline"] [semtic-label],
2765
- semtic-select[label-error-position="inline"] [semtic-label],
2766
- semtic-textarea[label-error-position="inline"] [semtic-label] {
2767
- grid-area: label;
2768
- }
2769
-
2770
- semtic-input[label-error-position="inline"] input[wc-control],
2771
- semtic-select[label-error-position="inline"] select[wc-control],
2772
- semtic-textarea[label-error-position="inline"] textarea[wc-control] {
2773
- grid-area: input;
2774
- }
2775
-
2776
- semtic-input[label-error-position="inline"] [semtic-error],
2777
- semtic-select[label-error-position="inline"] [semtic-error],
2778
- semtic-textarea[label-error-position="inline"] [semtic-error] {
2779
- grid-area: error;
2780
- text-align: right;
2781
- align-self: baseline;
2782
- }
2783
-
2784
- semtic-input[label-error-position="bottom"] [semtic-error],
2785
- semtic-select[label-error-position="bottom"] [semtic-error],
2786
- semtic-textarea[label-error-position="bottom"] [semtic-error] {
2787
- order: 99;
2788
- width: 100%;
2789
- }
2790
-
3378
+ /* label-error-position: the definition against the error, on the host.
3379
+ *
3380
+ * Independent of label-position, which arranges the inside of the
3381
+ * definition. That separation is the point of the two levels: these two
3382
+ * attributes used to have to be resolved together, so every combination
3383
+ * needed its own rule.
3384
+ *
3385
+ * "bottom" is the base template, so it needs nothing here.
3386
+ */
2791
3387
  semtic-input[label-error-position="top"],
2792
3388
  semtic-select[label-error-position="top"],
2793
- semtic-textarea[label-error-position="top"] {
2794
- display: grid;
2795
- grid-template-areas:
2796
- "error"
2797
- "label"
2798
- "input";
2799
- }
2800
-
2801
- semtic-input[label-error-position="top"] [semtic-label],
2802
- semtic-select[label-error-position="top"] [semtic-label],
2803
- semtic-textarea[label-error-position="top"] [semtic-label] {
2804
- grid-area: label;
2805
- }
2806
-
2807
- semtic-input[label-error-position="top"] input[wc-control],
2808
- semtic-select[label-error-position="top"] select[wc-control],
2809
- semtic-textarea[label-error-position="top"] textarea[wc-control] {
2810
- grid-area: input;
2811
- }
2812
-
2813
- semtic-input[label-error-position="top"] [semtic-error],
2814
- semtic-select[label-error-position="top"] [semtic-error],
2815
- semtic-textarea[label-error-position="top"] [semtic-error] {
2816
- grid-area: error;
3389
+ semtic-textarea[label-error-position="top"],
3390
+ semtic-checkbox[label-error-position="top"],
3391
+ semtic-radio[label-error-position="top"] {
3392
+ grid-template-areas: "error" "definition";
3393
+ grid-template-columns: minmax(0, 1fr);
2817
3394
  }
2818
3395
 
2819
3396
  semtic-input[label-error-position="left"],
2820
3397
  semtic-select[label-error-position="left"],
2821
- semtic-textarea[label-error-position="left"] {
2822
- display: grid;
2823
- grid-template-areas:
2824
- "label input"
2825
- "error input";
2826
- grid-template-columns: auto 1fr;
2827
- }
2828
-
2829
- semtic-input[label-error-position="left"] [semtic-label],
2830
- semtic-select[label-error-position="left"] [semtic-label],
2831
- semtic-textarea[label-error-position="left"] [semtic-label] {
2832
- grid-area: label;
2833
- }
2834
-
2835
- semtic-input[label-error-position="left"] input[wc-control],
2836
- semtic-select[label-error-position="left"] select[wc-control],
2837
- semtic-textarea[label-error-position="left"] textarea[wc-control] {
2838
- grid-area: input;
2839
- }
2840
-
2841
- semtic-input[label-error-position="left"] [semtic-error],
2842
- semtic-select[label-error-position="left"] [semtic-error],
2843
- semtic-textarea[label-error-position="left"] [semtic-error] {
2844
- grid-area: error;
3398
+ semtic-textarea[label-error-position="left"],
3399
+ semtic-checkbox[label-error-position="left"],
3400
+ semtic-radio[label-error-position="left"] {
3401
+ grid-template-areas: "error definition";
3402
+ grid-template-columns: auto minmax(0, 1fr);
2845
3403
  }
2846
3404
 
2847
3405
  semtic-input[label-error-position="right"],
2848
3406
  semtic-select[label-error-position="right"],
2849
- semtic-textarea[label-error-position="right"] {
2850
- display: grid;
2851
- grid-template-areas:
2852
- "label input"
2853
- "input error";
2854
- grid-template-columns: 1fr auto;
3407
+ semtic-textarea[label-error-position="right"],
3408
+ semtic-checkbox[label-error-position="right"],
3409
+ semtic-radio[label-error-position="right"] {
3410
+ grid-template-areas: "definition error";
3411
+ grid-template-columns: minmax(0, 1fr) auto;
2855
3412
  }
2856
3413
 
2857
- semtic-input[label-error-position="right"] [semtic-label],
2858
- semtic-select[label-error-position="right"] [semtic-label],
2859
- semtic-textarea[label-error-position="right"] [semtic-label] {
2860
- grid-area: label;
2861
- }
3414
+ /* inline: the error shares the label's row, right-aligned, so it reads
3415
+ * as an annotation on the label rather than a line of its own.
3416
+ *
3417
+ * This is the one value where the two levels cannot stay independent.
3418
+ * The label lives inside the definition and the error is a sibling of
3419
+ * it, so putting them on the same row means putting them in the same
3420
+ * grid -- hence display: contents on the definition, which hands its
3421
+ * three children up to the host. Only the vertical label positions can
3422
+ * do this: with the label beside the control there is no label row for
3423
+ * the error to share, so those fall through to the base template and
3424
+ * the error takes its own row underneath.
3425
+ */
3426
+ :is(
3427
+ semtic-input, semtic-select, semtic-textarea,
3428
+ semtic-checkbox, semtic-radio
3429
+ )[label-error-position="inline"]:is(
3430
+ :not([label-position]), [label-position="top"], [label-position="bottom"]
3431
+ ) {
3432
+ grid-template-areas: "label error" "control control";
3433
+ grid-template-columns: auto minmax(0, 1fr);
3434
+ align-items: baseline;
3435
+
3436
+ & > [semtic-input-definition] {
3437
+ display: contents;
3438
+ }
2862
3439
 
2863
- semtic-input[label-error-position="right"] input[wc-control],
2864
- semtic-select[label-error-position="right"] select[wc-control],
2865
- semtic-textarea[label-error-position="right"] textarea[wc-control] {
2866
- grid-area: input;
3440
+ & > [semtic-error] {
3441
+ text-align: right;
3442
+ }
2867
3443
  }
2868
3444
 
2869
- semtic-input[label-error-position="right"] [semtic-error],
2870
- semtic-select[label-error-position="right"] [semtic-error],
2871
- semtic-textarea[label-error-position="right"] [semtic-error] {
2872
- grid-area: error;
3445
+ :is(
3446
+ semtic-input, semtic-select, semtic-textarea,
3447
+ semtic-checkbox, semtic-radio
3448
+ )[label-error-position="inline"][label-position="bottom"] {
3449
+ grid-template-areas: "control control" "label error";
2873
3450
  }
2874
3451
  }
2875
3452
 
@@ -3424,26 +4001,6 @@
3424
4001
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--skirbi-primary-main) 25%, transparent);
3425
4002
  }
3426
4003
 
3427
- semtic-input[label-position="top"] {
3428
- display: grid;
3429
- grid-template-areas:
3430
- "label error"
3431
- "input input";
3432
- grid-template-columns: auto 1fr;
3433
- }
3434
-
3435
- semtic-input[label-position="top"] [semtic-label] {
3436
- grid-area: label;
3437
- }
3438
-
3439
- semtic-input[label-position="top"] input[wc-control] {
3440
- grid-area: input;
3441
- }
3442
-
3443
- semtic-input[label-position="top"] [semtic-error] {
3444
- grid-area: error;
3445
- text-align: right;
3446
- }
3447
4004
 
3448
4005
  }
3449
4006
 
@@ -3575,6 +4132,56 @@
3575
4132
  }
3576
4133
  }
3577
4134
 
4135
+ /**
4136
+ * @styles pinta.semtic-tabbed Semtic tabbed
4137
+ * @description
4138
+ *
4139
+ * Default recipe for `<semtic-tabbed>`. Styles the generated tab strip
4140
+ * (a `<nav role="tablist">` of `<button role="tab">`s) and the active-tab
4141
+ * indicator. `<semtic-tab>` panel visibility itself is the native
4142
+ * `hidden` attribute, not styled here -- it works with no CSS at all.
4143
+ */
4144
+
4145
+ [skirbi-theme] {
4146
+ semtic-tabbed {
4147
+ display: block;
4148
+
4149
+ /* Same chrome as a form control's own box (form-controls' shared
4150
+ * input[wc-control]/select[wc-control]/textarea[wc-control] recipe)
4151
+ * so the tab strip reads as part of the same control language,
4152
+ * rather than an underline treatment invented just for this one
4153
+ * component. */
4154
+ nav[role='tablist'] {
4155
+ display: inline-flex;
4156
+ gap: 0.25rem;
4157
+ padding: 0.25rem;
4158
+ margin-block-end: 1rem;
4159
+ border: 1px solid var(--skirbi-surface-border-final);
4160
+ border-radius: 0.5rem;
4161
+ background: var(--skirbi-secondary-light);
4162
+ }
4163
+
4164
+ nav[role='tablist'] button {
4165
+ padding: 0.5rem 1rem;
4166
+ border: 1px solid transparent;
4167
+ border-radius: 0.375rem;
4168
+ background: none;
4169
+ color: var(--skirbi-secondary-dark);
4170
+ font: inherit;
4171
+ font-weight: 600;
4172
+ cursor: pointer;
4173
+ transition:
4174
+ background var(--skirbi-transition-duration, 180ms) var(--skirbi-transition-ease, ease),
4175
+ color var(--skirbi-transition-duration, 180ms) var(--skirbi-transition-ease, ease);
4176
+
4177
+ &[current] {
4178
+ background: var(--skirbi-button-lead-bg, var(--skirbi-primary-main));
4179
+ color: var(--skirbi-button-lead-color, var(--skirbi-primary-contrast));
4180
+ }
4181
+ }
4182
+ }
4183
+ }
4184
+
3578
4185
  /**
3579
4186
  * @styles pinta.semtic-article-card Semtic article card
3580
4187
  * @description
@@ -3731,6 +4338,52 @@
3731
4338
  }
3732
4339
  }
3733
4340
 
4341
+ /**
4342
+ * @styles pinta.semtic-grid-diptych Diptych grid
4343
+ * @description
4344
+ *
4345
+ * Two-region grid primitive: a flexible content column and a fixed-width
4346
+ * aside (e.g. a sidenav). Content is expected first in DOM/reading order
4347
+ * so screen readers and keyboard navigation reach it before the aside;
4348
+ * the aside is repositioned to the visual left via `grid-area`, not by
4349
+ * reordering the DOM. On narrow screens the regions stack as content,
4350
+ * then aside.
4351
+ *
4352
+ * | Token | Purpose |
4353
+ * | --- | --- |
4354
+ * | `--skirbi-diptych-aside` | Width of the aside column. |
4355
+ * | `--skirbi-diptych-gap` | Gap between regions. |
4356
+ */
4357
+
4358
+ [skirbi-theme] {
4359
+ semtic-grid[diptych] {
4360
+ display: grid;
4361
+ grid-template-areas: "aside content";
4362
+ grid-template-columns:
4363
+ minmax(10rem, var(--skirbi-diptych-aside))
4364
+ minmax(0, 1fr);
4365
+ gap: var(--skirbi-diptych-gap);
4366
+ align-items: start;
4367
+
4368
+ > :first-child {
4369
+ grid-area: content;
4370
+ min-inline-size: 0;
4371
+ }
4372
+
4373
+ > :nth-child(2) {
4374
+ grid-area: aside;
4375
+ min-inline-size: 0;
4376
+ }
4377
+
4378
+ @media (max-width: 48rem) {
4379
+ grid-template-areas:
4380
+ "content"
4381
+ "aside";
4382
+ grid-template-columns: minmax(0, 1fr);
4383
+ }
4384
+ }
4385
+ }
4386
+
3734
4387
  /**
3735
4388
  * @styles pinta.semtic-grid-triptych Triptych grid
3736
4389
  * @description
@@ -3788,7 +4441,7 @@
3788
4441
  min-inline-size: 0;
3789
4442
  }
3790
4443
 
3791
- @media (max-width: 768px) {
4444
+ @media (max-width: 48rem) {
3792
4445
  position: static;
3793
4446
  grid-template-areas:
3794
4447
  "content"
@@ -3802,6 +4455,41 @@
3802
4455
  }
3803
4456
  }
3804
4457
 
4458
+ /* A <semtic-sidenav> used as a diptych/triptych aside is laid out by
4459
+ * that grid, not by its own off-canvas drawer recipe -- that recipe
4460
+ * hides it behind position: fixed + a translated-off-screen <nav>
4461
+ * below 64rem with nothing here to ever add [semtic-sidenav-open], so
4462
+ * without this override it simply vanishes well before either grid's
4463
+ * own stacking breakpoint even engages. Scoped to these two grids'
4464
+ * aside slots specifically, not semtic-sidenav generally -- a
4465
+ * standalone sidenav (its usual off-canvas-on-mobile use) keeps its
4466
+ * own recipe.
4467
+ *
4468
+ * `> nav` also drops its own fixed --skirbi-sidenav-width (16rem) for
4469
+ * 100%, filling the grid track instead: that width is narrower than
4470
+ * 16rem here (12rem's worth of grid track, see
4471
+ * override-pinta.css's --skirbi-diptych-aside), and nothing clips the
4472
+ * difference below 64rem, so the nav visibly spilled into the content
4473
+ * column by the difference. Above 64rem the desktop sticky recipe's
4474
+ * own `overflow-y: auto` happened to mask it too, by the "overflow-x
4475
+ * becomes auto when overflow-y isn't visible" rule -- accidental, not
4476
+ * a fix, and gone the moment overflow-y changes for any other reason. */
4477
+ [skirbi-theme] {
4478
+ semtic-grid[diptych] > :nth-child(2):is(semtic-sidenav),
4479
+ semtic-grid[triptych] > :nth-child(2):is(semtic-sidenav),
4480
+ semtic-grid[triptych] > :nth-child(3):is(semtic-sidenav) {
4481
+ position: static;
4482
+ height: auto;
4483
+ pointer-events: auto;
4484
+
4485
+ > nav {
4486
+ position: static;
4487
+ transform: none;
4488
+ width: 100%;
4489
+ }
4490
+ }
4491
+ }
4492
+
3805
4493
  /**
3806
4494
  * @styles pinta.heading-quote Heading quote
3807
4495
  * @description
@@ -3857,13 +4545,13 @@
3857
4545
  padding: clamp(1rem, 2vw, 1.75rem);
3858
4546
  }
3859
4547
 
3860
- @media (max-width: 60rem) {
4548
+ @media (max-width: 64rem) {
3861
4549
  semtic-grid[layout] {
3862
4550
  grid-template-columns: repeat(2, minmax(0, 1fr));
3863
4551
  }
3864
4552
  }
3865
4553
 
3866
- @media (max-width: 36rem) {
4554
+ @media (max-width: 48rem) {
3867
4555
  semtic-grid[layout] {
3868
4556
  grid-template-columns: 1fr;
3869
4557
  }
@@ -3886,4 +4574,27 @@
3886
4574
  display: none;
3887
4575
  }
3888
4576
 
4577
+ [skirbi-theme] {
4578
+ semtic-form-row {
4579
+ display: grid;
4580
+ gap: var(--skirbi-grid-gap, 1rem);
4581
+ grid-template-columns: repeat(
4582
+ var(--skirbi-form-row-columns, 2),
4583
+ minmax(0, 1fr)
4584
+ );
4585
+
4586
+ /* Trailing space so consecutive rows do not run together. */
4587
+ padding-block-end: var(--skirbi-form-row-spacing, 1rem);
4588
+ }
4589
+
4590
+ /* A nested row is a cell of the row around it, so the outer row's gap
4591
+ * already separates it from whatever follows. Its own trailing space
4592
+ * lands inside that gap and reads as a double one -- and against the
4593
+ * bottom of the outer row it is trailing space with nothing after it
4594
+ * to separate from. */
4595
+ semtic-form-row semtic-form-row {
4596
+ padding-block-end: 0;
4597
+ }
4598
+ }
4599
+
3889
4600
  }