Skip to main content

Standalone Tailwind CSS CLI, installable via pip. Use Tailwind CSS without Node.js.

Project description

Standalone Tailwind CSS CLI, installable via pip

Use Tailwind CSS without Node.js and install it via pip.

Why

Tailwind CSS is notoriously dependent on Node.js. If you're a Python developer, this dependency may not be welcome in your team, your Docker container, or your inner circle.

The Tailwind CSS team recently announced a new standalone CLI build that gives you the full power of Tailwind CLI in a self-contained executable — no Node.js or npm required.

However, installing such a standalone CLI isn't as easy as running npm install, the installation command for Node.js .

That's why I decided to make it as simple as running pip install command. As a result you can install the standalone * Tailwind CLI* via pip by running the following command:

pip install pytailwindcss

Now you can run tailwindcss in your terminal as:

tailwindcss -i input.css -o output.css --minify

Voila!

Get started

  1. Install tailwindcss via pip by executing the following command:

    pip install pytailwindcss
    
  2. The tailwindcss command should now be available in your terminal. Try to run it:

    tailwindcss
    

    If the installation was successful, you should see the message about binary being downloaded on the first run. When download is complete, you should see the help output for the tailwindcss command. Use tailwindcss to create a new project or work with an existing Tailwind CSS project.

  3. Let's create a new project. Go to the directory where you want to host your Tailwind CSS project and initialize it by running:

    tailwindcss init
    

    This command will create the default tailwind.config.js file.

  4. Start a watcher by running:

    tailwindcss -i input.css -o output.css --watch
    
  5. Compile and minify your CSS for production by running:

    tailwindcss -i input.css -o output.css --minify
    

You got it. Please refer to official Tailwind documentation for more information on using Tailwind CSS and its CLI.

Caveats

It's not all roses, though. Giving up Node.js means you won't be able to install plugins or additional dependencies for your Tailwind CSS setup. At the same time, that might not be a dealbreaker. You can still customize Tailwind CSS via the tailwind.config.js file. And the standalone build also comes with all official Tailwind CSS plugins like @tailwindcss/aspect-ratio, @tailwindcss/forms, @tailwindcss/line-clamp, and @tailwindcss/typography. So in 90% of Tailwind CSS usage cases you should be covered, and the setup is so simplified now.

Here is what the Tailwind CSS team says about going the standalone Tailwind CSS route:

If you’re working on a project where you don’t otherwise need Node.js or npm, the standalone build can be a great choice. If Tailwind was the only reason you had a package.json file, this is probably going to feel like a nicer solution.

Bugs and suggestions

If you have found a bug, please use the issue tracker on GitHub.

https://github.com/timonweb/pytailwindcss/issues

2021 (c) Tim Kamanin - A Full Stack Django and Wagtail Developer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytailwindcss-0.1.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytailwindcss-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pytailwindcss-0.1.1.tar.gz.

File metadata

  • Download URL: pytailwindcss-0.1.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.7 Darwin/21.1.0

File hashes

Hashes for pytailwindcss-0.1.1.tar.gz
Algorithm Hash digest
SHA256 27e9f2814959108f55ef4a5ad40315e21e8af4e37a733fee08b3a260363c0c4b
MD5 0d944e28dab3d790225d8d2e2f2cb8bf
BLAKE2b-256 9a65f56c08df02deed84885a0b3c9481f8da2a2ee99a7384c00fd425c8052a8f

See more details on using hashes here.

File details

Details for the file pytailwindcss-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pytailwindcss-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.7 Darwin/21.1.0

File hashes

Hashes for pytailwindcss-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b53eedf5cc80c7f33d9874b5527544ea8964920e9717bf16ad566648e07fccb2
MD5 0faada74fa6d0c70aab2db33d3a2cd52
BLAKE2b-256 65cb4e48b5eaf4dbb7889d74613f2d0d6a1df5bc955fa7afac0d99860f32ccba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page