You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Learn more about it in the [Referencing in the application](/tailwind/config#referencing-in-the-application) section.
91
93
92
-
## `exposeLevel`
93
-
94
-
- Default: `2`
95
-
96
-
If you want to only import *really* specific parts of your tailwind config, you can enable imports for each property in the config:
97
-
98
-
```ts [nuxt.config]
99
-
exportdefault {
100
-
tailwindcss: {
101
-
exposeConfig: true,
102
-
exposeLevel: 3
103
-
}
104
-
}
105
-
```
106
-
107
-
This is only relevant when [`exposeConfig`](/getting-started/options#exposeconfig) is set to `true`. Setting `exposeLevel` to ≤ 0 will only expose root properties.
108
-
109
-
::alert{type="warning"}
110
-
111
-
It is unlikely for `exposeLevel` to ever be over 4 - the usual depth of a Tailwind config. A higher value is also likely to increase boot-time and disk space in dev. Refer to the [Nuxt Virtual File System](https://nuxt.com/docs/guide/directory-structure/nuxt#virtual-file-system) to see generated files.
112
-
113
-
::
114
-
115
-
::alert{type="info"}
116
-
117
-
Named exports for properties below [root options](https://tailwindcss.com/docs/configuration#configuration-options) are prefixed with `_` (`_colors`, `_900`, `_2xl`) to ensure safe variable names. You can use default imports to provide any identifier or rename named imports using `as`. Properties with unsafe variable names (`spacing['1.5']`, `height['1/2']`, `keyframes.ping['75%, 100%']`) do not get exported individually.
118
-
119
-
::
120
-
121
94
## `injectPosition`
122
95
123
96
- Default: `'first'`
@@ -188,6 +161,7 @@ To disable the viewer during development, set its value to `false`:
@@ -281,19 +280,36 @@ import tailwindConfig from '#tailwind-config'
281
280
282
281
// Import only part which is required to allow tree-shaking
283
282
import { theme } from'#tailwind-config'
283
+
```
284
+
285
+
Please be aware this adds `~19.5KB` (`~3.5KB`) to the client bundle size. If you want to only import _really_ specific parts of your tailwind config, you can enable imports for each property in the config:
286
+
287
+
```js{}[nuxt.config]
288
+
export default {
289
+
tailwindcss: {
290
+
exposeConfig: {
291
+
level: 4,
292
+
alias: '#twcss' // if you want to change alias
293
+
}
294
+
}
295
+
}
296
+
```
284
297
285
-
// Import within properties for further tree-shaking (based on exposeLevel)
import { _neutral } from'#twcss/theme/colors'// named (with _ prefix)
302
+
import { _800asslate800 } from'#twcss/theme/colors/slate'// alias
289
303
```
290
304
291
305
::alert{type="warning"}
292
306
293
-
Please be aware this adds `~19.5KB` (`~3.5KB`) to the client bundle size.
307
+
It is unlikely for `level` to ever be over 4 - the usual depth of a Tailwind config. A higher value is also likely to increase boot-time and disk space in dev. Refer to the [Nuxt Virtual File System](https://nuxt.com/docs/guide/directory-structure/nuxt#virtual-file-system) to see generated files.
294
308
295
309
::
296
310
297
-
::alert
298
-
Import types are only provided through the `#tailwind-config/*` alias.
311
+
::alert{type="info"}
312
+
313
+
Named exports for properties below [root options](https://tailwindcss.com/docs/configuration#configuration-options) are prefixed with `_` (`_colors`, `_900`, `_2xl`) to ensure safe variable names. You can use default imports to provide any identifier or rename named imports using `as`. Properties with unsafe variable names (`spacing['1.5']`, `height['1/2']`, `keyframes.ping['75%, 100%']`) do not get exported individually.
Copy file name to clipboardExpand all lines: docs/content/2.tailwind/2.viewer.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Visualize your Tailwind configuration with the viewer.
4
4
5
5
---
6
6
7
-
Nuxt Tailwind exposes a `/_tailwind/` route in development, allowing you to quickly visualize your Tailwind configuration with easy copy-pasting (thanks to the awesome [tailwind-config-viewer](https://github.com/rogden/tailwind-config-viewer) package ✨).
7
+
By default, the module will expose a `/_tailwind/` route in development, so that you can quickly visualize your Tailwind configuration with easy copy-pasting (thanks to the awesome [tailwind-config-viewer](https://github.com/rogden/tailwind-config-viewer) package ✨).
8
8
9
9
The viewer is available starting from version `v3.4.0` of `@nuxtjs/tailwindcss`.
0 commit comments