@@ -51,6 +51,12 @@ module.exports = {
51
51
' contextual' : ' contextual' ,
52
52
' no-contextual' : ' no-contextual' ,
53
53
},
54
+ textRendering: { // defaults to these values
55
+ ' rendering-auto' : ' auto' ,
56
+ ' optimize-legibility' : ' optimizeLegibility' ,
57
+ ' optimize-speed' : ' optimizeSpeed' ,
58
+ ' geometric-precision' : ' geometricPrecision'
59
+ },
54
60
textStyles : theme => ({ // defaults to {}
55
61
heading: {
56
62
output: false , // this means there won't be a "heading" component in the CSS, but it can be extended
@@ -143,16 +149,19 @@ module.exports = {
143
149
textShadow: [' responsive' ],
144
150
ellipsis: [' responsive' ],
145
151
hyphens: [' responsive' ],
152
+ kerning: [' responsive' ],
146
153
textUnset: [' responsive' ],
147
154
fontVariantCaps: [' responsive' ],
148
155
fontVariantNumeric: [' responsive' ],
149
156
fontVariantLigatures: [' responsive' ],
157
+ textRendering: [' responsive' ],
150
158
},
151
159
plugins: [
152
160
require (' tailwindcss-typography' )({
153
161
// all these options default to the values specified here
154
162
ellipsis: true , // whether to generate ellipsis utilities
155
163
hyphens: true , // whether to generate hyphenation utilities
164
+ kerning: true , // whether to generate kerning utilities
156
165
textUnset: true , // whether to generate utilities to unset text properties
157
166
componentPrefix: ' c-' , // the prefix to use for text style classes
158
167
}),
@@ -193,6 +202,17 @@ This plugin generates the following utilities:
193
202
hyphens : auto ;
194
203
}
195
204
205
+ /* generated when the "kerning" option is set to true */
206
+ .kerning {
207
+ font-kerning : normal ;
208
+ }
209
+ .kerning-none {
210
+ font-kerning : none ;
211
+ }
212
+ .kerning-auto {
213
+ font-kerning : auto ;
214
+ }
215
+
196
216
/* generated when the "textUnset" option is set to true */
197
217
.font-family-unset {
198
218
font-family : inherit ;
@@ -302,6 +322,20 @@ This plugin generates the following utilities:
302
322
.ligatures-no-contextual {
303
323
font-variant-ligatures : no-contextual ;
304
324
}
325
+
326
+ /* configurable with the "textRendering" theme object */
327
+ .text-rendering-auto {
328
+ text-rendering : auto ;
329
+ }
330
+ .text-optimize-legibility {
331
+ text-rendering : optimizeLegibility ;
332
+ }
333
+ .text-optimize-speed {
334
+ text-rendering : optimizeSpeed ;
335
+ }
336
+ .text-geometric-precision {
337
+ text-rendering : geometricPrecision ;
338
+ }
305
339
```
306
340
307
341
The plugin also generates components for text styles. The above config example would generate something like this:
0 commit comments