Pass opacityValue to gradient colors for transparency support, do not pass opacityVariable since unused

This commit is contained in:
Adam Wathan 2020-08-19 11:38:22 -04:00
parent 28930f4799
commit a7e19ca131
2 changed files with 34 additions and 13 deletions

View file

@ -12,17 +12,19 @@ export default function() {
const utilities = _(colors)
.map((value, modifier) => {
const getColorValue = (color, type) => {
const getColorValue = color => {
if (_.isFunction(color)) {
return value({
opacityVariable: `--gradient-${type}-opacity`,
})
return value({})
}
return color
}
const transparentTo = (() => {
if (_.isFunction(value)) {
return value({ opacityValue: 0 })
}
try {
const [r, g, b] = toRgba(value)
return `rgba(${r}, ${g}, ${b}, 0)`