3 ms·
It's the minor inconsistencies that prevented me from using Tailwind on any serious projects. I've never been able to get past their choice to use text-{color}
by sibit 3y ago
It's the minor inconsistencies that prevented me from using Tailwind on any serious projects. I've never been able to get past their choice to use text-{color} instead of font-{color}.
- nkohari 3y agoThat isn't an inconsistency, it's an intentional choice. The color of the text is an aspect of the text, not of the font. The corresponding property in CSS is color, not font-color.
- sibit 3y ago> The corresponding property in CSS is color, not font-color. So why not color-{color}-{shade}?
- nkohari 3y agoBecause text-{color}-{shade} is more descriptive of what the color affects. Again color is not an aspect of the font (which is the typeface plus styling like weight, size, etc.) so naming it font-{color}-{shade} would be technically incorrect. (You can argue that ignoring this technicality would result in a cleaner API, but the comment I was replying to was suggesting it was a mistake, which it isn't.)
- sibit 3y agoOne person's intentional choice is another's inconsistent mistake. I like to think that's what makes software wonderful yet endlessly frustrating.
- arrowsmith 3y agopresumably it's for consistency with other classes like `bg-{color}-{shade}` and `border-{color}-{shade}`.
- corny 3y agoBut "color" doesn't apply to just text. Changing the color of an element affects the currentColor and applies to default border colors. The property name "color" makes more sense than "text-color" imho.