Skip to content

Commit 2aabb63

Browse files
committed
Don't use opacity variable for default border color when borderOpacity is disabled
1 parent 2d98e1a commit 2aabb63

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/plugins/borderColor.js

+15-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ import withAlphaVariable from '../util/withAlphaVariable'
33

44
export default function () {
55
return function ({ addBase, matchUtilities, theme, variants, corePlugins }) {
6-
addBase({
7-
'*, ::before, ::after': withAlphaVariable({
8-
color: theme('borderColor.DEFAULT', 'currentColor'),
9-
property: 'border-color',
10-
variable: '--tw-border-opacity',
11-
}),
12-
})
6+
if (!corePlugins('borderOpacity')) {
7+
addBase({
8+
'*, ::before, ::after': {
9+
'border-color': theme('borderColor.DEFAULT', 'currentColor'),
10+
},
11+
})
12+
} else {
13+
addBase({
14+
'*, ::before, ::after': withAlphaVariable({
15+
color: theme('borderColor.DEFAULT', 'currentColor'),
16+
property: 'border-color',
17+
variable: '--tw-border-opacity',
18+
}),
19+
})
20+
}
1321

1422
matchUtilities(
1523
{

tests/jit/opacity.test.css

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
*,
22
::before,
33
::after {
4-
--tw-border-opacity: 1;
5-
border-color: rgba(229, 231, 235, var(--tw-border-opacity));
4+
border-color: #e5e7eb;
65
}
76
* {
87
--tw-shadow: 0 0 #0000;

0 commit comments

Comments
 (0)