From c7aba3042b26b530dd7481d9c26f4c17a3069c5a Mon Sep 17 00:00:00 2001 From: mehbark Date: Thu, 11 Jul 2024 18:39:36 -0400 Subject: [PATCH] name-color: example --- serverside/name-color.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/serverside/name-color.ts b/serverside/name-color.ts index c101f77..5a0057b 100644 --- a/serverside/name-color.ts +++ b/serverside/name-color.ts @@ -7,8 +7,9 @@ import * as css from "https://deno.land/x/css@0.3.0/mod.ts"; function is_valid_color(color: string): boolean { try { const { stylesheet } = css.parse(`*{color:${color};}`); - return stylesheet.rules.length == 1 && - stylesheet.rules[0].declarations.length == 1; + return color.toLowerCase() != "example" + && stylesheet.rules.length == 1 + && stylesheet.rules[0].declarations.length == 1; } catch { return false; }