Closed cjy816618 closed 1 year ago
@cjy816618 Please provide your CSS input, what this plugin outputs, and what you expected the output to look like
Input:
...
Output:
...
Expected output:
...
css: plgin: package: output: I hope to be compatible with ie, I used this plugin, but it doesn't work in ie11
@cjy816618 Please update the issue description with a copy-pastable text version of a minimal reproduction case; input, output, expected output.
Ideally reproducible in the code playground: https://madlittlemods.github.io/postcss-css-variables/playground/
input:
:root{
--color-text-5: red;
}
div{
color: var(--color-text-5);
}
output:
div{
color: undefined;
}
expected output:
div{
color: red;
}
I can't reproduce in the code playground,
Input:
:root {
--color-text-5: red;
}
div {
color: var(--color-text-5);
}
Output looks as your expected result:
div {
color: red;
}
Is it caused by scss? I wrote it through scss
It sounds like you haven't isolated the problem. You need to get the exact input going into the postcss-css-variables
plugin. Comment out the postcss-css-variables
plugin and all plugins after it (leave the plugins before), make a build and show the output (text form please).
This problem has been solved, and this method can be used
"postcss-css-variables": "^0.17.0",
Input:
Output:
Expected output: