Skip to content

Commit

Permalink
Finish resolving merge conflicts, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Apr 30, 2021
1 parent 90979a1 commit 33df925
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 166 deletions.
29 changes: 0 additions & 29 deletions src/jit/corePlugins/backgroundColor.js

This file was deleted.

35 changes: 0 additions & 35 deletions src/jit/corePlugins/borderColor.js

This file was deleted.

34 changes: 0 additions & 34 deletions src/jit/corePlugins/divideColor.js

This file was deleted.

31 changes: 0 additions & 31 deletions src/jit/corePlugins/placeholderColor.js

This file was deleted.

31 changes: 0 additions & 31 deletions src/jit/corePlugins/textColor.js

This file was deleted.

8 changes: 8 additions & 0 deletions src/plugins/backgroundColor.js
Expand Up @@ -18,6 +18,14 @@ export default function () {
return []
}

if (!corePlugins('backgroundOpacity')) {
return {
[nameClass('bg', modifier)]: {
'background-color': value,
},
}
}

return {
[nameClass('bg', modifier)]: withAlphaVariable({
color: value,
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/borderColor.js
Expand Up @@ -22,6 +22,14 @@ export default function () {
return []
}

if (!corePlugins('borderOpacity')) {
return {
[nameClass('border', modifier)]: {
'border-color': value,
},
}
}

return {
[nameClass('border', modifier)]: withAlphaVariable({
color: value,
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/divideColor.js
Expand Up @@ -22,6 +22,14 @@ export default function () {
return []
}

if (!corePlugins('divideOpacity')) {
return {
[`${nameClass('divide', modifier)} > :not([hidden]) ~ :not([hidden])`]: {
'border-color': value,
},
}
}

return {
[`${nameClass(
'divide',
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/placeholderColor.js
Expand Up @@ -18,6 +18,14 @@ export default function () {
return []
}

if (!corePlugins('placeholderOpacity')) {
return {
[`${nameClass('placeholder', modifier)}::placeholder`]: {
color: value,
},
}
}

return {
[`${nameClass('placeholder', modifier)}::placeholder`]: withAlphaVariable({
color: value,
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/textColor.js
Expand Up @@ -18,6 +18,14 @@ export default function () {
return []
}

if (!corePlugins('textOpacity')) {
return {
[nameClass('text', modifier)]: {
color: value,
},
}
}

return {
[nameClass('text', modifier)]: withAlphaVariable({
color: value,
Expand Down
2 changes: 1 addition & 1 deletion tests/jit/arbitrary-values.test.css
Expand Up @@ -212,7 +212,7 @@
}
.bg-\[hsl\(0\2c 100\%\2c 50\%\)\] {
--tw-bg-opacity: 1;
background-color: rgba(255, 0, 0, var(--tw-bg-opacity));
background-color: hsla(0, 100%, 50%, var(--tw-bg-opacity));
}
.bg-\[hsla\(0\2c 100\%\2c 50\%\2c 0\.3\)\] {
background-color: hsla(0, 100%, 50%, 0.3);
Expand Down
11 changes: 6 additions & 5 deletions tests/jit/opacity.test.js
@@ -1,22 +1,23 @@
const postcss = require('postcss')
const tailwind = require('../index.js')
const fs = require('fs')
const path = require('path')
import postcss from 'postcss'
import fs from 'fs'
import path from 'path'
import tailwind from '../../src/jit/index.js'

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

test('opacity', () => {
let config = {
mode: 'jit',
darkMode: 'class',
purge: [path.resolve(__dirname, './opacity.test.html')],
corePlugins: {
preflight: false,
backgroundOpacity: false,
borderOpacity: false,
divideOpacity: false,
placeholderOpacity: false,
preflight: false,
textOpacity: false,
},
theme: {},
Expand Down

0 comments on commit 33df925

Please sign in to comment.