Skip to content

Commit 4921123

Browse files
committed
Warn when using incorrect dashed-ident/ident
1 parent b732d33 commit 4921123

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/parse.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ export default function parse (str, {meta} = {}) {
103103
Object.assign(meta, {formatId: "color", types});
104104
}
105105

106+
if (colorSpec.id.startsWith("--") && !id.startsWith("--")) {
107+
console.warn(`color(${id}) used instead of prefixed color(${colorSpec.id}).`);
108+
}
109+
if (id.startsWith("--") && !colorSpec.id.startsWith("--")) {
110+
console.warn(`color(${id}) used instead of unprefixed color(${colorSpec.id}).`);
111+
}
112+
106113
return {spaceId: space.id, coords, alpha};
107114
}
108115
}

0 commit comments

Comments
 (0)