2021-09-03 13:48:16 +02:00
|
|
|
import { run, html, css } from './util/run'
|
|
|
|
|
|
|
|
|
|
test('PHP arrays', async () => {
|
|
|
|
|
let config = {
|
|
|
|
|
content: [
|
|
|
|
|
{ raw: html`<h1 class="<?php echo wrap(['class' => "max-w-[16rem]"]); ?>">Hello world</h1>` },
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return run('@tailwind utilities', config).then((result) => {
|
|
|
|
|
expect(result.css).toMatchFormattedCss(css`
|
2021-10-18 12:08:48 +02:00
|
|
|
.max-w-\[16rem\] {
|
2021-09-03 13:48:16 +02:00
|
|
|
max-width: 16rem;
|
|
|
|
|
}
|
|
|
|
|
`)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test('arbitrary values with quotes', async () => {
|
|
|
|
|
let config = { content: [{ raw: html`<div class="content-['hello]']"></div>` }] }
|
|
|
|
|
|
|
|
|
|
return run('@tailwind utilities', config).then((result) => {
|
|
|
|
|
expect(result.css).toMatchFormattedCss(css`
|
2021-10-18 12:08:48 +02:00
|
|
|
.content-\[\'hello\]\'\] {
|
2021-10-18 18:11:34 +02:00
|
|
|
--tw-content: 'hello]';
|
|
|
|
|
content: var(--tw-content);
|
2021-09-03 13:48:16 +02:00
|
|
|
}
|
|
|
|
|
`)
|
|
|
|
|
})
|
|
|
|
|
})
|