Replies: 2 comments 2 replies
-
You seem to have a mix of Tailwind v3 and v4: "devDependencies": {
"@tailwindcss/cli": "^4.1.11",
…
"tailwindcss": "^3.4.3"
}, If you are intending to use v4, then you'd want to look at using CSS-based configuration rather than the legacy JavaScript configuration format: |
Beta Was this translation helpful? Give feedback.
1 reply
-
I am facing a similar type of problem on Next.js. From v3 to v4 tailwind.config.js not producing CSS classes. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What version of Tailwind CSS are you using?
Tailwind CSS v4.1.11
What build tool (or framework if it abstracts the build tool) are you using?
postcss 11.0.1, hugo v0.148.1+extended+withdeploy darwin/arm64 BuildDate=2025-07-11T12:56:21Z VendorInfo=brew
What version of Node.js are you using?
Node v23.5.0
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
A Tailwind Play link or public GitHub repo that includes a minimal reproduction of the bug. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private/confidential, since we want a link to a separate, isolated reproduction anyways.
A reproduction is required when filing an issue — any issue opened without a reproduction will be closed and you'll be asked to create a new issue that includes a reproduction. We're a small team and we can't keep up with the volume of issues we receive if we need to reproduce each issue from scratch ourselves.
Describe your issue
When using Tailwind CSS v4.1.11 with a Hugo static site and the following config:
and running the CLI with:
so i initially created this workaround script in package.json, that worked in generating all the styles in output.css and being applied to site (except dark mode was still not working). I think it was still not reading darkMode setting from tailwind.config.js.
Expected:
Class-based dark mode utilities (e.g., .dark:bg-gray-800) are generated, and toggling the dark class on enables dark mode.
Actual:
Only media-query-based dark utilities are generated (inside @media (prefers-color-scheme: dark) { ... }).
Toggling the dark class has no effect.
Downgrading to Tailwind v3 (e.g., 3.4.3) with the same config and CLI command works perfectly and generates class-based dark utilities.
Steps to Reproduce:
Use the config and CLI command above in a Hugo project.
Inspect the generated CSS for .dark:bg-gray-800 or similar class-based selectors.
Observe that only media-query-based dark utilities are present.
Environment:
Repo/Minimal (package.json):
Notes:
Using the -o flag, absolute config path, and all recommended CLI options does not resolve the issue.
This breaks all class-based dark mode toggling for Hugo and similar static site generators.
Beta Was this translation helpful? Give feedback.
All reactions