tailwindcss/tests/css-configuration.test.js
2023-06-19 17:36:13 -04:00

37 lines
715 B
JavaScript

import { run, html, css } from './util/run'
test('it does something', () => {
let config = {
darkMode: 'class',
content: [
{
raw: html`
<div class="text-black"></div>
<div class="text-potato"></div>
`,
},
],
}
return run(
css`
@tailwind utilities;
:theme {
--colors-potato: #facade;
}
`,
config
).then((result) => {
expect(result.css).toMatchFormattedCss(css`
.text-black {
--tw-text-opacity: 1;
color: rgb(0 0 0 / var(--tw-text-opacity));
}
.text-potato {
--tw-text-opacity: 1;
color: rgb(250 202 222 / var(--tw-text-opacity));
}
`)
})
})