5 ms·
That 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 c
by nkohari 3y ago
That 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.