{"id":18814268,"url":"https://github.com/forgepackages/forge-tailwind","last_synced_at":"2025-04-13T21:32:08.318Z","repository":{"id":37049602,"uuid":"504718990","full_name":"forgepackages/forge-tailwind","owner":"forgepackages","description":"Use Tailwind CSS with Django. No npm required.","archived":false,"fork":false,"pushed_at":"2023-06-01T19:04:07.000Z","size":74,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-07T17:20:03.425Z","etag":null,"topics":["django","forge","forgepackages","tailwindcss"],"latest_commit_sha":null,"homepage":"https://www.forgepackages.com/docs/tailwind/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forgepackages.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-18T01:55:02.000Z","updated_at":"2024-01-19T01:40:05.000Z","dependencies_parsed_at":"2023-02-17T01:31:56.104Z","dependency_job_id":null,"html_url":"https://github.com/forgepackages/forge-tailwind","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgepackages%2Fforge-tailwind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgepackages%2Fforge-tailwind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgepackages%2Fforge-tailwind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgepackages%2Fforge-tailwind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forgepackages","download_url":"https://codeload.github.com/forgepackages/forge-tailwind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223607540,"owners_count":17172810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","forge","forgepackages","tailwindcss"],"created_at":"2024-11-07T23:39:58.101Z","updated_at":"2024-11-07T23:39:58.779Z","avatar_url":"https://github.com/forgepackages.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# forge-tailwind\n\nUse [Tailwind CSS](https://tailwindcss.com/) with [Django](https://www.djangoproject.com/) *without* requiring JavaScript or npm.\n\nMade possible by the [Tailwind standalone CLI](https://tailwindcss.com/blog/standalone-cli).\n\n```console\n$ forge tailwind\nUsage: forge tailwind [OPTIONS] COMMAND [ARGS]...\n\n  Tailwind CSS\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  compile  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\nFirst, install `forge-tailwind` from [PyPI](https://pypi.org/project/forge-tailwind/):\n\n```sh\npip install forge-tailwind\n```\n\nCreate a new `tailwind.config.js` file in your project root:\n\n```sh\nforge 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_DIRS = [BASE_DIR / \"static\"]`).\n\nThe `src/tailwind.css` file is then compiled into `dist/tailwind.css` by running `tailwind compile`:\n\n```sh\nforge tailwind compile\n```\n\nWhen you're working locally, add `--watch` to automatically compile as changes are made:\n\n```sh\nforge tailwind compile --watch\n```\n\nThen include the compiled CSS in your base template `\u003chead\u003e`:\n\n```html\n\u003clink rel=\"stylesheet\" href=\"{% static 'dist/tailwind.css' %}\"\u003e\n```\n\nIn your repo you will notice a new `.forge` directory that contains `tailwind` (the standalone CLI binary) and `tailwind.version` (to track the version currently installed).\nYou should add `.forge` to your `.gitignore` file.\n\n## Updating Tailwind\n\nThis package manages the Tailwind versioning by comparing `.forge/tailwind.version` to the `FORGE_TAILWIND_VERSION` variable that is injected into your `tailwind.config.js` file.\n\n```js\nconst FORGE_TAILWIND_VERSION = \"3.0.24\"\n\nmodule.exports = {\n  theme: {\n    extend: {},\n  },\n  plugins: [\n    require(\"@tailwindcss/forms\"),\n  ],\n}\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\ntailwind 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 →](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 `forge tailwind compile --minify` command as a part of your deployment pipeline.\n\nWhen you run `forge tailwind compile`, it will automatically check whether the Tailwind standalone CLI has been installed, and install it if it isn't.\n\nWhen using Forge on Heroku, we do this for you automatically in our [Forge buildpack](https://github.com/forgepackages/heroku-buildpack-forge/blob/master/bin/files/post_compile).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforgepackages%2Fforge-tailwind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforgepackages%2Fforge-tailwind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforgepackages%2Fforge-tailwind/lists"}