larsenwork / postcss-easing-gradients

PostCSS plugin to create smooth linear-gradients that approximate easing functions.
https://www.npmjs.com/package/postcss-easing-gradients
MIT License
923 stars 22 forks source link

Added Chroma.js workaround for it not yet supporting 'deg' units: #18

Open Ambient-Impact opened 1 year ago

Ambient-Impact commented 1 year ago

This works around gka/chroma.js#297 by stripping the 'deg' unit in hsl()/hsla() colours, which fixes instances of this plug-in failing to parse the newer colour format. This is particularly a problem with Sass, as it tends to output to the newer format. Without this workaround, you'd get errors such as these:

Couldn't parse:
linear-gradient(to bottom, hsl(0deg, 0%, 95%), cubic-bezier(0.4, 0, 1, 1), rgba(242, 242, 242, 0))
Check the syntax to see if it's correct/supported.
Couldn't parse:
linear-gradient(to bottom, hsl(0deg, 0%, 4%), cubic-bezier(0.4, 0, 1, 1), rgba(10, 10, 10, 0))
Check the syntax to see if it's correct/supported.
Couldn't parse:
linear-gradient(to top, hsl(0deg, 0%, 95%), cubic-bezier(0.4, 0, 1, 1), rgba(242, 242, 242, 0))
Check the syntax to see if it's correct/supported.
Couldn't parse:
linear-gradient(to top, hsl(0deg, 0%, 4%), cubic-bezier(0.4, 0, 1, 1), rgba(10, 10, 10, 0))
Check the syntax to see if it's correct/supported.