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
* refactor(expose-config): recursively iterating over config
* chore: type definitions and a bugfix
* bugfix: escaping quotes and special characters
* refactor: using templates now
* feat: exports depending on exposeLevel
* chore: set start level to 1
* chore: updated docs and added test
* chore: more docs, and reverting d.ts file
* fix: passing write prop to test setup
Co-authored-by: Sébastien Chopin <[email protected]>
Copy file name to clipboardExpand all lines: docs/content/1.getting-started/2.options.md
+29
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,35 @@ export default {
90
90
91
91
Learn more about it in the [Referencing in the application](/tailwind/config#referencing-in-the-application) section.
92
92
93
+
## `exposeLevel`
94
+
95
+
- Default: `2`
96
+
97
+
If you want to only import *really* specific parts of your tailwind config, you can enable imports for each property in the config:
98
+
99
+
```ts [nuxt.config]
100
+
exportdefault {
101
+
tailwindcss: {
102
+
exposeConfig: true,
103
+
exposeLevel: 3
104
+
}
105
+
}
106
+
```
107
+
108
+
This is only relevant when [`exposeConfig`](/getting-started/options#exposeconfig) is `true`. Using `exposeLevel` to be ≤ 0 will only expose root properties.
109
+
110
+
::alert{type="warning"}
111
+
112
+
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.
113
+
114
+
::
115
+
116
+
::alert{type="info"}
117
+
118
+
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.
0 commit comments