Skip to content

Commit dbcac50

Browse files
committed
refactor!: use object instead of positional arg
1 parent 109dec1 commit dbcac50

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

__tests__/withAlphaVariable.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ test('it ignores colors that already have an alpha channel', () => {
9999
test('it allows a closure to be passed', () => {
100100
expect(
101101
withAlphaVariable({
102-
color: variable => `rgba(0, 0, 0, var(${variable}))`,
102+
color: ({ opacityVariable }) => `rgba(0, 0, 0, var(${opacityVariable}))`,
103103
property: 'background-color',
104104
variable: '--bg-opacity',
105105
})

src/util/withAlphaVariable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function toRgba(color) {
2121
export default function withAlphaVariable({ color, property, variable }) {
2222
if (_.isFunction(color)) {
2323
return {
24-
[property]: color(variable),
24+
[property]: color({ opacityVariable: variable }),
2525
}
2626
}
2727

0 commit comments

Comments
 (0)