I'm wondering if it's necessary to use both the words text and font for Typography, maybe just going w/ text would make things simpler?
We already use text for things like font-size and font-style. It might be a bit easier to just pick one or the other.
If we went with text I believe it would just mean using the word text for font-family and font-weight.
I would change text-{size} to font-{size} as what we really change is the font-size property. Other than that, I think it is nice to have all colors under the same prefix (text-{color}) — in this case we are changing the color property, but using text-white makes more sense than color-white in my opinion.
This is also the one area where I always have to think which one I have to use vs most other keywords I memorized right away. That being said I see at least two counter arguments:
Tailwind is at version 1 now. Breaking changes have to be justified very well.
For this reason I wouldn't change them. Maybe if Tailwind hits version 2.0 it would be good to reconsider :)
font and text are basically different namespaces. Unifying them means possibly more clashes. Example: If a font you use is called like a color you use.
This is the reason we chose to keep them separate. The way to remember them is font- is used for anything that actually loads a different font file (font family and font weight), and text- is for changing something about the text that doesn't load a new font.
I originally had wt- for font weight but Jonathan hated it 🙃. I considered switching to weight- but it's just so long, so we decided to stick with font-.
No plans to unify this because text-light for example could be both a color and a weight in the same project.
Most helpful comment
This is the reason we chose to keep them separate. The way to remember them is
font-is used for anything that actually loads a different font file (font family and font weight), andtext-is for changing something about the text that doesn't load a new font.I originally had
wt-for font weight but Jonathan hated it 🙃. I considered switching toweight-but it's just so long, so we decided to stick withfont-.No plans to unify this because
text-lightfor example could be both a color and a weight in the same project.