-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return rgb values if the opacity core plugins are disabled (#3984)
- Loading branch information
1 parent
ed1727a
commit 7112e21
Showing
8 changed files
with
139 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
* { | ||
--tw-shadow: 0 0 #0000; | ||
--tw-ring-inset: var(--tw-empty, /*!*/ /*!*/); | ||
--tw-ring-offset-width: 0px; | ||
--tw-ring-offset-color: #fff; | ||
--tw-ring-color: rgba(59, 130, 246, 0.5); | ||
--tw-ring-offset-shadow: 0 0 #0000; | ||
--tw-ring-shadow: 0 0 #0000; | ||
} | ||
.divide-black > :not([hidden]) ~ :not([hidden]) { | ||
border-color: #000; | ||
} | ||
.border-black { | ||
border-color: #000; | ||
} | ||
.bg-black { | ||
background-color: #000; | ||
} | ||
.text-black { | ||
color: #000; | ||
} | ||
.placeholder-black::placeholder { | ||
color: #000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Title</title> | ||
<link rel="stylesheet" href="./tailwind.css" /> | ||
</head> | ||
<body> | ||
<div class="divide-black"></div> | ||
<div class="border-black"></div> | ||
<div class="bg-black"></div> | ||
<div class="text-black"></div> | ||
<div class="placeholder-black"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const postcss = require('postcss') | ||
const tailwind = require('../index.js') | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
function run(input, config = {}) { | ||
return postcss(tailwind(config)).process(input, { from: path.resolve(__filename) }) | ||
} | ||
|
||
test('opacity', () => { | ||
let config = { | ||
darkMode: 'class', | ||
purge: [path.resolve(__dirname, './opacity.test.html')], | ||
corePlugins: { | ||
backgroundOpacity: false, | ||
borderOpacity: false, | ||
divideOpacity: false, | ||
placeholderOpacity: false, | ||
preflight: false, | ||
textOpacity: false, | ||
}, | ||
theme: {}, | ||
plugins: [], | ||
} | ||
|
||
let css = ` | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
` | ||
|
||
return run(css, config).then((result) => { | ||
let expectedPath = path.resolve(__dirname, './opacity.test.css') | ||
let expected = fs.readFileSync(expectedPath, 'utf8') | ||
|
||
expect(result.css).toMatchCss(expected) | ||
}) | ||
}) |