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
Copy file name to clipboardExpand all lines: README.md
+8-208
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
2
-
<h1align='center'>tailwindcss-webpack-plugin</h1>
2
+
<h1align='center'>
3
3
4
4
<palign='center'>
5
5
<sup><em><ahref="https://windicss.org/integrations/vite.html#design-in-devtools">"Design in DevTools"</a> for <ahref="https://tailwindcss.com/">Tailwind CSS</a> ⚡️</em></sup>
That's it! You can now use Tailwind classes with "Design in DevTools" in your app✨
76
-
77
-
For more usage, see [examples](./examples/).
78
-
79
-
80
-
81
-
## Options
82
-
83
-
-**[`config`](#config)**
84
-
-**[`entry`](#entry)**
85
-
-**[`devtools`](#devtools)**
86
-
87
-
88
-
### config
89
-
90
-
* Type:
91
-
92
-
```ts
93
-
TailwindConfig|string|undefined;
94
-
```
95
-
96
-
* Default: `undefined`
97
-
98
-
99
-
Allows you to specify the Tailwind configuration.
100
-
101
-
When the type is `string`, the corresponding value indicates the location of the Tailwind configuration file; by default, `undefined` will look for `tailwind.config.js` in the current working directory.
102
-
103
-
When the type is `TailwindConfig`, no configuration file is read, but the incoming configuration object is used directly.
By default, we will automatically inject the following directive when compile:
131
-
132
-
```
133
-
@tailwind base;
134
-
@tailwind components;
135
-
@tailwind utilities;
136
-
```
137
-
138
-
However, in some cases we may need to customize the `@tailwind` directive, for example, if we want to use the `@layer` directive, or in [Next.js](https://nextjs.org/), because global styles can only be written in `styles/globals.css`, so we also need to customize the tailwind css entry.
139
-
140
-
If entry is specified, in addition to adding our own `@tailwind` directive, we also need to manually import `_tailwind-devtools_.js'` in our code :
141
-
142
-
Take [Next.js](https://nextjs.org/) as an example:
143
-
144
-
```
145
-
// styles/globals.css
146
-
@tailwind base;
147
-
@tailwind components;
148
-
@tailwind utilities;
149
-
150
-
@layer {
151
-
body {
152
-
color: white;
153
-
}
154
-
}
155
-
156
-
// pages/_app.tsx
157
-
import '../styles/globals.css';
158
-
import '_tailwind-devtools_.js';
159
-
import type { AppProps } from 'next/app';
160
-
161
-
function MyApp({ Component, pageProps }: AppProps) {
Allows to customize the host and port of the devtools backend server.
208
-
209
-
> We use the backend server to receive classes change requests from the browser and regenerate the Tailwind utilities, and trigger webpack hot updates.
210
-
211
-
212
-
## PostCSS Usage Issues
213
-
214
-
By default, using `tailwindcss-webpack-plugin` means that there is no need to configure `tailwindcss` in the PostCSS plugins.
215
-
216
-
However, some tools like[Create React App](https://create-react-app.dev/) will automatically add `tailwindcss` to PostCSS plugins if `tailwindcss` is installed under the project, in which case we need to manually remove `tailwindcss` plugin from PostCSS configuration:
217
-
218
-
Take [craco](https://github.com/gsoft-inc/craco) for example:
0 commit comments