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
It is recommended to read the documentation of [tailwindcss-patch](https://github.com/sonofmagic/tailwindcss-mangle/tree/main/packages/tailwindcss-patch) first, `unplugin-tailwindcss-mangle` depends on this tool.
// you must set this option to false to enable vite extract css
123
-
experimental: {
124
-
inlineSSRStyles: false
125
-
},
126
-
modules: [
127
-
[
128
-
nuxtPlugin,
129
-
{
130
-
// options
131
-
}
132
-
]
133
-
]
134
-
})
135
-
```
97
+
This plugin only transforms utility class names that contain `-` or `:`, such as `w-32`, `before:h-[300px]`, `after:dark:via-[#0141ff]/40`. Some class names like `flex`, `relative` will not be transformed.
136
98
137
-
## Options
99
+
The plugin **traverses** all `html class` attributes and `js` string literals to find the utility classes generated by `tailwindcss`.
138
100
139
-
[types.ts](src/types.ts)
101
+
Transforming string literals like the following in `js` is dangerous:
140
102
141
-
## Notice
103
+
```js
104
+
constinnerHTML='i\'m flex and relative and grid'
105
+
document.body.innerHTML= innerHTML
106
+
```
142
107
143
-
By default, only the build will take effect. Due to some restrictions, it cannot take effect in the development mode.
108
+
Thus, only strings containing `-` or `:` will be transformed.
144
109
145
-
This plugin only transform those classes which name contain `-` or `:`, like `w-32`, `before:h-[300px]`,`after:dark:via-[#0141ff]/40`. some classes like `flex`,`relative` will not be mangled.
110
+
Additionally, the plugin provides the `twIgnore` option, which allows some strings to be skipped during the `Mangle`.
146
111
147
-
because plugin will **traverse** all `html class attr` and `js StringLiteral` to find `utilities` generated by `tailwindcss`.
112
+
For example:
148
113
149
-
it's dangerous to mangle some `js StringLiteral` like:
0 commit comments