5 ms·
> The corresponding property in CSS is color, not font-color. So why not color-{color}-{shade}?
by 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}`.