uniformcss icon indicating copy to clipboard operation
uniformcss copied to clipboard

Consider not setting `text-rendering` in `reset`

Open michaellenaghan opened this issue 2 years ago • 1 comments

reset sets text-rendering to optimizeSpeed here. I suggest not setting it to anything anywhere.

First, I'm not sure that it really qualifies as a "reset" kind of setting at all; it's not quite the same as different browsers using different font families or font weights or margins for the same element.

Second, even if it does, I'm not sure that optimizeSpeed is the right choice. From Mozilla:

The browser emphasizes rendering speed over legibility and geometric precision when drawing text. It disables kerning and ligatures.

"Disabling kerning and ligatures" isn't, I think, something a reset should do.

The problem is that optimizeLegibility has different trade-offs, and isn't right either; I don't know how things stand today, but there was a time when it had (or could have) a significant impact on the rendering time of text-heavy pages.

If anything, auto is probably the best option. My understanding is that, with auto, browsers make different choices at different font sizes. But auto is the default, so there's no point in setting it to that!

(For what it's worth, Bootstrap doesn't set text-rendering anywhere.)

michaellenaghan avatar Jun 23 '22 15:06 michaellenaghan

I think I agree with text-rendering not being a part of reset. I'm thinking of making text-rendering its own utility. I will include this as part of the next major release 👍, thanks! 👍

jinsupark avatar Jun 27 '22 06:06 jinsupark