Alignment might be one of the more confusing (or misunderstood) parts of CSS. I love having a thorough explanation from someone like Temani Afif who has it mastered.
The thing about contrast-color
Read commentary
One of our favorites, Andy Clarke, on the one thing keeping the CSS contrast-color()
function from true glory:
For my website design, I chose a dark blue background colour (
#212E45
) and light text (#d3d5da
). This colour is off-white to soften the contrast between background and foreground colours, while maintaining a decent level for accessibility considerations.But here’s the thing. The
contrast-color()
function chooses either white for dark backgrounds or black for light ones. At least to my eyes, that contrast is too high and makes reading less comfortable, at least for me.