Closed
Description
I'm using postcss-preset-env and color-mod()
doesn't work with custom css properties
I understand resolving custom properties is difficult without importing the :root {...}
styles, but even after importing and resolving custom variables I'm still getting errors.
index.css
:
body {
background-color: color-mod(var(--color-primary) h(64));
}
foo.css
:
:root {
--color-primary: "#0366d6";
}
webpack.config
:
{
loader: 'postcss-loader',
options: {
plugins: () => [
postcssPresetEnv({
stage: 3,
features: {
'color-mod-function': {
unresolved: 'warn',
importFrom: 'src/assets/foo.css',
}
}
})
]
}
},
Expected behaviour
input.css
background-color: color-mod(var(--color-primary) hue(64));
output.css
background-color: #cad803;
Actual behaviour
input.css
background-color: color-mod(var(--color-primary) hue(64));
output.css
background-color: color-mod(#0366d6 hue(64));
Metadata
Metadata
Assignees
Labels
No labels