plain.tailwind
Integrate Tailwind CSS without JavaScript or npm.
Overview
This package allows you to use Tailwind CSS in your Plain project without requiring Node.js or npm. It uses the Tailwind standalone CLI, which is automatically downloaded and managed for you.
First, initialize Tailwind in your project:
plain tailwind init
This creates a tailwind.config.js file in your project root and a source CSS file.
Then compile your CSS:
plain tailwind build
For development, use watch mode to automatically recompile when files change:
plain tailwind build --watch
Include the compiled CSS in your templates:
{% tailwind_css %}
Basic Usage
Commands
The plain tailwind command provides several subcommands:
$ plain tailwind
Usage: plain tailwind [OPTIONS] COMMAND [ARGS]...
Tailwind CSS
Options:
--help Show this message and exit.
Commands:
build Compile a Tailwind CSS file
init Install Tailwind and create tailwind.css
install Install the Tailwind standalone CLI
update Update the Tailwind CSS version
init- Sets up Tailwind in your project, creating necessary config filesbuild- Compiles your Tailwind CSS (use--watchfor auto-compilation,--minifyfor production)update- Updates to the latest version of Tailwind CSSinstall- Manually install the Tailwind CLI (usually automatic)
Template Tag
The tailwind_css template tag includes the compiled CSS file in your templates. Place it in your base template's <head>:
<!DOCTYPE html>
<html>
<head>
{% tailwind_css %}
</head>
<body>
<!-- Your content -->
</body>
</html>
Configuration
Updating Tailwind
The package tracks the Tailwind version in your pyproject.toml:
# pyproject.toml
[tool.plain.tailwind]
version = "3.4.1"
When you run plain tailwind build, it automatically checks if your local installation matches this version and updates if needed.
To update to the latest version:
plain tailwind update
This downloads the latest version and updates your pyproject.toml.
Adding Custom CSS
Custom CSS should be added to your source CSS file (by default at the root of your project as tailwind.css):
@import "tailwindcss";
@import "./.plain/tailwind.css";
/* Add your custom styles here */
.btn-primary {
@apply bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded;
}
.custom-gradient {
background: linear-gradient(to right, #4f46e5, #7c3aed);
}
The @import "./.plain/tailwind.css" line includes styles from all your installed Plain packages.
Read the Tailwind docs for more about using custom styles →
Deployment
For production deployments:
- Add
app/assets/tailwind.min.cssto your.gitignore - Run
plain tailwind build --minifyas part of your deployment process
The build command automatically installs the Tailwind CLI if it's not present, making deployments seamless.
Installation
Install the plain.tailwind package from PyPI:
uv add plain.tailwind
Then add to your INSTALLED_PACKAGES:
# settings.py
INSTALLED_PACKAGES = [
# ...
"plain.tailwind",
]
The package stores the Tailwind CLI binary and version information in a .plain directory. Add this to your .gitignore:
.plain/
Metadata
Release files for plain.tailwind 0.17.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plain_tailwind-0.17.0.tar.gz | 7.6 kB | Without provenance | Details for plain_tailwind-0.17.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plain_tailwind-0.17.0-py3-none-any.whl | Python 3 | none | any | Details for plain_tailwind-0.17.0-py3-none-any.whl |
Total release size: 19.8 kB
Release files / plain_tailwind-0.17.0.tar.gz
| Download URL | plain_tailwind-0.17.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5796d9828df53fd458c7161045f6cd9b988d7de10046404c3c592e3a6d16f61c
|
|
BLAKE2b-256 checksum How to use checksums |
826d47b88cb5bf7697b4716bad63a49ac6fc123a9fda493c165a35aa26190406
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / plain_tailwind-0.17.0-py3-none-any.whl
| Download URL | plain_tailwind-0.17.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
138bfd450507a3fa892be4a83c66ac04192306c432f272fc95df95d1a6394c93
|
|
BLAKE2b-256 checksum How to use checksums |
dbb37ae18e726bdaaf7ca3224affd8b9520f7f3c9181e530bf36669187e42b18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for plain.tailwind 0.17.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.