tailwindlabs / tailwindcss

A utility-first CSS framework for rapid UI development.
https://tailwindcss.com/
MIT License
83.47k stars 4.22k forks source link

Exclude files from tailwind parsing by plugin #12896

Open benjaminpreiss opened 9 months ago

benjaminpreiss commented 9 months ago

What version of Tailwind CSS are you using?

3.4.1

What build tool (or framework if it abstracts the build tool) are you using?

postcss 8.4.34 svelte 4.2.7, @sveltejs/kit 2.0.0, vite 5.0.3

What version of Node.js are you using?

v18.17.1

What browser are you using?

Brave

What operating system are you using?

macOS

Reproduction URL

https://github.com/frontline-hq/tw-exclude-content

Reproduction steps:

// Install
pnpm i
// run
pnpm run dev

Then visit the app in the browser and check for the file app.css in the network tab. You will see that it includes the tw class bg-blue-900.

Describe your issue

content configurations returned from tailwind plugins are not respected for excluded file globs. D.h. the classes in the file should not be included in the css as specified here

benjaminpreiss commented 9 months ago

https://github.com/tailwindlabs/tailwindcss/discussions/12892

benjaminpreiss commented 9 months ago

The same happens with the safelist property - it is simply overwritten by the array present in the config.

I think it should be possible to extend the safelist from a plugin or a preset.

RajvardhanT7747 commented 2 weeks ago

Hiii can you clarify these issue ?