This used to be so much more of a pain before Sass (and friends) came along. Having a red error box with a separate border colour used to be a pain to maintain but it's so simple with darken/lighten and a few commonly used context-specific variables.
Do you have any resources or examples you recommend for this? My front-end knowledge is over a decade old. I would still be assigning all these colours individually in CSS!