Skip to content

hookenz/gotailwind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoTailwind latest version

A go tool plugin for the excellent TailwindCSS cli.

About

I created this tool to make it easier to use TailwindCSS within go projects such as with those using the go templ template engine or html/template etc.

It downloads the TailwindCSS cli standalone binary automatically on first use. Subsequent invocations will use the cached copy. Nodejs is not required.

Prerequisites

Go 1.24+. You must upgrade to go 1.24 or newer before using this tool.

Please verify with go version that the version you have is at least 1.24 or it won't work.

Usage

To install the latest version of TailwindCSS v4 into an existing go project:

go get -tool github.com/hookenz/gotailwind/v4@latest

Or a specific version of TailwindCSS:

go get -tool github.com/hookenz/gotailwind/v4@v4.3.0

To run it:

go tool gotailwind

Demo

demo

How does it work?

GoTailwind is a thin go wrapper around the standalone TailwindCSS cli. It's just a go program that calls the appropriate TailwindCSS binary that is downloaded and cached into a local cache folder.

The GoTailwind version matches the TailwindCSS cli version.

It works wherever go and tailwindcss can run.

In linux the TailwindCSS cli binary is placed into a versioned directory beneath:

~/.cache/gotailwind/

i.e.

~/.cache/gotailwind/v4.1.7/tailwindcss-linux-x64

Which means you can have different projects targetting different versions of TailwindCSS.

Contributing

Suggestions or improvements are more than welcome.

About

A go tool plugin for tailwindcss

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages