@jsenv/navi 0.29.431 → 0.29.432

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.
@@ -143,7 +143,9 @@ start when unsure which export solves a problem.
143
143
  own actions). Before passing `open`, calling `triggerNaviCommand`, or
144
144
  writing a close button.
145
145
  - `popup_backdrop.md` — three independent questions: a wall or not, what an
146
- outside press does, how far the page withdraws. Before CSS for a backdrop.
146
+ outside press does, how far the page withdraws; and the browser's
147
+ `theme-color` that a popup paints over. Before CSS for a backdrop, or a
148
+ `theme-color` meta.
147
149
  - `popup_lift.md` — `animation="lifting"`: the pressed card brought to the front.
148
150
  Before giving a `Dialog` or a `Picker` `animation="lifting"`.
149
151
  - `dialog_shape.md` — bounds rather than a width, the container ceiling, the
@@ -254,6 +254,59 @@ eye is on — a picture opened full, a plan, a card painting its own surface.
254
254
  `"invisible"` is the one kind with no filter token: it paints nothing, and a
255
255
  filter would still be seen.
256
256
 
257
+ ## Above the screen: the browser's colour
258
+
259
+ On a phone the browser paints a band above the page — Chrome's address bar, the
260
+ status bar of an installed app — in the colour of `<meta name="theme-color">`.
261
+ It touches the page's top edge, so it reads as part of whatever is drawn there.
262
+ A backdrop that stops at the top of the viewport, under a band still at full
263
+ brightness, reads as two layers that do not belong together. So navi works that
264
+ colour out from what is on screen:
265
+
266
+ - **The page says it with `<Head>`**, the way it says its title:
267
+
268
+ ```jsx
269
+ <Head>
270
+ <meta name="theme-color" content="#2563a8" />
271
+ </Head>
272
+ ```
273
+
274
+ The last `<Head>` to arrive wins, whatever order they leave in (a route
275
+ transition puts the arriving page up before it takes the leaving one down). A
276
+ `theme-color` meta written in the HTML shows when no `<Head>` gives one.
277
+
278
+ - **Each open popup in the top layer paints over it**, in the order they
279
+ opened: its backdrop colour over the colour under it, then its own background
280
+ over that when it is flush with the top edge — `marginWithContainer={0}` with
281
+ `expand`/`expandY` or a top `positionArea`, which is what a full-screen
282
+ dialog or a `SidePanel side="top"` is. A wash of `rgba(12, 23, 44, 0.45)` over
283
+ a `#2563a8` bar gives `#1a4170`. A navy full-screen dialog gives its navy.
284
+
285
+ The colour changes when the opening starts, and changes back when the closing
286
+ starts. If the page under an open popup changes its colour, the popup paints
287
+ over the new one. Each `media` a page gives (one colour per
288
+ `prefers-color-scheme`) is painted over on its own.
289
+
290
+ Nothing is written at the call site. The `themeColor` prop is for what navi
291
+ cannot read:
292
+
293
+ - the `backdropFilter` is left out: a flat colour has nothing to blur;
294
+ - a surface painted with an image or a gradient has no colour to read, and
295
+ `themeColor="#0c172c"` gives it one;
296
+ - `themeColor={false}` leaves the colour under the popup as it is.
297
+
298
+ A popup that lays nothing over the edge changes nothing: `backdropVariant="invisible"`,
299
+ `backdrop={false}`, a `Popover` without a backdrop, any `layer="local"` popup.
300
+ A `Popover` paints its backdrop only, never its surface: it has no notion of
301
+ being flush with an edge.
302
+
303
+ **A `<Head>` inside a popup does not give the popup's colour.** It counts as a
304
+ page's `<Head>`, under every popup, including the one holding it. It also stays
305
+ after the closing. A popup's content stays mounted once built (`mount`, see
306
+ [`popup_open.md`](./popup_open.md)), and its `<Head>` stays with it, so its colour
307
+ remains after the popup has gone. `themeColor` lasts exactly as long as the
308
+ popup is open.
309
+
257
310
  ## Why props, and not a rule in the app's stylesheet
258
311
 
259
312
  **The backdrop is not inside the popup**, and which element it is depends on the
@@ -454,8 +454,9 @@ What that means for a page and for the application around it:
454
454
  - **It is taken down after the page arriving is up.** A cleanup that puts back
455
455
  what it found — a document title, a class on `<body>`, a value in a shared store
456
456
  — puts a stale value back over the new page's. Such a registration is written as
457
- "the last to arrive wins": navi's `<Head>` keeps its titles as a stack, and a
458
- slot shows the last `SlotFill` to arrive.
457
+ "the last to arrive wins": navi's `<Head>` keeps its titles and its
458
+ `theme-color` metas as a stack, and a slot shows the last `SlotFill` to
459
+ arrive.
459
460
  - **What it fills outside its own nodes leaves at once.** A `SlotFill` in a page
460
461
  kept while leaving steps out of its slot, so a bar each page fills shows the
461
462
  page arriving — or nothing, when that page fills none.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.431",
3
+ "version": "0.29.432",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {