Skip to content

Carbon Components Svelte Not Working With TailwindCSS v4 #19559

@SLAN14

Description

@SLAN14

What version of Tailwind CSS are you using? v4.1.17

What build tool (or framework if it abstracts the build tool) are you using? @tailwindcss/vite v4.1.17, Svelte 5.45.6, Vite 7.2.6

What version of Node.js are you using? v20.19.4

What browser are you using? Edge, Chrome

What operating system are you using? Windows

Reproduction URL https://github.com/[SLAN14/Test](https://github.com/SLAN14/Test)

Until TailwindCSS v3, carbon components svelte was seamlessly working with tailwind. But after I migrate to v4, the same code is not compatible anymore and either of the CSS are lost with every permutations.

The piece of code with issue:

	import './layout.css';
	import "carbon-components-svelte/css/white.css";

Post debugging a bit, I could finally narrow down the problem. The issue is when I apply the carbon styles, tailwind's directives are wiped out and to have persistent tailwind styles, I need to force important flag on tailwind config (which is not ideal).

A solution over here would be helpful. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions