Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit ec4d952

Browse files
committed
Migrate backgroundImage
1 parent 8e5f86f commit ec4d952

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/corePlugins/backgroundColor.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ module.exports = function ({ jit: { theme, addUtilities, addVariant, e } }) {
1818
return []
1919
}
2020

21-
return [
22-
{
23-
[nameClass('bg', modifier)]: withAlphaVariable({
24-
color: value,
25-
property: 'background-color',
26-
variable: '--tw-bg-opacity',
27-
}),
28-
},
29-
]
21+
return {
22+
[nameClass('bg', modifier)]: withAlphaVariable({
23+
color: value,
24+
property: 'background-color',
25+
variable: '--tw-bg-opacity',
26+
}),
27+
}
3028
}),
3129
],
3230
})

src/corePlugins/backgroundImage.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
const nameClass = require('tailwindcss/lib/util/nameClass').default
2+
const { newFormat } = require('../pluginUtils')
23

34
module.exports = function ({ jit: { theme, addUtilities, addVariant, e } }) {
45
addUtilities({
56
bg: [
6-
(modifier, { theme }) => {
7+
newFormat((modifier, { theme }) => {
78
let value = theme.backgroundImage[modifier]
89

910
if (value === undefined) {
1011
return []
1112
}
1213

13-
return [[nameClass('bg', modifier), { 'background-image': value }]]
14-
},
14+
return { [nameClass('bg', modifier)]: { 'background-image': value } }
15+
}),
1516
],
1617
})
1718
}

0 commit comments

Comments
 (0)