Home > Enterprise >  Is it possible to use tailwind css in my flask app?
Is it possible to use tailwind css in my flask app?

Time:04-01

Is it possible to use Tailwind CSS in my Flask app without npm or node.js ?

  • If it's possible then can someone guide me how to do it ?
  • Or If not then is there any alternative for it in Flask - Python ?

CodePudding user response:

You can use Tailwind CSS with Flask the same way you use it with any framework (or even for a static website with plain HTML and CSS). But installing it with npm or yarn is the best and cleanest way of doing it, there isn't a lot of configuration required you just need to init your project with node or yarn npm init or yarn init and then follow the steps in the documentation.

Alternativelly if you really don't want to use npm, you can use the "Play CDN" functionality (it will work as well with flask) but this isn't recommended for production, you just need to add this line in your <head> tag

<script src="https://cdn.tailwindcss.com"></script>

CodePudding user response:

I know your question is specifically for tailwind .. and there is an alpha flask-tailwind project but I haven't tinkered with it. There is a robust Flask-Boostrap4 module that is worth a look.

  • Related