refactor!: use object instead of positional arg
This commit is contained in:
parent
109dec1681
commit
dbcac5035a
2 changed files with 2 additions and 2 deletions
|
|
@ -99,7 +99,7 @@ test('it ignores colors that already have an alpha channel', () => {
|
|||
test('it allows a closure to be passed', () => {
|
||||
expect(
|
||||
withAlphaVariable({
|
||||
color: variable => `rgba(0, 0, 0, var(${variable}))`,
|
||||
color: ({ opacityVariable }) => `rgba(0, 0, 0, var(${opacityVariable}))`,
|
||||
property: 'background-color',
|
||||
variable: '--bg-opacity',
|
||||
})
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function toRgba(color) {
|
|||
export default function withAlphaVariable({ color, property, variable }) {
|
||||
if (_.isFunction(color)) {
|
||||
return {
|
||||
[property]: color(variable),
|
||||
[property]: color({ opacityVariable: variable }),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue