Using the following postcss plugins:
- postcss-cssnext
- postcss-nested
- postcss-color-function
I constantly hit the following error, when using the following color function.
Unable to parse color from string "l(-20%)"
styles.css
@import 'variables.css';
// ^-- contains: --blue: #3892e0;
& a {
color: color(var(--blue), l(-20%));
&:hover {
color: color(var(--blue), l(0%));
}
}
Webpack 2 snippet
{
loader: 'postcss-loader',
options: {
plugins: [
cssImport({ path: './src' }),
cssnext({ browsers: ['last 2 versions'] }),
colorFunction(),
nested(),
],
}
}