{"id":28146476,"url":"https://github.com/livebud/tailwind","last_synced_at":"2025-06-19T19:41:11.893Z","repository":{"id":64299537,"uuid":"565057358","full_name":"livebud/tailwind","owner":"livebud","description":"Tailwind.css for the Go ecosystem","archived":false,"fork":false,"pushed_at":"2023-02-11T20:01:55.000Z","size":541,"stargazers_count":58,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-14T23:13:41.219Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/livebud.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-12T07:44:06.000Z","updated_at":"2025-03-14T08:08:25.000Z","dependencies_parsed_at":"2023-01-15T09:15:48.755Z","dependency_job_id":null,"html_url":"https://github.com/livebud/tailwind","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/livebud/tailwind","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livebud%2Ftailwind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livebud%2Ftailwind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livebud%2Ftailwind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livebud%2Ftailwind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livebud","download_url":"https://codeload.github.com/livebud/tailwind/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livebud%2Ftailwind/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260818656,"owners_count":23067746,"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":[],"created_at":"2025-05-14T23:12:37.758Z","updated_at":"2025-06-19T19:41:06.879Z","avatar_url":"https://github.com/livebud.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Tailwind.go\n\nUse Tailwind in Go.\n\nUnlike other options, this package embeds tailwind directly and doesn't spawn a subprocess, so it's faster.\n\n## Example Usage\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/livebud/js\"\n\tv8 \"github.com/livebud/js/v8\"\n\t\"github.com/livebud/tailwind\"\n)\n\nfunc main() {\n\t// Initialize a V8 isolate\n\tvm, _ := v8.Load(\u0026js.Console{\n\t\tLog:   os.Stdout,\n\t\tError: os.Stderr,\n\t})\n\tdefer vm.Close()\n\t// Generate the CSS for this index.html file\n\tprocessor := tailwind.New(vm)\n\tctx := context.Background()\n\tcss, _ := processor.Process(ctx, \"index.html\", `\n\t  \u003chtml\u003e\n\t    \u003chead\u003e\n\t      \u003clink rel=\"stylesheet\" href=\"index.min.css\" /\u003e\n\t    \u003c/head\u003e\n\t    \u003cbody\u003e\n\t      \u003ch1 class=\"bg-[url(/img/grid.svg)] text-sky-500 hover:text-sky-600\"\u003eHello Tailwind!\u003c/h1\u003e\n\t    \u003c/body\u003e\n\t  \u003c/html\u003e\n\t`)\n\tfmt.Println(css)\n}\n```\n\nThis results in a CSS file:\n\n```css\n/*! tailwindcss v3.2.4 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}\n/* ... */\n```\n\nFor production, I recommend building this CSS file and embedding it alongside the processed HTML file. \n\nFor development, you may want to run this processor dynamically. Keep in mind that this processor currently depends on CGO. \n\nI originally built this project for [Bud](https://github.com/livebud/bud), which handles the environment differences for you.\n\n## CLI Usage\n\nWe've also included a rudimentary CLI for quickly testing. If you already have the official CLI installed, stick with that.\n\n```\ngo install github.com/livebud/tailwind/cmd/tailwind@latest\ntailwind example/play.html\n\n```\n\n## Development\n\nYou can install the dependencies with make install:\n\n```sh\nmake install\n```\n\nThis command expects that you have `go` and `npm` in your toolchain. After installing the dependencies, you can run tests with:\n\n```sh\nmake test\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivebud%2Ftailwind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivebud%2Ftailwind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivebud%2Ftailwind/lists"}