ThinkUniform / uniformcss

A fully configurable utility class generator and CSS framework built for Sass projects.
https://uniformcss.com
MIT License
157 stars 5 forks source link

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

Open michaellenaghan opened 2 years ago

michaellenaghan commented 2 years ago

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.)

jinsupark commented 2 years ago

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! 👍