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): flag create-vite's #646cff and #535bf2 in template-theme (#165)

susheelg1197b3615dc56ad2
diff --git a/skills/unslop-anything/scripts/detect.js b/skills/unslop-anything/scripts/detect.js
index 02a179f..2eb0b1e 100644
--- a/skills/unslop-anything/scripts/detect.js
+++ b/skills/unslop-anything/scripts/detect.js
@@ -626,7 +626,8 @@ const rules = [
find({ code, stack }) {
const re = stack === "xml"
? /#(?:[fF]{2})?(?:6200[eE][eE]|3700[bB]3|[bB][bB]86[fF][cC])\b/
- : /seedColor:\s*Colors\.deepPurple|0x[fF]{2}(?:6650[aA]4|[dD]0[bB][cC][fF][fF]|6200[eE][eE]|3700[bB]3|[bB][bB]86[fF][cC])\b|#(?:6200[eE][eE]|3700[bB]3|[bB][bB]86[fF][cC]|0[aA]7[eE][aA]4)\b|<HelloWave\b|<ParallaxScrollView\b/;
+ : /seedColor:\s*Colors\.deepPurple|0x[fF]{2}(?:6650[aA]4|[dD]0[bB][cC][fF][fF]|6200[eE][eE]|3700[bB]3|[bB][bB]86[fF][cC])\b|#(?:6200[eE][eE]|3700[bB]3|[bB][bB]86[fF][cC]|0[aA]7[eE][aA]4|646[cC][fF]{2}|535[bB][fF]2)\b|<HelloWave\b|<ParallaxScrollView\b/;
+ // #646cff / #535bf2 are create-vite's starter link and hover colors.
// One finding per file, like drawer-nav: the default tint and the
// starter-screen components are the same leftover.
const first = matches(re, code).next();
diff --git a/test/detect.test.js b/test/detect.test.js
index 358447a..0b91e19 100644
--- a/test/detect.test.js
+++ b/test/detect.test.js
@@ -1549,3 +1549,12 @@ test("clickable-div flags Angular (click) and Alpine x-on:click handlers", () =>
assert.deepStrictEqual(rulesFor('<button (click)="open()">x</button>\n'), []);
assert.deepStrictEqual(rulesFor('<button x-on:click="open = true">x</button>\n'), []);
});
+
+test("template-theme flags create-vite's #646cff and #535bf2", () => {
+ const rulesFor = (src) => scanSource(src, "index.css").map((f) => f.rule).filter((r) => r === "template-theme");
+ assert.deepStrictEqual(rulesFor("a {\n font-weight: 500;\n color: #646cff;\n}\na:hover {\n color: #535bf2;\n}\n"), ["template-theme"]);
+ assert.deepStrictEqual(rulesFor("a:hover { color: #535BF2; }\n"), ["template-theme"]);
+ assert.deepStrictEqual(rulesFor("a { color: #646CFF; }\n"), ["template-theme"]);
+ assert.deepStrictEqual(rulesFor("a { color: #646cf0; }\n"), []);
+ assert.deepStrictEqual(rulesFor("a { color: #646cffaa; }\n"), []);
+});