Skip to content

Commit

Permalink
refactor!: use object instead of positional arg
Browse files Browse the repository at this point in the history
  • Loading branch information
innocenzi committed Jun 28, 2020
1 parent 109dec1 commit dbcac50
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/withAlphaVariable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down
2 changes: 1 addition & 1 deletion src/util/withAlphaVariable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
}
}

Expand Down

0 comments on commit dbcac50

Please sign in to comment.