DEV Community

Discussion on: Inheritance, visited links and colour-contrast

Collapse
 
mpuckett profile image
Michael Puckett

Interesting solution to a very hard problem! I’ve been part way down the path of reacting to dynamic nested backgrounds before, wasted too much time every time. I think we need smarter built-in selectors to be able to do this without jumping through so many hoops. I haven’t tried with shadow DOM encapsulation, though.

Collapse
 
rossangus profile image
Ross Angus

Yup, that makes sense. Anchors are one of the few HTML elements which are opinionated about what colour they are. My solution is a little fragile, especially if the site uses a CMS which vomits extra markup into the page. Built-in support would be better.