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 — 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 the standalone CLI isn't as easy as running npm install.
That's why I created this package to make it as simple as running the pip install command. Now you can install the standalone Tailwind CLI via pip by running:
pip install pytailwindcss
Now you can run tailwindcss in your terminal:
tailwindcss -i input.css -o output.css --minify
Voilà!
Get started
-
Install
pytailwindcssviapip:pip install pytailwindcss
-
[Recommended] Preinstall the
tailwindcssbinary:tailwindcss_install
By default, the latest binary version will be downloaded. To pin to a specific Tailwind CSS version, set the
TAILWINDCSS_VERSIONenvironment variable before running the command:# In a Dockerfile ENV TAILWINDCSS_VERSION=v4.1.16 RUN tailwindcss_install # On Linux/macOS export TAILWINDCSS_VERSION=v4.1.16 tailwindcss_install # On Windows (cmd) set TAILWINDCSS_VERSION=v4.1.16 tailwindcss_install # On Windows (PowerShell) $env:TAILWINDCSS_VERSION="v4.1.16" tailwindcss_install
To see a list of available Tailwind CSS releases, visit: https://github.com/tailwindlabs/tailwindcss/releases
If you skip this step, the binary will be downloaded automatically on the first run of the
tailwindcsscommand. -
The
tailwindcsscommand should now be available in your terminal. Try running it:tailwindcss
You should see the help output for the
tailwindcsscommand. If you skipped step 2, the binary will be downloaded automatically on this first run. Usetailwindcssto create a new project or work with an existing Tailwind CSS project. -
Create a new Tailwind CSS project by navigating to your project directory and initializing it:
tailwindcss initThis command creates the default tailwind.config.js file.
-
Start a watcher to compile CSS automatically during development:
tailwindcss -i input.css -o output.css --watch
-
Compile and minify your CSS for production:
tailwindcss -i input.css -o output.css --minify
That's it! For more information on using Tailwind CSS and its CLI, refer to the official Tailwind CSS documentation.
Caveats
While this approach simplifies your setup, there are some trade-offs. Without Node.js, you won't be able to install third-party plugins or additional dependencies for your Tailwind CSS setup. However, this might not be a dealbreaker for most use cases.
You can still customize Tailwind CSS via the tailwind.config.js file, and the standalone build includes all official Tailwind CSS plugins: @tailwindcss/aspect-ratio, @tailwindcss/forms, @tailwindcss/line-clamp, and @tailwindcss/typography. This covers approximately 90% of typical Tailwind CSS usage scenarios.
Here's what the Tailwind CSS team says about the standalone build:
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
Found a bug or have a suggestion? Please use the issue tracker on GitHub:
https://github.com/timonweb/pytailwindcss/issues
2021 - 2025 (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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytailwindcss-0.3.0.tar.gz.
File metadata
- Download URL: pytailwindcss-0.3.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f71dd64020aacb40608dfe8725ca441c772016c344f757ccbc74b8b6143027d
|
|
| MD5 |
e4d3b11de675a2f68456e07d813841a4
|
|
| BLAKE2b-256 |
d790b83df1eae67f3f22c59ca3f6df67d7a2591bb27157f04a173bd1f164d3e0
|
Provenance
The following attestation bundles were made for pytailwindcss-0.3.0.tar.gz:
Publisher:
ci.yml on timonweb/pytailwindcss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytailwindcss-0.3.0.tar.gz -
Subject digest:
1f71dd64020aacb40608dfe8725ca441c772016c344f757ccbc74b8b6143027d - Sigstore transparency entry: 652940733
- Sigstore integration time:
-
Permalink:
timonweb/pytailwindcss@76a37e71bd7200f58898ca63ccbb26e99371a331 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/timonweb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@76a37e71bd7200f58898ca63ccbb26e99371a331 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytailwindcss-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pytailwindcss-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9b770ad3c0a0f40073052bcfe81a060b550fed38af614a472f5aa7bb85fa8aa
|
|
| MD5 |
cce0c88e48f64bfb03d724e3ee3dfb03
|
|
| BLAKE2b-256 |
ca59e7b86790c4558cfa0344c424219fe17d371b70273044b9a2d163ce1d3f44
|
Provenance
The following attestation bundles were made for pytailwindcss-0.3.0-py3-none-any.whl:
Publisher:
ci.yml on timonweb/pytailwindcss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytailwindcss-0.3.0-py3-none-any.whl -
Subject digest:
a9b770ad3c0a0f40073052bcfe81a060b550fed38af614a472f5aa7bb85fa8aa - Sigstore transparency entry: 652940737
- Sigstore integration time:
-
Permalink:
timonweb/pytailwindcss@76a37e71bd7200f58898ca63ccbb26e99371a331 -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/timonweb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@76a37e71bd7200f58898ca63ccbb26e99371a331 -
Trigger Event:
push
-
Statement type: