Search code examples
javascriptcssnpmsasspostcss

Should postcss plugins reference postcss as a peer dependency?


I'm attempting to use the PostCSS Sass Color Function. I get this error:

    Unknown error from PostCSS plugin. Your current PostCSS version is 6.0.22, but postcss-sass-color-functions uses 5.2.18. Perhaps this is the source of the error below.
    (node:12911) UnhandledPromiseRejectionWarning: Error: /home/ole/Junk/superflycss/component-button/node_modules/@superflycss/variables-colors/notifications/index.css:76:9: Unable to parse color from string "25%"

Solution

  • Postcss-sass-color-functions is no longer maintained as mentioned in their repository.

    You can use postcss-preset-env instead with color-mod-function enabled to do the same.