@tearleads/windowing 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -298,6 +298,17 @@ and `--emphasis-text`), and `--color-hairline`. A dark theme that sets only the
298
298
  `--color-*` primitives gets near-white edges and chips, so set these too, as
299
299
  Tearleads' dark theme does.
300
300
 
301
+ The window, menus, and routed shell draw thin scrollbars in `--scrollbar-thumb`
302
+ over `--scrollbar-track`. `tokens.css` leaves both unset, so the thumb falls
303
+ back to `--color-dark` at 32%, mixed on each surface so it follows the theme
304
+ there, including a scoped one, and the track to transparent. They use the
305
+ standard `scrollbar-width` and
306
+ `scrollbar-color` properties, which Firefox, Chromium 121, and Safari 26.2
307
+ read; older Safari keeps its own scrollbars. Content in a window or the shell
308
+ scrolls the same way: `scrollbar-color` inherits from the surface, and
309
+ `scrollbar-width` is set on every element in it. Both rules have zero
310
+ specificity, so any host rule wins.
311
+
301
312
  The window paints its background, behind its body and sidebar, with
302
313
  `--window-background`. `tokens.css` leaves it unset, so it falls back to
303
314
  `--color-light` wherever that is set, including a scoped theme. Content sets
package/menu/Menu.css CHANGED
@@ -27,6 +27,21 @@
27
27
  box-sizing: border-box;
28
28
  }
29
29
 
30
+ /* A menu portals to <body>, outside any window, so it sets the window's thin,
31
+ themed scrollbars itself (see Window.css). */
32
+ :where(.menu) {
33
+ scrollbar-color: var(
34
+ --scrollbar-thumb,
35
+ color-mix(in srgb, var(--color-dark) 32%, transparent)
36
+ )
37
+ var(--scrollbar-track, transparent);
38
+ }
39
+
40
+ :where(.menu),
41
+ :where(.menu) :where(*) {
42
+ scrollbar-width: thin;
43
+ }
44
+
30
45
  .menu[data-scrollable] {
31
46
  touch-action: pan-y;
32
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tearleads/windowing",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "App-agnostic window management for React: window state, window chrome, and the menu and sidebar primitives it renders with.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -29,6 +29,21 @@
29
29
  box-sizing: border-box;
30
30
  }
31
31
 
32
+ /* The window's thin, themed scrollbars (see Window.css), for the shell's
33
+ panes and the app content they hold. */
34
+ :where(.routed-pane) {
35
+ scrollbar-color: var(
36
+ --scrollbar-thumb,
37
+ color-mix(in srgb, var(--color-dark) 32%, transparent)
38
+ )
39
+ var(--scrollbar-track, transparent);
40
+ }
41
+
42
+ :where(.routed-pane),
43
+ :where(.routed-pane) :where(*) {
44
+ scrollbar-width: thin;
45
+ }
46
+
32
47
  .routed-pane {
33
48
  position: relative;
34
49
  min-height: 0;
package/window/Window.css CHANGED
@@ -8,6 +8,30 @@
8
8
  box-sizing: border-box;
9
9
  }
10
10
 
11
+ /*
12
+ * Thin scrollbars for every scroll container in the window, its content's
13
+ * included. scrollbar-color inherits, so the window sets it once;
14
+ * scrollbar-width does not, so the window sets it on everything, like
15
+ * box-sizing. The colors are --scrollbar-thumb over --scrollbar-track, which
16
+ * tokens.css leaves unset: the thumb falls back to the window's foreground at
17
+ * 32%, mixed here so a scoped theme recolors it, over no track. Both are the
18
+ * standard properties Firefox, Chromium, and Safari 26.2 read; no
19
+ * ::-webkit-scrollbar rules, which would turn overlay scrollbars into classic
20
+ * ones that always take room. At zero specificity, any host rule wins.
21
+ */
22
+ :where(.window) {
23
+ scrollbar-color: var(
24
+ --scrollbar-thumb,
25
+ color-mix(in srgb, var(--color-dark) 32%, transparent)
26
+ )
27
+ var(--scrollbar-track, transparent);
28
+ }
29
+
30
+ :where(.window),
31
+ :where(.window) :where(*) {
32
+ scrollbar-width: thin;
33
+ }
34
+
11
35
  .window {
12
36
  position: absolute;
13
37
  display: flex;