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
+49-61Lines changed: 49 additions & 61 deletions
Original file line number
Diff line number
Diff line change
@@ -26,19 +26,11 @@ Install the plugin from npm:
26
26
npm install -D @tailwindcss/typography
27
27
```
28
28
29
-
Then add the plugin to your `tailwind.config.js` file:
29
+
Then add the plugin to your main `style.css` file:
30
30
31
-
```js
32
-
/**@type{import('tailwindcss').Config}*/
33
-
module.exports= {
34
-
theme: {
35
-
// ...
36
-
},
37
-
plugins: [
38
-
require('@tailwindcss/typography'),
39
-
// ...
40
-
],
41
-
}
31
+
```diff
32
+
@import "tailwindcss";
33
+
+ @plugin "tailwindcss/typography";
42
34
```
43
35
44
36
---
@@ -234,7 +226,15 @@ Note that you can't nest new `prose` instances within a `not-prose` block at thi
234
226
235
227
### Adding custom color themes
236
228
237
-
You can create your own color theme by adding a new key in the `typography` section of your `tailwind.config.js` file and providing your colors under the `css` key:
229
+
To customize the color theme beyond simple CSS overrides, you can use the JavaScript based theme API. To do that, use the `@config` directive:
230
+
231
+
```diff
232
+
@import "tailwindcss";
233
+
@plugin "@tailwindcss/typography";
234
+
+ @config "./tailwind.config.js";
235
+
```
236
+
237
+
You can then create your own color theme by adding a new `tailwind.config.js` file with the `typography` section and providing your colors under the `css` key:
@@ -294,18 +290,10 @@ See our internal [style definitions](https://github.com/tailwindlabs/tailwindcss
294
290
295
291
If you need to use a class name other than `prose` for any reason, you can do so using the `className` option when registering the plugin:
296
292
297
-
```js {{ filename: 'tailwind.config.js' }}
298
-
/**@type{import('tailwindcss').Config}*/
299
-
module.exports= {
300
-
theme: {
301
-
// ...
302
-
},
303
-
plugins: [
304
-
require('@tailwindcss/typography')({
305
-
className:'wysiwyg',
306
-
}),
307
-
]
308
-
...
293
+
```css
294
+
@import"tailwindcss";
295
+
@plugin "@tailwindcss/typography" {
296
+
className: wysiwyg;
309
297
}
310
298
```
311
299
@@ -327,7 +315,7 @@ Now every instance of `prose` in the default class names will be replaced by you
327
315
328
316
### Customizing the CSS
329
317
330
-
If you want to customize the raw CSS generated by this plugin, add your overrides under the `typography` key in the `theme` section of your `tailwind.config.js` file:
318
+
If you want to customize the raw CSS generated by this plugin, first follow the steps from [adding custom color themes](#adding-custom-color-themes) to set up a JavaScript based configuration API and then add your overrides under the `typography` key in the `theme` section of your `tailwind.config.js` file:
0 commit comments