Skip to content

Your app looks AI-generated. Vincent Van Gogh noticed. An agent skill that finds and fixes AI-looking UI and UX in mobile apps, web apps, and websites.

fix(detect): catch Tailwind sky shadows in glow-shadow (#276)

Papito084160ed428ff1f
diff --git a/skills/unslop-anything/scripts/detect.js b/skills/unslop-anything/scripts/detect.js
index 538648b..59b725d 100644
--- a/skills/unslop-anything/scripts/detect.js
+++ b/skills/unslop-anything/scripts/detect.js
@@ -826,7 +826,7 @@ function glowLayers(list) {
function isGlowValue(value, stack) {
if (!value) return false;
if (/black|gray|grey|shadow|\.primary\b|label|0x[0-9a-f]{2}000000|#000(?:000)?(?:[0-9a-f]{2})?\b|#000[0-9a-f]\b|rgba?\([\s_]*0(?:[\s_]*,[\s_]*|[\s_]+)0(?:[\s_]*,[\s_]*|[\s_]+)0/i.test(value)) return false;
- const named = /(?:\.|Colors\.|Color\.|\b)(purple|deepPurple|indigo|violet|pink|magenta|fuchsia|blue|cyan|teal|mint|accentColor|accent)\b/i.test(value);
+ const named = /(?:\.|Colors\.|Color\.|\b)(purple|deepPurple|indigo|violet|pink|magenta|fuchsia|blue|cyan|teal|mint|sky|accentColor|accent)\b/i.test(value);
const hex = hexColors(value, stack).some(isSaturated);
const rgbRe = /rgba?\([\s_]*(\d+)(?:[\s_]*,[\s_]*|[\s_]+)(\d+)(?:[\s_]*,[\s_]*|[\s_]+)(\d+)/g;
let rgbSat = false;
@@ -925,7 +925,7 @@ const rules = [
const hits = [];
// text-shadow is layered like box-shadow (#200); textShadowColor is React
// Native's text glow (#201); a filter drop-shadow() is one shadow (#199).
- for (const m of matches(/\.shadow\(\s*color:\s*([^,)]+)|(?:shadowColor|textShadowColor)\s*[:=]\s*["']?([^"',;\n}]+)|(?:ambientColor|spotColor)\s*=\s*([^,)\n]+)|\b(?:BoxShadow|Shadow)\(\s*color:\s*([^,)\n]+)|(?:box|text)-shadow:\s*([^;\n]+)|\bshadow-((?:purple|violet|indigo|pink|fuchsia|blue|cyan|teal)-\d{2,3})\b|\bshadow-\[([^\]\n]+)\]|\bdrop-shadow\(((?:[^()\n]|\([^()\n]*\))*)\)|\b(?:box|text)Shadow\s*:\s*(?:"([^"\n]*)"|'([^'\n]*)'|`([^`]*)`)/, code)) {
+ for (const m of matches(/\.shadow\(\s*color:\s*([^,)]+)|(?:shadowColor|textShadowColor)\s*[:=]\s*["']?([^"',;\n}]+)|(?:ambientColor|spotColor)\s*=\s*([^,)\n]+)|\b(?:BoxShadow|Shadow)\(\s*color:\s*([^,)\n]+)|(?:box|text)-shadow:\s*([^;\n]+)|\bshadow-((?:purple|violet|indigo|pink|fuchsia|blue|cyan|teal|sky)-\d{2,3})\b|\bshadow-\[([^\]\n]+)\]|\bdrop-shadow\(((?:[^()\n]|\([^()\n]*\))*)\)|\b(?:box|text)Shadow\s*:\s*(?:"([^"\n]*)"|'([^'\n]*)'|`([^`]*)`)/, code)) {
const raw = m.slice(1).find(Boolean) || "";
const layers = m[5] || m[7] || m[9] || m[10] || m[11] ? glowLayers(raw.replace(/_/g, " ")) : raw ? [raw] : [];
if (layers.some((value) => isGlowValue(value, stack))) hits.push(m.index);
diff --git a/test/detect.test.js b/test/detect.test.js
index 59840c9..2f84723 100644
--- a/test/detect.test.js
+++ b/test/detect.test.js
@@ -1716,6 +1716,21 @@ test("glow-shadow catches Tailwind colored and arbitrary shadows while ignoring
assert.deepStrictEqual(scanSource(neutral, "a.tsx"), []);
});
+test("glow-shadow catches Tailwind sky shadows (issue #269)", () => {
+ // Issue #269 repro:
+ const repro = '<div className="rounded-xl shadow-lg shadow-sky-500/50">Pro</div>;\n';
+ assert.deepStrictEqual(scanSource(repro, "Card.tsx").map((f) => [f.line, f.severity, f.rule]), [[1, "minor", "glow-shadow"]]);
+
+ // Flagged forms: without opacity, hover variant
+ assert.deepStrictEqual(scanSource('<div className="shadow-sky-400">x</div>\n', "Card.tsx").map((f) => f.rule), ["glow-shadow"]);
+ assert.deepStrictEqual(scanSource('<div className="hover:shadow-sky-500">x</div>\n', "Card.tsx").map((f) => f.rule), ["glow-shadow"]);
+
+ // Neutral shadows stay quiet
+ assert.deepStrictEqual(scanSource('<div className="shadow-slate-500/20">x</div>\n', "Card.tsx"), []);
+ assert.deepStrictEqual(scanSource('<div className="shadow-gray-900/10">x</div>\n', "Card.tsx"), []);
+ assert.deepStrictEqual(scanSource('<div className="shadow-black/5">x</div>\n', "Card.tsx"), []);
+});
+
test("glow-shadow skips inset accent bars with no blur (#111)", () => {
const bars = [
".line.highlighted {",