From 77156de5197b3956aa1304976c35aa30b328b857 Mon Sep 17 00:00:00 2001 From: Michael De Giovanni Date: Sat, 16 Oct 2021 18:27:42 +0200 Subject: [PATCH] custom dark mode class --- tests/dark-mode.test.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/dark-mode.test.js b/tests/dark-mode.test.js index 47a5aaef3..3e010c6b0 100644 --- a/tests/dark-mode.test.js +++ b/tests/dark-mode.test.js @@ -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`
` }], + 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',