Name | plain.tailwind JSON |
Version |
0.13.3
JSON |
| download |
home_page | None |
Summary | Integrate Tailwind CSS without JavaScript or npm. |
upload_time | 2025-09-03 21:41:07 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# plain.tailwind
**Integrate Tailwind CSS without JavaScript or npm.**
- [Overview](#overview)
- [Basic Usage](#basic-usage)
- [Commands](#commands)
- [Template Tag](#template-tag)
- [Configuration](#configuration)
- [Updating Tailwind](#updating-tailwind)
- [Adding Custom CSS](#adding-custom-css)
- [Deployment](#deployment)
- [Installation](#installation)
## 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](https://tailwindcss.com/blog/standalone-cli), which is automatically downloaded and managed for you.
First, initialize Tailwind in your project:
```sh
plain tailwind init
```
This creates a `tailwind.config.js` file in your project root and a source CSS file.
Then compile your CSS:
```sh
plain tailwind build
```
For development, use watch mode to automatically recompile when files change:
```sh
plain tailwind build --watch
```
Include the compiled CSS in your templates:
```html
{% tailwind_css %}
```
## Basic Usage
### Commands
The `plain tailwind` command provides several subcommands:
```console
$ 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 files
- `build` - Compiles your Tailwind CSS (use `--watch` for auto-compilation, `--minify` for production)
- `update` - Updates to the latest version of Tailwind CSS
- `install` - Manually install the Tailwind CLI (usually automatic)
### Template Tag
The [`tailwind_css`](./templates.py#TailwindCSSExtension) template tag includes the compiled CSS file in your templates. Place it in your base template's `<head>`:
```html
<!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`:
```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:
```sh
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`):
```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 →](https://tailwindcss.com/docs/adding-custom-styles)
## Deployment
For production deployments:
1. Add `app/assets/tailwind.min.css` to your `.gitignore`
2. Run `plain tailwind build --minify` as part of your deployment process
The build command automatically installs the Tailwind CLI if it's not present, making deployments seamless.
When using Plain on Heroku, the [Plain buildpack](https://github.com/plainpackages/heroku-buildpack-plain/blob/master/bin/files/post_compile) handles this automatically.
## Installation
Install the `plain.tailwind` package from [PyPI](https://pypi.org/project/plain.tailwind/):
```bash
uv add plain.tailwind
```
Then add to your `INSTALLED_PACKAGES`:
```python
# 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/
```
Raw data
{
"_id": null,
"home_page": null,
"name": "plain.tailwind",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Dave Gaeddert <dave.gaeddert@dropseed.dev>",
"download_url": "https://files.pythonhosted.org/packages/06/21/970b90418d0043b3c81ecc5665adf626fb655c884c567068fc631b0a547d/plain_tailwind-0.13.3.tar.gz",
"platform": null,
"description": "# plain.tailwind\n\n**Integrate Tailwind CSS without JavaScript or npm.**\n\n- [Overview](#overview)\n- [Basic Usage](#basic-usage)\n - [Commands](#commands)\n - [Template Tag](#template-tag)\n- [Configuration](#configuration)\n - [Updating Tailwind](#updating-tailwind)\n - [Adding Custom CSS](#adding-custom-css)\n- [Deployment](#deployment)\n- [Installation](#installation)\n\n## Overview\n\nThis package allows you to use Tailwind CSS in your Plain project without requiring Node.js or npm. It uses the [Tailwind standalone CLI](https://tailwindcss.com/blog/standalone-cli), which is automatically downloaded and managed for you.\n\nFirst, initialize Tailwind in your project:\n\n```sh\nplain tailwind init\n```\n\nThis creates a `tailwind.config.js` file in your project root and a source CSS file.\n\nThen compile your CSS:\n\n```sh\nplain tailwind build\n```\n\nFor development, use watch mode to automatically recompile when files change:\n\n```sh\nplain tailwind build --watch\n```\n\nInclude the compiled CSS in your templates:\n\n```html\n{% tailwind_css %}\n```\n\n## Basic Usage\n\n### Commands\n\nThe `plain tailwind` command provides several subcommands:\n\n```console\n$ plain tailwind\nUsage: plain tailwind [OPTIONS] COMMAND [ARGS]...\n\n Tailwind CSS\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n build Compile a Tailwind CSS file\n init Install Tailwind and create tailwind.css\n install Install the Tailwind standalone CLI\n update Update the Tailwind CSS version\n```\n\n- `init` - Sets up Tailwind in your project, creating necessary config files\n- `build` - Compiles your Tailwind CSS (use `--watch` for auto-compilation, `--minify` for production)\n- `update` - Updates to the latest version of Tailwind CSS\n- `install` - Manually install the Tailwind CLI (usually automatic)\n\n### Template Tag\n\nThe [`tailwind_css`](./templates.py#TailwindCSSExtension) template tag includes the compiled CSS file in your templates. Place it in your base template's `<head>`:\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n {% tailwind_css %}\n</head>\n<body>\n <!-- Your content -->\n</body>\n</html>\n```\n\n## Configuration\n\n### Updating Tailwind\n\nThe package tracks the Tailwind version in your `pyproject.toml`:\n\n```toml\n# pyproject.toml\n[tool.plain.tailwind]\nversion = \"3.4.1\"\n```\n\nWhen you run `plain tailwind build`, it automatically checks if your local installation matches this version and updates if needed.\n\nTo update to the latest version:\n\n```sh\nplain tailwind update\n```\n\nThis downloads the latest version and updates your `pyproject.toml`.\n\n### Adding Custom CSS\n\nCustom CSS should be added to your source CSS file (by default at the root of your project as `tailwind.css`):\n\n```css\n@import \"tailwindcss\";\n@import \"./.plain/tailwind.css\";\n\n/* Add your custom styles here */\n.btn-primary {\n @apply bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded;\n}\n\n.custom-gradient {\n background: linear-gradient(to right, #4f46e5, #7c3aed);\n}\n```\n\nThe `@import \"./.plain/tailwind.css\"` line includes styles from all your installed Plain packages.\n\n[Read the Tailwind docs for more about using custom styles \u2192](https://tailwindcss.com/docs/adding-custom-styles)\n\n## Deployment\n\nFor production deployments:\n\n1. Add `app/assets/tailwind.min.css` to your `.gitignore`\n2. Run `plain tailwind build --minify` as part of your deployment process\n\nThe build command automatically installs the Tailwind CLI if it's not present, making deployments seamless.\n\nWhen using Plain on Heroku, the [Plain buildpack](https://github.com/plainpackages/heroku-buildpack-plain/blob/master/bin/files/post_compile) handles this automatically.\n\n## Installation\n\nInstall the `plain.tailwind` package from [PyPI](https://pypi.org/project/plain.tailwind/):\n\n```bash\nuv add plain.tailwind\n```\n\nThen add to your `INSTALLED_PACKAGES`:\n\n```python\n# settings.py\nINSTALLED_PACKAGES = [\n # ...\n \"plain.tailwind\",\n]\n```\n\nThe package stores the Tailwind CLI binary and version information in a `.plain` directory. Add this to your `.gitignore`:\n\n```\n.plain/\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Integrate Tailwind CSS without JavaScript or npm.",
"version": "0.13.3",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ee9562bda02f2fedb06bc5bca740cf115894e4fcde76bda6eacfaa234d63b1d6",
"md5": "cb5a406b1c5b43d73bee368880d432fa",
"sha256": "2b06fe55bb553ed0cb0d7eaf8fade462e014f0b8f574357128380b977a3a1557"
},
"downloads": -1,
"filename": "plain_tailwind-0.13.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cb5a406b1c5b43d73bee368880d432fa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 11262,
"upload_time": "2025-09-03T21:41:06",
"upload_time_iso_8601": "2025-09-03T21:41:06.983369Z",
"url": "https://files.pythonhosted.org/packages/ee/95/62bda02f2fedb06bc5bca740cf115894e4fcde76bda6eacfaa234d63b1d6/plain_tailwind-0.13.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0621970b90418d0043b3c81ecc5665adf626fb655c884c567068fc631b0a547d",
"md5": "16904f9a05010b9c0d6c03745a55e25c",
"sha256": "56c45c06e7ffa501dbffcc6d30427b7c91fcce1a19eeb042d495186278d6c565"
},
"downloads": -1,
"filename": "plain_tailwind-0.13.3.tar.gz",
"has_sig": false,
"md5_digest": "16904f9a05010b9c0d6c03745a55e25c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 6614,
"upload_time": "2025-09-03T21:41:07",
"upload_time_iso_8601": "2025-09-03T21:41:07.811419Z",
"url": "https://files.pythonhosted.org/packages/06/21/970b90418d0043b3c81ecc5665adf626fb655c884c567068fc631b0a547d/plain_tailwind-0.13.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-03 21:41:07",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "plain.tailwind"
}