# fh_tailwind
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
π Explore the Documentation for more examples and details!
https://fbereilh.github.io/fh_tailwind/
## Key Features
βοΈ Tailwind and DaisyUI Setup π Dynamic Class Extraction π¨ Custom
Themes
## π οΈ Installation
Ensure that Node.js is installed before proceeding. Install the package
using pip:
``` sh
$ pip install fh_tailwind
```
## π Usage
To set up Tailwind in your project, use the following command in the
root of the project to initialize everything:
``` sh
$ fh_tailwind_setup
```
This command will configure Tailwind and DaisyUI in your project,
creating all necessary files and folders (public and node).
## π Example: FastHTML with Tailwind and DaisyUI
To start using the package in your project:
``` python
from fh_tailwind import update_styles
from fasthtml.common import Link, fast_app, serve, Div, P
hdrs = [Link(rel="stylesheet", href="public/styles.css", type="text/css")]
app, rt = fast_app(
live=True, # π΄ Enable live updates
pico=False, # π« Disable PicoCSS to use Tailwind instead
on_startup=[update_styles], # π Run update_styles during startup
hdrs=hdrs,
htmlkw={"data-theme": "mytheme"},
)
@rt("/")
def get():
return Div(cls="flex items-center justify-center h-96")(
P(cls="text-6xl text-center font-bold")(
"Hello, Tailwind and DaisyUI with mytheme is applied!")
)
serve()
```
## π Requirements
- Node.js: This package depends on Node.js for installing and managing
Tailwind CSS and DaisyUI.
- Python 3.x: This script uses Python π to manage files and execute
commands.
## π License
This package is open source under the MIT License.
## π€ Contributions
Contributions are welcome! Feel free to submit a pull request π or
create an issue π if you find a bug or have a feature request.
Happy coding with FastHTML and Tailwind CSS! ππ» For more examples,
detailed instructions, and further customization options, visit our
official documentation.
Raw data
{
"_id": null,
"home_page": "https://github.com/fbereilh/fh_tailwind",
"name": "fh-tailwind",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "nbdev jupyter notebook python",
"author": "Felipe",
"author_email": "fbereilh@thero.com",
"download_url": "https://files.pythonhosted.org/packages/dd/f8/91028c5ff84f9aee27d0a2feab348e7e6c7746a3575fb716902dbb5e77e2/fh_tailwind-0.0.2.tar.gz",
"platform": null,
"description": "# fh_tailwind\n\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n\ud83d\udcd6 Explore the Documentation for more examples and details! \nhttps://fbereilh.github.io/fh_tailwind/\n\n## Key Features\n\n\u2699\ufe0f Tailwind and DaisyUI Setup \ud83d\udd0d Dynamic Class Extraction \ud83c\udfa8 Custom\nThemes\n\n## \ud83d\udee0\ufe0f Installation\n\nEnsure that Node.js is installed before proceeding. Install the package\nusing pip:\n\n``` sh\n$ pip install fh_tailwind\n```\n\n## \ud83d\ude80 Usage\n\nTo set up Tailwind in your project, use the following command in the\nroot of the project to initialize everything:\n\n``` sh\n$ fh_tailwind_setup\n```\n\nThis command will configure Tailwind and DaisyUI in your project,\ncreating all necessary files and folders (public and node).\n\n## \ud83d\udccb Example: FastHTML with Tailwind and DaisyUI\n\nTo start using the package in your project:\n\n``` python\nfrom fh_tailwind import update_styles\nfrom fasthtml.common import Link, fast_app, serve, Div, P\n\nhdrs = [Link(rel=\"stylesheet\", href=\"public/styles.css\", type=\"text/css\")]\napp, rt = fast_app(\n live=True, # \ud83d\udd34 Enable live updates\n pico=False, # \ud83d\udeab Disable PicoCSS to use Tailwind instead\n on_startup=[update_styles], # \ud83d\udd04 Run update_styles during startup\n hdrs=hdrs,\n htmlkw={\"data-theme\": \"mytheme\"},\n)\n\n@rt(\"/\")\ndef get():\n return Div(cls=\"flex items-center justify-center h-96\")(\n P(cls=\"text-6xl text-center font-bold\")(\n \"Hello, Tailwind and DaisyUI with mytheme is applied!\")\n )\n\nserve()\n```\n\n## \ud83d\udccb Requirements\n\n- Node.js: This package depends on Node.js for installing and managing\n Tailwind CSS and DaisyUI.\n\n- Python 3.x: This script uses Python \ud83d\udc0d to manage files and execute\n commands.\n\n## \ud83d\udcdc License\n\nThis package is open source under the MIT License.\n\n## \ud83e\udd1d Contributions\n\nContributions are welcome! Feel free to submit a pull request \ud83d\udd03 or\ncreate an issue \ud83d\udc1e if you find a bug or have a feature request.\n\nHappy coding with FastHTML and Tailwind CSS! \ud83c\udf89\ud83d\udcbb For more examples,\ndetailed instructions, and further customization options, visit our\nofficial documentation.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Tool to use Tailwind CSS and Daisyui\u00a0in your FastHTML projects.",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/fbereilh/fh_tailwind"
},
"split_keywords": [
"nbdev",
"jupyter",
"notebook",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1544173c07a42172899290562ce93d5390fd51783b52175c595f9a4e233f19da",
"md5": "6394e0ac1113445207b39b380f8d11d9",
"sha256": "9f187cc3f3f0f136c230b6d1e8584824cec86bc45cf3b7f73857610a9de18870"
},
"downloads": -1,
"filename": "fh_tailwind-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6394e0ac1113445207b39b380f8d11d9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6323,
"upload_time": "2024-10-15T22:50:54",
"upload_time_iso_8601": "2024-10-15T22:50:54.400861Z",
"url": "https://files.pythonhosted.org/packages/15/44/173c07a42172899290562ce93d5390fd51783b52175c595f9a4e233f19da/fh_tailwind-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ddf891028c5ff84f9aee27d0a2feab348e7e6c7746a3575fb716902dbb5e77e2",
"md5": "6ca19063e72608752c83c45db271e0a5",
"sha256": "5d0127b694f2bb6ad0eecdf99cea0f67ef1e1a06a6f708a16510cc4525c31c26"
},
"downloads": -1,
"filename": "fh_tailwind-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "6ca19063e72608752c83c45db271e0a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 7049,
"upload_time": "2024-10-15T22:50:55",
"upload_time_iso_8601": "2024-10-15T22:50:55.578370Z",
"url": "https://files.pythonhosted.org/packages/dd/f8/91028c5ff84f9aee27d0a2feab348e7e6c7746a3575fb716902dbb5e77e2/fh_tailwind-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-15 22:50:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "fbereilh",
"github_project": "fh_tailwind",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fh-tailwind"
}