mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
refactor!: use object instead of positional arg
This commit is contained in:
parent
109dec1681
commit
dbcac5035a
@ -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…
x
Reference in New Issue
Block a user