prop-for-that 0.7.4 → 0.7.5
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/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/head.cjs +1 -1
- package/dist/head.global.js +1 -1
- package/dist/head.js +1 -1
- package/llms.txt +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ backwards-compatible change (semver's `1.0.0`+ rules kick in at v1).
|
|
|
8
8
|
Only the published library (`dist/`) is versioned here; the demo and docs site
|
|
9
9
|
are repo-only and not part of the npm package.
|
|
10
10
|
|
|
11
|
+
## [0.7.5]
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **`head`: `--const-scrollbar-overlay`** — the user's scrollbar preference,
|
|
15
|
+
derived from the scrollbar-width probe already taken in `<head>`: `1` when
|
|
16
|
+
scrollbars overlay content (reserve no layout space, appear on interaction),
|
|
17
|
+
`0` when they're classic/inline (always shown, take up width). Lets CSS reserve
|
|
18
|
+
a gutter only when it's actually needed —
|
|
19
|
+
`padding-inline-end: calc((1 - var(--const-scrollbar-overlay)) * 12px)`. (#8)
|
|
20
|
+
|
|
11
21
|
## [0.7.4]
|
|
12
22
|
|
|
13
23
|
### Added
|
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ Bind any element with `data-props-for="key …"` and read its `--live-*` propert
|
|
|
62
62
|
| --- | --- |
|
|
63
63
|
| `prop-for-that/auto` | Zero-config & declarative: binds every `data-props-for` element — globals included, via `<html data-props-for="…">` — loading plugin sources on demand, kept in sync with the DOM. Use as `<script type="module">`. |
|
|
64
64
|
| `prop-for-that` | Imperative API — `propsFor()`, `register()`, `configure()` — for explicit control and teardown. |
|
|
65
|
-
| `prop-for-that/head` | Synchronous, FOUC-safe constants (scrollbar width, DPR, core count, device memory) before first paint. |
|
|
65
|
+
| `prop-for-that/head` | Synchronous, FOUC-safe constants (scrollbar width & overlay preference, DPR, core count, device memory) before first paint. |
|
|
66
66
|
| `prop-for-that/plugins` | The opt-in plugin catalog. |
|
|
67
67
|
|
|
68
68
|
> `auto` sees the **light DOM only** (not shadow roots — bind those with `propsFor(el, …)`), and lazy-loads plugin chunks, so from a CDN use one that serves the `dist` files verbatim (unpkg / jsDelivr), not a rewriting CDN.
|
package/dist/head.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunk7L35N3N3_cjs=require('./chunk-7L35N3N3.cjs');function
|
|
1
|
+
'use strict';var chunk7L35N3N3_cjs=require('./chunk-7L35N3N3.cjs');function c(){let i=chunk7L35N3N3_cjs.a.root,o=(n,s)=>i.style.setProperty(chunk7L35N3N3_cjs.a.constPrefix+n,String(s)),t=document.createElement("div");t.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden",(document.body??i).appendChild(t);let r=t.offsetWidth-t.clientWidth;o("scrollbar-w",r),o("scrollbar-overlay",r===0?1:0),t.style.scrollbarWidth="thin",o("scrollbar-thin-w",t.offsetWidth-t.clientWidth),t.remove(),o("dpr",window.devicePixelRatio||1),o("cores",navigator.hardwareConcurrency||0),o("mem",navigator.deviceMemory||0);}typeof document<"u"&&c();
|
package/dist/head.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){'use strict';var o={constPrefix:"--const-",root:typeof document<"u"?document.documentElement:void 0};function
|
|
1
|
+
(function(){'use strict';var o={constPrefix:"--const-",root:typeof document<"u"?document.documentElement:void 0};function c(){let i=o.root,t=(r,s)=>i.style.setProperty(o.constPrefix+r,String(s)),e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden",(document.body??i).appendChild(e);let n=e.offsetWidth-e.clientWidth;t("scrollbar-w",n),t("scrollbar-overlay",n===0?1:0),e.style.scrollbarWidth="thin",t("scrollbar-thin-w",e.offsetWidth-e.clientWidth),e.remove(),t("dpr",window.devicePixelRatio||1),t("cores",navigator.hardwareConcurrency||0),t("mem",navigator.deviceMemory||0);}typeof document<"u"&&c();})();
|
package/dist/head.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-LWKH66VY.js';function
|
|
1
|
+
import {a}from'./chunk-LWKH66VY.js';function c(){let i=a.root,o=(n,s)=>i.style.setProperty(a.constPrefix+n,String(s)),t=document.createElement("div");t.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;visibility:hidden",(document.body??i).appendChild(t);let r=t.offsetWidth-t.clientWidth;o("scrollbar-w",r),o("scrollbar-overlay",r===0?1:0),t.style.scrollbarWidth="thin",o("scrollbar-thin-w",t.offsetWidth-t.clientWidth),t.remove(),o("dpr",window.devicePixelRatio||1),o("cores",navigator.hardwareConcurrency||0),o("mem",navigator.deviceMemory||0);}typeof document<"u"&&c();
|
package/llms.txt
CHANGED
|
@@ -102,6 +102,7 @@ prefix; constants use `--const-`. Values are unitless numbers unless noted.
|
|
|
102
102
|
| --- | --- |
|
|
103
103
|
| `--const-scrollbar-w` | scrollbar width in px |
|
|
104
104
|
| `--const-scrollbar-thin-w` | scrollbar width in px with `scrollbar-width: thin` (= `--const-scrollbar-w` where unsupported) |
|
|
105
|
+
| `--const-scrollbar-overlay` | user's scrollbar preference: `1` = overlay (floats over content, appears on interaction, `--const-scrollbar-w` is `0`), `0` = classic/inline (always shown, reserves width) |
|
|
105
106
|
| `--const-dpr` | `devicePixelRatio` |
|
|
106
107
|
| `--const-cores` | `navigator.hardwareConcurrency` |
|
|
107
108
|
| `--const-mem` | `navigator.deviceMemory` in GiB (Chromium-only, coarse; `0` elsewhere) |
|