Skip to content

Commit

Permalink
chore: add tailwind vscode configs [OTE-668] (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogurtandjam authored Aug 7, 2024
1 parent d4b6dd2 commit 2b01ac6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,26 @@
},
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"tailwindCSS.classAttributes": ["tw"],
"tailwindCSS.experimental.classRegex": [
"tw`([^`]*)", // tw`...`
"tw=\"([^\"]*)", // <div tw="..." />
"tw={\"([^\"}]*)", // <div tw={"..."} />
"tw\\.\\w+`([^`]*)", // tw.xxx`...`
"tw\\(.*?\\)`([^`]*)" // tw(Component)`...`
],
"tailwindCSS.emmetCompletions": true,
"emmet.includeLanguages": {
"\"typescript\"": "\"typescriptreact\""
},
"emmet.syntaxProfiles": {
"jsx": {
"markup.attributes": {
"class": "tw",
"class*": "tw"
},
"self_closing_tag": true
}
}
}
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,6 @@ Edit `vercel.json` and configure the `rewrites` configuration option. It is an a

Note: The first matching rule takes precedence over anything defined afterwards in the array.

# VSCode setup

We use twin.macro for tailwind styling shorthands. To get the tailwind VSCode extension to work correctly, add the following to your settings.json:

```
"tailwindCSS.classAttributes": [
"tw"
],
"tailwindCSS.experimental.classRegex": [
"tw`([^`]*)", // tw`...`
"tw=\"([^\"]*)", // <div tw="..." />
"tw={\"([^\"}]*)", // <div tw={"..."} />
"tw\\.\\w+`([^`]*)", // tw.xxx`...`
"tw\\(.*?\\)`([^`]*)" // tw(Component)`...`
]
```

# Testing

## Unit testing
Expand Down

0 comments on commit 2b01ac6

Please sign in to comment.