custom dark mode class

This commit is contained in:
Michael De Giovanni 2021-10-16 18:27:42 +02:00 • committed by Adam Wathan
parent 0a709bcd6f
commit 77156de519

View file

@ -23,6 +23,29 @@ it('should be possible to use the darkMode "class" mode', () => {
})
})
it('should be possible to change default class with darkMode "class" mode', () => {
let config = {
darkMode: 'class',
darkModeClassName: '.test-dark',
content: [{ raw: html`<div class="dark:font-bold"></div>` }],
corePlugins: { preflight: false },
}
let input = css`
@tailwind base;
@tailwind components;
@tailwind utilities;
`
return run(input, config).then((result) => {
expect(result.css).toMatchFormattedCss(css`
.test-dark .dark\\:font-bold {
font-weight: 700;
}
`)
})
})
it('should be possible to use the darkMode "media" mode', () => {
let config = {
darkMode: 'media',