Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use TailwindCSS without Node.js and npm?

To use TailwindCSS, I need to have Node.js and npm in order to install it via npm install tailwindcss @tailwindcss/cli.

However, I don't have the option to use Node.js and npm, so I'm looking for a workaround that would allow me to use the Tailwind CLI without having to install Node.js and npm.

I tried loading the tailwindcss.js file available from CDN servers as a module script, but I wasn't successful.

<script type="module">
import tailwindcss from 'https://cdn.skypack.dev/pin/[email protected]/mode=imports/optimized/tailwindcss.js';
</script>

Is it possible to use TailwindCSS without Node.js and npm?

like image 717
Skull Crasher Avatar asked Dec 08 '25 09:12

Skull Crasher


1 Answers

You can use tailwind CDN. Add these following lines to the <head></head> tag of your HTML page

<head>    
    <link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.0.2/tailwind.min.css" rel="stylesheet">
    <script src="https://cdn.tailwindcss.com"></script>
</head>
like image 91
loopassembly Avatar answered Dec 11 '25 22:12

loopassembly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!