Pass opacityValue to gradient colors for transparency support, do not pass opacityVariable since unused
This commit is contained in:
parent
28930f4799
commit
a7e19ca131
2 changed files with 34 additions and 13 deletions
|
|
@ -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)`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue