{"id":13494744,"url":"https://github.com/green-labs/res_tailwindcss","last_synced_at":"2025-04-24T00:24:00.512Z","repository":{"id":38270333,"uuid":"442216161","full_name":"green-labs/res_tailwindcss","owner":"green-labs","description":"ReScript PPX which validates the tailwindcss class names","archived":false,"fork":false,"pushed_at":"2024-10-21T13:13:48.000Z","size":175,"stargazers_count":28,"open_issues_count":6,"forks_count":5,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-30T05:11:24.547Z","etag":null,"topics":["ppx","rescript","tailwindcss"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/green-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-27T16:42:17.000Z","updated_at":"2024-10-21T13:04:58.000Z","dependencies_parsed_at":"2024-08-05T05:47:23.882Z","dependency_job_id":"1e182465-00ae-46f9-b796-3295e04dc01b","html_url":"https://github.com/green-labs/res_tailwindcss","commit_stats":{"total_commits":95,"total_committers":5,"mean_commits":19.0,"dds":0.2421052631578947,"last_synced_commit":"8068d4f64092252ddc57569ac7605bf6a6f09c9c"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Fres_tailwindcss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Fres_tailwindcss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Fres_tailwindcss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-labs%2Fres_tailwindcss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/green-labs","download_url":"https://codeload.github.com/green-labs/res_tailwindcss/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250536538,"owners_count":21446753,"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":["ppx","rescript","tailwindcss"],"created_at":"2024-07-31T19:01:27.733Z","updated_at":"2025-04-24T00:24:00.493Z","avatar_url":"https://github.com/green-labs.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"# ReScript Tailwindcss\n\nA ReScript PPX, which validates the tailwindcss class names\n\n## Motivation\n\nThe [tailwind-ppx](https://github.com/dylanirlbeck/tailwind-ppx) is the only ppx to validate the tailwindcss class names in compile time. But, it was archived, and written by `ocaml-migrate-parsetree`. My team considered taking over the repository and maintaining it but decided to rewrite it from the scratch with `ppxlib` and `menhir`. Additionally, we improve the logic to find the invalid class name with [Spelling Corrector](https://norvig.com/spell-correct.html) algorithm.\n\nPlus, the arbitrary values in the JIT mode of Tailwindcss are supported!\n\n```html\n\u003c!-- arbitrary value examples --\u003e\n\u003cdiv className=%twc(\"p-[75px]\")\u003e ... \u003c/div\u003e\n\u003cdiv className=%twc(\"p-[calc(75px)]\")\u003e ... \u003c/div\u003e\n\u003cdiv className=%twc(\"p-[calc(100%-40px)]\")\u003e ... \u003c/div\u003e\n\u003cdiv className=%twc(\"bg-[#1da1f1]\")\u003e ... \u003c/div\u003e\n\u003cdiv className=%twc(\"grid-cols-[1fr,700px,2fr]\")\u003e ... \u003c/div\u003e\n\u003cdiv className=%twc(\"translate-x-[calc(-50%+27px)]\")\u003e ... \u003c/div\u003e\n\u003cdiv className=%twc(\"!pb-[270px]\")\u003e ... \u003c/div\u003e\n\u003cdiv className=%twc(\"after:content-['Hello_World']\")\u003e ... \u003c/div\u003e\n\u003cdiv className=%twc(\"peer-checked:[\u0026\u003esvg]:rotate-180\")\u003e ... \u003c/div\u003e\n```\n\n## Install\n\n```\nyarn add -D @greenlabs/res-tailwindcss\n```\n\n`\u003cpath_to_tailwindcss\u003e` should be replaced with the relative location of your generated tailwindcss file from your project root in which the `bsconfig.json` file is located.\n\n```\n// bsconfig.json\n\n\"ppx-flags\": [\n  ...,\n  [\"@greenlabs/res-tailwindcss/ppx\", \"--path \u003cpath_to_tailwindcss\u003e\"]\n],\n```\n\n## Example\n\n```rescript\n\u003cinput type_=\"checkbox\" className=%twc(\"peer\") /\u003e\n\u003cdiv className=%twc(\"flex justify-center items-center after:content-['Hello_World'] peer-checked:[\u0026\u003esvg]:rotate-180\")\u003e\n  ...\n  \u003csvg /\u003e\n\u003c/div\u003e\n```\n\n## Development\n\n1. Create a sandbox with opam\n\n```\nopam switch create tailwindcss 4.14.0\n```\n\n2. Install dependencies\n\n```\nopam install . --deps-only --with-test\n```\n\n3. Build\n\n```\nopam exec -- dune build\n```\n\n4. Test\n\n```\ncd rescript\n\n(install dependencies)\nyarn\n\n(build --watch)\nyarn res:clean \u0026\u0026 yarn res:watch\n\n(run test --watch)\nyarn test:watch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-labs%2Fres_tailwindcss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreen-labs%2Fres_tailwindcss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-labs%2Fres_tailwindcss/lists"}