mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 06:06:37 +03:00
Fix browser nested cards: WeakSet not iterable, match CLI heuristic
WeakSet.prototype[Symbol.iterator] doesn't exist — can't use for..of. Changed to Set (same fix as CLI). Also updated isCardLike heuristic to require shadow or border as mandatory, matching the CLI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
add8c1958d
commit
b34e0949a0
@@ -284,14 +284,16 @@
|
||||
const hasRadius = parseFloat(style.borderRadius) > 0 || /\brounded(?:-sm|-md|-lg|-xl|-2xl|-full)?\b/.test(cls);
|
||||
const hasBg = (style.backgroundColor && style.backgroundColor !== 'rgba(0, 0, 0, 0)') || /\bbg-(?:white|gray-\d+|slate-\d+)\b/.test(cls);
|
||||
const hasBorder = /\bborder\b/.test(cls);
|
||||
return [hasShadow, hasRadius, hasBg || hasBorder].filter(Boolean).length >= 2;
|
||||
// Must have shadow or border (the key card indicator), plus rounded or bg
|
||||
if (!hasShadow && !hasBorder) return false;
|
||||
return hasRadius || hasBg;
|
||||
}
|
||||
|
||||
function checkLayout() {
|
||||
const findings = [];
|
||||
|
||||
// --- Nested cards ---
|
||||
const flaggedEls = new WeakSet();
|
||||
const flaggedEls = new Set();
|
||||
for (const el of document.querySelectorAll('*')) {
|
||||
if (!isCardLike(el) || flaggedEls.has(el)) continue;
|
||||
const cls = el.getAttribute('class') || '';
|
||||
|
||||
Reference in New Issue
Block a user