Skip to content

Commit 33df925

Browse files
committed
Finish resolving merge conflicts, fix tests
1 parent 90979a1 commit 33df925

12 files changed

+47
-166
lines changed

src/jit/corePlugins/backgroundColor.js

-29
This file was deleted.

src/jit/corePlugins/borderColor.js

-35
This file was deleted.

src/jit/corePlugins/divideColor.js

-34
This file was deleted.

src/jit/corePlugins/placeholderColor.js

-31
This file was deleted.

src/jit/corePlugins/textColor.js

-31
This file was deleted.

src/plugins/backgroundColor.js

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ export default function () {
1818
return []
1919
}
2020

21+
if (!corePlugins('backgroundOpacity')) {
22+
return {
23+
[nameClass('bg', modifier)]: {
24+
'background-color': value,
25+
},
26+
}
27+
}
28+
2129
return {
2230
[nameClass('bg', modifier)]: withAlphaVariable({
2331
color: value,

src/plugins/borderColor.js

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ export default function () {
2222
return []
2323
}
2424

25+
if (!corePlugins('borderOpacity')) {
26+
return {
27+
[nameClass('border', modifier)]: {
28+
'border-color': value,
29+
},
30+
}
31+
}
32+
2533
return {
2634
[nameClass('border', modifier)]: withAlphaVariable({
2735
color: value,

src/plugins/divideColor.js

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ export default function () {
2222
return []
2323
}
2424

25+
if (!corePlugins('divideOpacity')) {
26+
return {
27+
[`${nameClass('divide', modifier)} > :not([hidden]) ~ :not([hidden])`]: {
28+
'border-color': value,
29+
},
30+
}
31+
}
32+
2533
return {
2634
[`${nameClass(
2735
'divide',

src/plugins/placeholderColor.js

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ export default function () {
1818
return []
1919
}
2020

21+
if (!corePlugins('placeholderOpacity')) {
22+
return {
23+
[`${nameClass('placeholder', modifier)}::placeholder`]: {
24+
color: value,
25+
},
26+
}
27+
}
28+
2129
return {
2230
[`${nameClass('placeholder', modifier)}::placeholder`]: withAlphaVariable({
2331
color: value,

src/plugins/textColor.js

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ export default function () {
1818
return []
1919
}
2020

21+
if (!corePlugins('textOpacity')) {
22+
return {
23+
[nameClass('text', modifier)]: {
24+
color: value,
25+
},
26+
}
27+
}
28+
2129
return {
2230
[nameClass('text', modifier)]: withAlphaVariable({
2331
color: value,

tests/jit/arbitrary-values.test.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
}
213213
.bg-\[hsl\(0\2c 100\%\2c 50\%\)\] {
214214
--tw-bg-opacity: 1;
215-
background-color: rgba(255, 0, 0, var(--tw-bg-opacity));
215+
background-color: hsla(0, 100%, 50%, var(--tw-bg-opacity));
216216
}
217217
.bg-\[hsla\(0\2c 100\%\2c 50\%\2c 0\.3\)\] {
218218
background-color: hsla(0, 100%, 50%, 0.3);

tests/jit/opacity.test.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
const postcss = require('postcss')
2-
const tailwind = require('../index.js')
3-
const fs = require('fs')
4-
const path = require('path')
1+
import postcss from 'postcss'
2+
import fs from 'fs'
3+
import path from 'path'
4+
import tailwind from '../../src/jit/index.js'
55

66
function run(input, config = {}) {
77
return postcss(tailwind(config)).process(input, { from: path.resolve(__filename) })
88
}
99

1010
test('opacity', () => {
1111
let config = {
12+
mode: 'jit',
1213
darkMode: 'class',
1314
purge: [path.resolve(__dirname, './opacity.test.html')],
1415
corePlugins: {
16+
preflight: false,
1517
backgroundOpacity: false,
1618
borderOpacity: false,
1719
divideOpacity: false,
1820
placeholderOpacity: false,
19-
preflight: false,
2021
textOpacity: false,
2122
},
2223
theme: {},

0 commit comments

Comments
 (0)