Skip to content

Commit 7e0b5c8

Browse files
authored
Merge pull request #105 from willofindie/feat/issue-104
feat: immediately return value of already parsed color.
2 parents c050f0e + 73fafe3 commit 7e0b5c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ export async function normalizeVars(
4545
const propertyName = value.match(CSS_VAR_FUNCTION_NOTATION)?.groups?.args;
4646
if (propertyName) {
4747
const cssVar = cssVars.find(cssVar => cssVar.property === propertyName);
48+
if (cssVar?.color) {
49+
return {
50+
isColor: true,
51+
value: cssVar?.color,
52+
};
53+
}
4854
return await normalizeVars(cssVar?.value || "");
4955
}
5056
} else if (cssVars && SCSS_COLOR_INTERPOLATION.test(value)) {

0 commit comments

Comments
 (0)