Skip to content

Commit 9593a64

Browse files
committed
Convert styles to use var(--color) correctly
1 parent 81bc8b1 commit 9593a64

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

convert/convertStyles.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ export function convertStyles(dataDir: string, configData: ConfigTaskOutput, ver
101101
}
102102
line = line.replace('/fonts', joinUrlPath('$assets', finalPath));
103103
}
104+
// fix CSS color var usage that doesn't use `var(--var)` syntax
105+
const colorMatch = line.match(/color: ((?!var\(--).*Color)/i);
106+
if (colorMatch) {
107+
line = line.replace(colorMatch[1], `var(--${colorMatch[1]})`);
108+
}
104109
return line;
105110
})
106111
.join(eol);

0 commit comments

Comments
 (0)