Name | plain.tailwind JSON |
Version |
0.9.0
JSON |
| download |
home_page | None |
Summary | Integrate Tailwind CSS with Plain. |
upload_time | 2025-02-25 23:29:34 |
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.
Made possible by the [Tailwind standalone CLI](https://tailwindcss.com/blog/standalone-cli),
which is installed for you.
```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, create a tailwind.config.js...
update Update the Tailwind CSS version
```
## Installation
Add `plain.tailwind` to your `INSTALLED_PACKAGES`:
```python
# settings.py
INSTALLED_PACKAGES = [
# ...
"plain.tailwind",
]
```
Create a new `tailwind.config.js` file in your project root:
```sh
plain tailwind init
```
This will also create a `tailwind.css` file at `static/src/tailwind.css` where additional CSS can be added.
You can customize where these files are located if you need to,
but this is the default (requires `STATICFILES_DIR = BASE_DIR / "static"`).
The `src/tailwind.css` file is then compiled into `dist/tailwind.css` by running `tailwind build`:
```sh
plain tailwind build
```
When you're working locally, add `--watch` to automatically compile as changes are made:
```sh
plain tailwind build --watch
```
Then include the compiled CSS in your base template `<head>`:
```html
{% tailwind_css %}
```
In your repo you will notice a new `.plain` directory that contains `tailwind` (the standalone CLI binary) and `tailwind.version` (to track the version currently installed).
You should add `.plain` to your `.gitignore` file.
## Updating Tailwind
This package manages the Tailwind versioning by comparing the value in your `pyproject.toml` to `.plain/tailwind.version`.
```toml
# pyproject.toml
[tool.plain.tailwind]
version = "3.4.1"
```
When you run `tailwind compile`,
it will automatically check whether your local installation needs to be updated and will update it if necessary.
You can use the `update` command to update your project to the latest version of Tailwind:
```sh
plain tailwind update
```
## Adding custom CSS
If you need to actually write some CSS,
it should be done in `app/static/src/tailwind.css`.
```css
@tailwind base;
@tailwind components;
/* Add your own "components" here */
.btn {
@apply bg-blue-500 hover:bg-blue-700 text-white;
}
@tailwind utilities;
/* Add your own "utilities" here */
.bg-pattern-stars {
background-image: url("/static/images/stars.png");
}
```
[Read the Tailwind docs for more about using custom styles →](https://tailwindcss.com/docs/adding-custom-styles)
## Deployment
If possible, you should add `static/dist/tailwind.css` to your `.gitignore` and run the `plain tailwind build --minify` command as a part of your deployment pipeline.
When you run `plain tailwind build`, it will automatically check whether the Tailwind standalone CLI has been installed, and install it if it isn't.
When using Plain on Heroku, we do this for you automatically in our [Plain buildpack](https://github.com/plainpackages/heroku-buildpack-plain/blob/master/bin/files/post_compile).
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/7f/714b54a7071f8a7c586eb8a8c3adec27ac1602a0d0ba6b953891daf97574/plain_tailwind-0.9.0.tar.gz",
"platform": null,
"description": "# plain.tailwind\n\nIntegrate Tailwind CSS without JavaScript or npm.\n\nMade possible by the [Tailwind standalone CLI](https://tailwindcss.com/blog/standalone-cli),\nwhich is installed for you.\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, create a tailwind.config.js...\n update Update the Tailwind CSS version\n```\n\n## Installation\n\nAdd `plain.tailwind` to your `INSTALLED_PACKAGES`:\n\n```python\n# settings.py\nINSTALLED_PACKAGES = [\n # ...\n \"plain.tailwind\",\n]\n```\n\nCreate a new `tailwind.config.js` file in your project root:\n\n```sh\nplain tailwind init\n```\n\nThis will also create a `tailwind.css` file at `static/src/tailwind.css` where additional CSS can be added.\nYou can customize where these files are located if you need to,\nbut this is the default (requires `STATICFILES_DIR = BASE_DIR / \"static\"`).\n\nThe `src/tailwind.css` file is then compiled into `dist/tailwind.css` by running `tailwind build`:\n\n```sh\nplain tailwind build\n```\n\nWhen you're working locally, add `--watch` to automatically compile as changes are made:\n\n```sh\nplain tailwind build --watch\n```\n\nThen include the compiled CSS in your base template `<head>`:\n\n```html\n{% tailwind_css %}\n```\n\nIn your repo you will notice a new `.plain` directory that contains `tailwind` (the standalone CLI binary) and `tailwind.version` (to track the version currently installed).\nYou should add `.plain` to your `.gitignore` file.\n\n## Updating Tailwind\n\nThis package manages the Tailwind versioning by comparing the value in your `pyproject.toml` to `.plain/tailwind.version`.\n\n```toml\n# pyproject.toml\n[tool.plain.tailwind]\nversion = \"3.4.1\"\n```\n\nWhen you run `tailwind compile`,\nit will automatically check whether your local installation needs to be updated and will update it if necessary.\n\nYou can use the `update` command to update your project to the latest version of Tailwind:\n\n```sh\nplain tailwind update\n```\n\n## Adding custom CSS\n\nIf you need to actually write some CSS,\nit should be done in `app/static/src/tailwind.css`.\n\n```css\n@tailwind base;\n\n\n@tailwind components;\n\n/* Add your own \"components\" here */\n.btn {\n @apply bg-blue-500 hover:bg-blue-700 text-white;\n}\n\n@tailwind utilities;\n\n/* Add your own \"utilities\" here */\n.bg-pattern-stars {\n background-image: url(\"/static/images/stars.png\");\n}\n\n```\n\n[Read the Tailwind docs for more about using custom styles \u2192](https://tailwindcss.com/docs/adding-custom-styles)\n\n## Deployment\n\nIf possible, you should add `static/dist/tailwind.css` to your `.gitignore` and run the `plain tailwind build --minify` command as a part of your deployment pipeline.\n\nWhen you run `plain tailwind build`, it will automatically check whether the Tailwind standalone CLI has been installed, and install it if it isn't.\n\nWhen using Plain on Heroku, we do this for you automatically in our [Plain buildpack](https://github.com/plainpackages/heroku-buildpack-plain/blob/master/bin/files/post_compile).\n",
"bugtrack_url": null,
"license": null,
"summary": "Integrate Tailwind CSS with Plain.",
"version": "0.9.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "44cd71e7754a064394d209f1a68801b461a2fac6606d24ebec91e66776304b6e",
"md5": "58619b649a4077afffba94a879f34db8",
"sha256": "9e00a91af42e7c00e361a3a96a05bca8c901266c944451cbb00d206c941571bc"
},
"downloads": -1,
"filename": "plain_tailwind-0.9.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "58619b649a4077afffba94a879f34db8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 9348,
"upload_time": "2025-02-25T23:29:33",
"upload_time_iso_8601": "2025-02-25T23:29:33.893167Z",
"url": "https://files.pythonhosted.org/packages/44/cd/71e7754a064394d209f1a68801b461a2fac6606d24ebec91e66776304b6e/plain_tailwind-0.9.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "067f714b54a7071f8a7c586eb8a8c3adec27ac1602a0d0ba6b953891daf97574",
"md5": "02cd8fb73fb1ec1ebbb2ebf0f7a8fc43",
"sha256": "5e0fda9eeb2b3f9e7a958861270f19b62b746b63328eccd79d200f4b2643f0c0"
},
"downloads": -1,
"filename": "plain_tailwind-0.9.0.tar.gz",
"has_sig": false,
"md5_digest": "02cd8fb73fb1ec1ebbb2ebf0f7a8fc43",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 5530,
"upload_time": "2025-02-25T23:29:34",
"upload_time_iso_8601": "2025-02-25T23:29:34.905713Z",
"url": "https://files.pythonhosted.org/packages/06/7f/714b54a7071f8a7c586eb8a8c3adec27ac1602a0d0ba6b953891daf97574/plain_tailwind-0.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-25 23:29:34",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "plain.tailwind"
}