Skip to content

Commit

Permalink
docs: append addTwUtil module option
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjans committed Nov 15, 2023
1 parent fc5ef2a commit 3f71d4b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/content/1.getting-started/2.options.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,26 @@ export default defineNuxtConfig({
}
})
```

## `addTwUtil `

- Default: `false`

This options adds the utility function `tw` that will provide intellisense suggestions in Js/Ts strings if the [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) extension is installed. For this to work, you will have to add the following VSCode setting:

```json [settings.json]
{
"tailwindCSS.experimental.classRegex": ["tw`([^`]*)", "tw\\('([^'\\)]*)"],
}
```

Once modified, the new utility function can be used as follows, providing intellisense suggestions when writing Tailwind classes:

```vue [index.vue]
<script setup lang="ts">
const variantClasses = {
primary: tw`bg-red-400`,
secondary: tw('bg-green-400')
}
</script>
```

0 comments on commit 3f71d4b

Please sign in to comment.