vireglass 3.0.0 → 3.0.1
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/dist/dom.cjs +5 -3
- package/dist/dom.cjs.map +1 -1
- package/dist/dom.d.cts +1 -1
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +5 -3
- package/dist/dom.js.map +1 -1
- package/package.json +1 -1
- package/src/dom/index.ts +1 -1
- package/src/dom/rim.ts +6 -4
package/dist/dom.cjs
CHANGED
|
@@ -1338,9 +1338,11 @@ function rimGradientCss(optics, ambient, light, appear = 1) {
|
|
|
1338
1338
|
return `conic-gradient(from ${start.toFixed(1)}deg, ${line.join(", ")}), conic-gradient(${dark} 0deg, ${dark} 360deg)`;
|
|
1339
1339
|
}
|
|
1340
1340
|
var RIM_WIDTH_PX = RIM.widthPx;
|
|
1341
|
-
function contrastRimCss(bodyLuma, rimLuma) {
|
|
1341
|
+
function contrastRimCss(bodyLuma, rimLuma, appear = 1) {
|
|
1342
1342
|
const v = to2552(rimLuma);
|
|
1343
|
-
|
|
1343
|
+
const present = clamp016(appear);
|
|
1344
|
+
const colour = present >= 1 ? `rgb(${v},${v},${v})` : `rgba(${v},${v},${v},${present.toFixed(3)})`;
|
|
1345
|
+
return `conic-gradient(${colour} 0deg, ${colour} 360deg)`;
|
|
1344
1346
|
}
|
|
1345
1347
|
|
|
1346
1348
|
// src/dom/nesting.ts
|
|
@@ -1963,7 +1965,7 @@ function attachGlass(el, opts = {}) {
|
|
|
1963
1965
|
const pole = withPresence(resolveBody(opticsNow, sample, light ? 1 : 0), opticsNow).tintLuma;
|
|
1964
1966
|
el.style.setProperty(
|
|
1965
1967
|
"--vireglass-rim",
|
|
1966
|
-
(opts.accessibility ?? a11y).increaseContrast ? contrastRimCss(pole, contrastRimLuma(pole)) : rimGradientCss(opticsNow, [tr, tg, tb], opts.light ?? REST_LIGHT, appear)
|
|
1968
|
+
(opts.accessibility ?? a11y).increaseContrast ? contrastRimCss(pole, contrastRimLuma(pole), appear) : rimGradientCss(opticsNow, [tr, tg, tb], opts.light ?? REST_LIGHT, appear)
|
|
1967
1969
|
);
|
|
1968
1970
|
el.style.setProperty("--vireglass-rim-width", `${RIM_WIDTH_PX}px`);
|
|
1969
1971
|
el.style.setProperty("--vireglass-radius", `${geometry.cornerRadius}px`);
|