2024-10-24 17:34:19 +02:00
|
|
|
import { candidate, css, html, js, json, test } from '../utils'
|
|
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
'builds the `@headlessui/tailwindcss` plugin utilities (CJS)',
|
|
|
|
|
{
|
|
|
|
|
fs: {
|
|
|
|
|
'package.json': json`
|
|
|
|
|
{
|
|
|
|
|
"type": "commonjs",
|
|
|
|
|
"dependencies": {
|
|
|
|
|
"postcss": "^8",
|
|
|
|
|
"postcss-cli": "^10",
|
|
|
|
|
"tailwindcss": "workspace:^",
|
|
|
|
|
"@tailwindcss/postcss": "workspace:^",
|
|
|
|
|
"@headlessui/tailwindcss": "^0.2.1"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
'postcss.config.cjs': js`
|
|
|
|
|
let tailwindcss = require('@tailwindcss/postcss')
|
|
|
|
|
module.exports = {
|
|
|
|
|
plugins: [tailwindcss()],
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
'index.html': html`
|
|
|
|
|
<div className="ui-open:flex"></div>
|
|
|
|
|
`,
|
|
|
|
|
'src/index.css': css`
|
2025-02-25 11:36:43 +01:00
|
|
|
@reference 'tailwindcss/theme';
|
2024-10-24 17:34:19 +02:00
|
|
|
@import 'tailwindcss/utilities';
|
|
|
|
|
@plugin '@headlessui/tailwindcss';
|
|
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
async ({ fs, exec }) => {
|
|
|
|
|
await exec('pnpm postcss src/index.css --output dist/out.css')
|
|
|
|
|
|
|
|
|
|
await fs.expectFileToContain('dist/out.css', [candidate`ui-open:flex`])
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
test(
|
|
|
|
|
'builds the `@headlessui/tailwindcss` plugin utilities (ESM)',
|
|
|
|
|
{
|
|
|
|
|
fs: {
|
|
|
|
|
'package.json': json`
|
|
|
|
|
{
|
|
|
|
|
"type": "module",
|
|
|
|
|
"dependencies": {
|
|
|
|
|
"postcss": "^8",
|
|
|
|
|
"postcss-cli": "^10",
|
|
|
|
|
"tailwindcss": "workspace:^",
|
|
|
|
|
"@tailwindcss/postcss": "workspace:^",
|
|
|
|
|
"@headlessui/tailwindcss": "^0.2.1"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
'postcss.config.mjs': js`
|
|
|
|
|
import tailwindcss from '@tailwindcss/postcss'
|
|
|
|
|
export default {
|
|
|
|
|
plugins: [tailwindcss()],
|
|
|
|
|
}
|
|
|
|
|
`,
|
|
|
|
|
'index.html': html`
|
|
|
|
|
<div className="ui-open:flex"></div>
|
|
|
|
|
`,
|
|
|
|
|
'src/index.css': css`
|
2025-02-25 11:36:43 +01:00
|
|
|
@reference 'tailwindcss/theme';
|
2024-10-24 17:34:19 +02:00
|
|
|
@import 'tailwindcss/utilities';
|
|
|
|
|
@plugin '@headlessui/tailwindcss';
|
|
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
async ({ fs, exec }) => {
|
|
|
|
|
await exec('pnpm postcss src/index.css --output dist/out.css')
|
|
|
|
|
|
|
|
|
|
await fs.expectFileToContain('dist/out.css', [candidate`ui-open:flex`])
|
|
|
|
|
},
|
|
|
|
|
)
|