@siyahi/tools 0.1.9-next.16 → 0.1.9-next.17
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/package.json +1 -1
- package/shots.mjs +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siyahi/tools",
|
|
3
|
-
"version": "0.1.9-next.
|
|
3
|
+
"version": "0.1.9-next.17",
|
|
4
4
|
"description": "Checks and build helpers for Siyahi pages: a lint plugin, a font preload plugin, a theme contrast check, and screenshot and layout shift scripts.",
|
|
5
5
|
"homepage": "https://siyahi.jatinbansal.com",
|
|
6
6
|
"license": "MIT",
|
package/shots.mjs
CHANGED
|
@@ -93,7 +93,12 @@ const PROBE = `((chrome) => {
|
|
|
93
93
|
};
|
|
94
94
|
const shown = (el) => {
|
|
95
95
|
const r = el.getBoundingClientRect();
|
|
96
|
-
|
|
96
|
+
const style = getComputedStyle(el);
|
|
97
|
+
// Base UI keeps clipped controls for form submission; aria-hidden alone
|
|
98
|
+
// does not mean a control (or its descendants) is visually hidden.
|
|
99
|
+
const hiddenControl = el.matches('input[aria-hidden="true"],select[aria-hidden="true"],textarea[aria-hidden="true"]') &&
|
|
100
|
+
(style.clipPath === "inset(50%)" || style.clip === "rect(0px, 0px, 0px, 0px)");
|
|
101
|
+
return r.width > 0 && r.height > 0 && !el.closest(chrome) && style.visibility !== "hidden" && !hiddenControl;
|
|
97
102
|
};
|
|
98
103
|
// Pixels of el cut off at the side by an ancestor that hides its overflow,
|
|
99
104
|
// and how it hides it, up to the nearest one that scrolls, which shows the
|