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

Commit 50c89fd

Browse files
committed
Migrate borderColor
1 parent c7c89d1 commit 50c89fd

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

src/corePlugins/borderColor.js

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,28 @@ const withAlphaVariable = require('tailwindcss/lib/util/withAlphaVariable').defa
55
const toColorValue = require('tailwindcss/lib/util/toColorValue').default
66
const { asColor } = require('../pluginUtils')
77

8-
module.exports = function ({ jit: { theme, addUtilities, addVariant, e } }) {
8+
module.exports = function ({ matchUtilities, jit: { theme } }) {
99
let colorPalette = flattenColorPalette(theme.borderColor)
1010

11-
addUtilities({
12-
border: [
13-
(modifier, { theme }) => {
14-
if (modifier === 'DEFAULT') {
15-
return []
16-
}
11+
matchUtilities({
12+
border: (modifier, { theme }) => {
13+
if (modifier === 'DEFAULT') {
14+
return []
15+
}
1716

18-
let value = asColor(modifier, colorPalette)
17+
let value = asColor(modifier, colorPalette)
1918

20-
if (value === undefined) {
21-
return []
22-
}
19+
if (value === undefined) {
20+
return []
21+
}
2322

24-
return [
25-
[
26-
nameClass('border', modifier),
27-
withAlphaVariable({
28-
color: colorPalette[modifier],
29-
property: 'border-color',
30-
variable: '--tw-border-opacity',
31-
}),
32-
],
33-
]
34-
},
35-
],
23+
return {
24+
[nameClass('border', modifier)]: withAlphaVariable({
25+
color: colorPalette[modifier],
26+
property: 'border-color',
27+
variable: '--tw-border-opacity',
28+
}),
29+
}
30+
},
3631
})
3732
}

0 commit comments

Comments
 (0)