Skip to content

Commit 77156de

Browse files
Michael De Giovanniadamwathan
authored andcommitted
custom dark mode class
1 parent 0a709bc commit 77156de

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/dark-mode.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,29 @@ it('should be possible to use the darkMode "class" mode', () => {
2323
})
2424
})
2525

26+
it('should be possible to change default class with darkMode "class" mode', () => {
27+
let config = {
28+
darkMode: 'class',
29+
darkModeClassName: '.test-dark',
30+
content: [{ raw: html`<div class="dark:font-bold"></div>` }],
31+
corePlugins: { preflight: false },
32+
}
33+
34+
let input = css`
35+
@tailwind base;
36+
@tailwind components;
37+
@tailwind utilities;
38+
`
39+
40+
return run(input, config).then((result) => {
41+
expect(result.css).toMatchFormattedCss(css`
42+
.test-dark .dark\\:font-bold {
43+
font-weight: 700;
44+
}
45+
`)
46+
})
47+
})
48+
2649
it('should be possible to use the darkMode "media" mode', () => {
2750
let config = {
2851
darkMode: 'media',

0 commit comments

Comments
 (0)