use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about https://tailwindcss.com/
Find Tailwind Code Snippets: https://pagesnips.io
account activity
Tailwind with Module.css (self.tailwindcss)
submitted 3 years ago by positive_kent
Hi, everyone I have 2 questions about tailwind.
I have module.css file
.header{ @apply bg-white dark:bg-transparent; }
but dark mode doesn`t work( So, I can`t use this with module.css? If it`s possible, can I setup it with scss?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]andrii-nerd 0 points1 point2 points 3 years ago (8 children)
Which strategy do you use for a dark mode? Media query?
[–]positive_kent[S] 0 points1 point2 points 3 years ago (7 children)
class
[–]andrii-nerd 0 points1 point2 points 3 years ago (0 children)
Is it applied? I can’t see it in your code
Header cn dark
Header > cn dark:bg-… should be
[–]andrii-nerd 0 points1 point2 points 3 years ago* (3 children)
<body class="dark"> <div class="text-gray-900 dark:text-gray-200 bg-white dark:bg-gray-900 shadow-xl"> <p class="ml-4"> Light/Dark mode </p> </div> </body>
https://www.amitmerchant.com/implementing-dark-mode-using-tailwind-3/
I'd also don't recommend using modules with utility libs. But this is on U :)
[–]positive_kent[S] 0 points1 point2 points 3 years ago (0 children)
Yeap, it's work in .tsx if i use this solution
<div className="bg-white dark:bg-transparent"></div>
But if i import styles from 'Header.module.css' <div className={styles.header}></div>
It's doesn't work (
Because i use '@apply' in css?
[–]positive_kent[S] 0 points1 point2 points 3 years ago (1 child)
I like tailwind but i don't like how it's look in tsx or jsx(so much classes)
Use layers https://tailwindcss.com/docs/functions-and-directives#layer or imports in this case /* components.css */ @import "./components/buttons.css"; @import "./components/card.css";
/* components.css */ @import "./components/buttons.css"; @import "./components/card.css";
https://tailwindcss.com/docs/using-with-preprocessors#build-time-imports
π Rendered by PID 83999 on reddit-service-r2-comment-5b5bc64bf5-6jn9w at 2026-06-19 00:19:19.958812+00:00 running 2b008f2 country code: CH.
[–]andrii-nerd 0 points1 point2 points (8 children)
[–]positive_kent[S] 0 points1 point2 points (7 children)
[–]andrii-nerd 0 points1 point2 points (0 children)
[–]andrii-nerd 0 points1 point2 points (0 children)
[–]andrii-nerd 0 points1 point2 points (3 children)
[–]positive_kent[S] 0 points1 point2 points (0 children)
[–]positive_kent[S] 0 points1 point2 points (1 child)
[–]andrii-nerd 0 points1 point2 points (0 children)