Closed elcoach290 closed 3 years ago
What is your result without postcss-color-function
?
@Semigradsky thanks for your help, without postcss-color-function the result is:
.header{
background-color: color(white a(80%));
padding: 15px 0;
padding: var(--spacer) 0;
}
Now the padding is duplicated, I thinlk the problem is with the postcss-custom-properties package, is there aditional configuration that I need to do??, My current solution is use postcss-color-function without postcss-custom-properties, but I can't use variables as parameters when I use the color function.
@elcoach290 by default postcss-custom-properties
preserve rules with custom properties. You can disable this by set preserve: false
, see configuration in readme:
https://github.com/postcss/postcss-custom-properties#preserve
@Semigradsky thanks a lot you are a Master, I tried , but I did it wrong because I didn't know how to add that property, so I did it:
module.exports = {
plugins: [
require('postcss-easy-import'),
require('postcss-mixins'),
require('postcss-nested'),
require('postcss-custom-properties', {preserve: false}),
require("postcss-color-function"),
]
}
But the correct way is:
module.exports = {
plugins: [
require('postcss-easy-import'),
require('postcss-mixins'),
require('postcss-nested'),
require('postcss-custom-properties')({
preserve: false
}),
require("postcss-color-function"),
]
}
But your answer gave me confidence, and I try other way, maybe it could be added to the documentation, thanks again
This is my postcss.config.js
In the precompiled file y write:
The result is:
The declaration is duplicated, what I did wrong???
the task is:
what is missing ???
Thanks for your help friends!!