-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,41 @@ | ||
# twshim | ||
|
||
twshim is a transparent Go wrapper around the standalone TailwindCSS CLI. | ||
The goal of this project is to unify how developers add TailwindCSS to their Go project by taking care of downloading the executable for the current architecture. | ||
twshim is a transparent Go wrapper around the standalone Tailwind CSS CLI. | ||
The goal of this project is to unify how developers add Tailwind CSS to their Go project by taking care of downloading the executable for the current architecture. | ||
|
||
## Example | ||
|
||
``` | ||
twshim -release v3.2.4 -downloads $HOME/.twshim -- -i in.css -o out.css --minify | ||
``` | ||
|
||
## Configuration | ||
|
||
Because all parameters are passed to the TailwindCSS executable, twshim itself is configured through environment variables. | ||
twshim can be configured through environment variables or command line arguments: | ||
|
||
``` | ||
-downloads string | ||
Target directory for executables (override TWSHIM_DOWNLOADS) | ||
-release string | ||
Tag of the desired release (overrides TWSHIM_RELEASE) | ||
``` | ||
|
||
A double dash (--) is required before the Tailwind CSS parameters to distinguish twshim configuration from Tailwind arguments. | ||
|
||
* `TWTAG` is the tag of the desired TailwindCSS release, e.g. `v3.2.4`. | ||
* `TWROOT` is the directory for downloaded TailwindCSS executables, e.g. `$HOME/.twshim/downloads`. | ||
|
||
twshim uses `runtime.GOOS` and `runtime.GOARCH` to decide which executable to download. | ||
|
||
See https://github.com/tailwindlabs/tailwindcss/releases for a list of Tailwind releases. | ||
|
||
## Usage | ||
|
||
You can use `go run` to invoke twshim if you want to quickly execute a specific version of TailwindCSS CLI. | ||
You can use `go run` to invoke twshim if you want to quickly execute a specific version of Tailwind CSS CLI. | ||
|
||
```shell | ||
TWTAG=v3.2.4 TWROOT=$HOME/.twshim/downloads go run github.com/ngrash/twshim/cmd/twshim@v0.2.0 | ||
go run github.com/ngrash/twshim/cmd/twshim@v0.3.0 -release v3.2.4 -downloads $HOME/.twshim/downloads -- --help | ||
``` | ||
|
||
You can also use `go get` to add twshim to your application and use the `twshim` package from your code. | ||
|
||
```shell | ||
go get github.com/ngrash/twshim@v0.2.0 | ||
go get github.com/ngrash/twshim@v0.3.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters