Open martenzander opened 6 years ago
@SlimMarten could you remove all plugins except postcss-advanced-variable
and postcss-color-function
and provide css code when it error reproduced?
Was there a resolution to this?
When I try to do this:
--dark-base: #1b1c20;
--dark-10: color(var(--dark-base) lightness(10%));
I get this output:
but the color doesnt take.
If I use the color directly instead of the var, i.e. #1b1c20;
it works but I'm obviously duplicating..I'm using React Starter Kit.
bump
bump!
Edit: Of note, it looks like there was discussion a while back around postcss-custom-properties
, but using that plugin is not resolving the issue for me :/
https://github.com/postcss/postcss-color-function/issues/25
bump
As a replacement using postcss-functions plugin with css-color-function
npm package (which is used under the hood of postcss-color-function
)
Webpack config:
var color = require('css-color-function');
...
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [
[
'postcss-functions',
{
functions: {
color: (value) => color.convert(`color(${value})`)
}
}
]
]
}
}
}
I am using postcss-advanced-variables and if i try to put variables into my color values I get the following error:
this is my postcss line up: