Skip to content

Commit

Permalink
Add TailwindCSS auto-complete instructions to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
markuswustenberg committed Oct 28, 2024
1 parent 3aaedd0 commit f613485
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/cover.out
/node_modules/
/package.json
/public/styles/app.css
/tailwindcss
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ tailwindcss:
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-$(TAILWINDCSS_OS_ARCH)
mv tailwindcss-$(TAILWINDCSS_OS_ARCH) tailwindcss
chmod +x tailwindcss
mkdir -p node_modules/tailwindcss/lib && ln -s tailwindcss node_modules/tailwindcss/lib/cli.js
echo '{"devDependencies": {"tailwindcss": "latest"}}' >package.json

.PHONY: test
test:
Expand Down
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,53 @@ You can run tests and linting with:
make test lint
```

### Enabling TailwindCSS auto-complete in your IDE

[TailwindCSS has auto-complete of classnames (and more) through IDE plugins](https://tailwindcss.com/docs/editor-setup).

After you've installed the TailwindCSS plugin for your IDE, it needs some configuration to work with gomponents. Here's the config for VS Code and JetBrains IDEs:

<details>
<summary>VSCode</summary>

Edit `vscode-settings.json` and add the following:

```json
{
"tailwindCSS.includeLanguages": {
"go": "html",
},
"tailwindCSS.experimental.classRegex": [
["Class(?:es)?[({]([^)}]*)[)}]", "[\"`]([^\"`]*)[\"`]"]
],
}
```

[See the official plugin page for more info](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)
</details>

<details>
<summary>JetBrains/GoLand</summary>

Go to `Settings` -> `Languages & Frameworks` -> `Style Sheets` -> `Tailwind CSS` and add the following (don't delete the other config):

Add this item to the `includeLanguages` array field:
```json
{
"includeLanguages": {
"go": "html"
},
"experimental": {
"classRegex": [
["Class(?:es)?[({]([^)}]*)[)}]", "[\"`]([^\"`]*)[\"`]"]
]
}
}
```

[See the official plugin page for more info](https://plugins.jetbrains.com/plugin/15321-tailwind-css)
</details>

## Deploying

The [CD workflow](.github/workflows/cd.yml) automatically builds a multi-platform Docker image and pushes it to the Github container registry GHCR.io, tagged with the commit hash as well as `latest`.
Expand Down

0 comments on commit f613485

Please sign in to comment.