Add Tailwind CSS 4 to HTML using NPM & Tailwind CLI

Learn how to add Tailwind CSS 4 to HTML using NPM & Tailwind CLI. If you use Tailwind CSS CDN it throws warning in the console log: “The browser build of Tailwind CSS should not be used in production. To use Tailwind CSS in production, use the Tailwind CLI, Vite plugin, or PostCSS plugin.”

That is why CDN should only be used for testing purpose, in development environment, or to quickly spin up a tailwind css project. It should not be used in production. Also some advanced and necessary features of tailwind CSS won’t be available if you use it via CDN. For production apps, or for a better working environment use Tailwind CSS CLI or PostCSS plugin.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top