285 questions
1
vote
1
answer
68
views
Tailwind CSS directives (@tailwind base) underlined as unknown in VS Code with Next.js project
I'm working on a Next.js 16 project and trying to set up Tailwind CSS v4. I installed Tailwind via npm:
npm install -D tailwindcss postcss autoprefixer
I also created the following config files ...
2
votes
1
answer
89
views
Tailwind CSS v4 Vite plugin through npm:vite Can't resolve 'tailwindcss' error
I have trouble on implementing TailwindCSS v4 on Deno. This is my structure:
deno.json
{
"tasks": {
"dev": "deno run -A --watch main.ts",
"vite": &...
0
votes
1
answer
94
views
Using TailwindCSS v4 in Bun SSR - how can I integrate it?
The TailwindCSS website currently doesn't have any guidance related to Bun, so it's difficult for me to figure out how to properly integrate v4 with Bun SSR. I found a bun-plugin-tailwind dependency ...
0
votes
1
answer
26
views
The `max-w-prose` utility works with the value 65ch, but it’s not documented and cannot be disabled even with `--spacing-prose: initial;`
I have a project where I'm trying to remove the previously used @tailwindcss/typography plugin.
I assumed that the max-w-prose utility was tied to the prose utility from that plugin, but after ...
1
vote
1
answer
86
views
Why I Cannot apply unknown utility class `border-border`? CssSyntaxError: tailwindcss [duplicate]
This is my global.css
@import "tailwindcss";
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4....
3
votes
2
answers
218
views
Radix UI's global CSS cannot be overridden with TailwindCSS utilities - only with !important
I'm using ShadCN UI, Radix UI with TailwindCSS v4. I noticed that Tailwind classes don't work unless I add !important. For example:
<section className="bg-gray-100 !px-15 !pt-15 !pb-20 rounded-...
0
votes
1
answer
129
views
How to properly configure Tailwind v4 with @tailwindcss/vite in a monorepo for shared UI components?
I'm working on a Vue 3 monorepo with the following structure:
packages/
└── ui/
├── src/
│ ├── components/
│ │ └── *.vue
│ └── assets/
│ └── tailwind.css
└── ...
0
votes
1
answer
60
views
How to make `@import`-like package references with `@source` for UI package
From TailwindCSS v4, you can manually control automatic source detection using @source. If I now want to map the internal files of a custom UI package so that they are included in the generated CSS, I ...
1
vote
1
answer
154
views
Dark/light mode transition causes custom text colors to flicker after transition ends
I’m building a personal blog with Astro + Tailwind CSS and I successfully implemented a dark/light theme toggle.
After that, I wanted to add smooth transition animations between themes. To avoid ...
1
vote
1
answer
64
views
Placing text over a div with a set opacity background with Tailwind
I have a div with a background image and it's opacity is set to 40%. This is TailwindCSS v4.
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<div class="...
3
votes
1
answer
234
views
Tailwind @container query behavior
I have a local setup of Tailwind v4.1 the below header occupies the whole screen on mobile viewports, with container queries
<div id="app" class="@container">
<div ...
3
votes
1
answer
167
views
Angular not detecting `@use "tailwindcss";` and other changes in `.scss` files
I'm using Angular v20 and Tailwind CSS v4. I have everything set up as per the documentation.
Tailwind works great — for instance, if I define an element's class with a Tailwind utility class, the ...
0
votes
2
answers
152
views
Tailwind functional utilities
In addition to registering simple utilities with the @utility directive, you can also register functional utilities that accept an argument:
CSS
@utility tab-* {
tab-size: --value(--tab-size-*);
}
...
2
votes
1
answer
116
views
How to apply different nth-child styles in Tailwind CSS v4.1 at different breakpoints?
I’m working on a responsive grid layout using Tailwind CSS and want to style grid items differently based on the screen size.
Here’s a simplified example of my code:
<html lang="en">
<head&...
0
votes
0
answers
63
views
Global.CSS issue with TailwindCSS and PostCSS in Turborepo Monorepo
I am new to setting up a monorepo solution as I've only worked with a regular next app in the past. For my current project, I have 2 deliverables and I am trying to share resources and components ...
2
votes
1
answer
184
views
How to use custom Tailwind spacing variables with calc() in utility classes?
I'm trying to use custom spacing variables from my Tailwind theme inside a calc() expression, but it doesn’t seem to work.
In my input.css, I added custom spacing like this:
@theme {
--spacing-my-...
1
vote
1
answer
196
views
How do you overwrite DaisyUI component's style in a CSS file
I would like to overwrite some of DaisyUI components using CSS. For example, I would like to overwrite the .input font-size. Inside my components.css file I put the CSS styles but they are add first ...
1
vote
1
answer
419
views
`@import "tailwindcss";` does not work when used in a file with an `.scss` extension
I wanted to use Tailwind and SCSS on my Nuxt site, but I noticed that the only way to make it work is if the file where I put @import is a CSS file; it doesn't work in an SCSS file.
I don't understand ...
0
votes
1
answer
267
views
How to package a standalone Tailwind v4 component (with tsup) without conflicting with host app styles?
I’m creating a reusable component library with tsup to share common UI elements across my Next.js projects (for example, a Footer).
The Footer works fine in my base app. But when I publish it as an ...
0
votes
1
answer
74
views
Applying a CSS selector to detect the last theme declaration - disable dark theme in specified element
In a TailwindCSS variant - purely out of curiosity, since its usefulness is limited - I want to declare a dark: variant that works inside .dark, but gets overridden when inside a .light parent, and ...
0
votes
1
answer
39
views
How can I reference `@theme` values without using variables, by reusing the value statically?
If I reference variables in CSS in a nested way using the var() CSS function, it cannot properly track changes to the original variable. Is there a way in TailwindCSS to reference a value declared in @...
3
votes
1
answer
320
views
How can I safely introduce the use of `light-dark()` without increasing the minimum browser version requirement?
Using light-dark() would be appealing to me, but it is part of the 2024 baseline and somewhat raises the minimum browser version requirement set by TailwindCSS v4 - which is already high - originally ...
-3
votes
2
answers
2k
views
How to use/install tailwind css in nuxt 4?
I was trying to get tailwindcss to work in my nuxt 4 application. There is no proper documentation for the same. After wasting 4 hours of my life asking chat GPT which did not help I finally got the ...
0
votes
3
answers
301
views
DaisyUI theme not applying, always shows default theme in Laravel + Vite + TailwindCSS
I am working on a Laravel project with Vite, TailwindCSS, and DaisyUI.
I want to apply the "corporate" theme globally, but all DaisyUI components still appear with the default theme styling.
...
1
vote
1
answer
338
views
Tailwind CSS v4 custom classes in plugin not showing IntelliSense in VS Code when building UI library
I'm currently building a custom component library (similar to DaisyUI) using Tailwind CSS v4. I'm defining custom utility classes such as .badge, .badge-success, .badge-error, etc., through a plugin ...