Open chenyulun opened 3 years ago
const customPropertyRegExp = /^--[A-z][\w-]*$/; // whether the node is an html or :root rule
Is this check too strict, Is it possible to add a parameter to read the variable on the body style, since most of the element styles are under the body Like this,
const testStr = `
:root {
--color: green;
}
body {
--color: red;
}
h1 {
color: var(--color);
}
`;
ouput code
:root {
--color: green;
}
body {
--color: red;
}
h1 {
color: red;
color: var(--color);
}
`;
If you think it is unreasonable to read the body style CSS variable by default, can you set the parameter configuration
output css
Expect the following code
Browsers can recognize variables that start with a '-', but here the plugin cannot recognize them when converting