Leonardo is an open-source contrast-based colour generator to help you create accessible, and adaptive colour systems using contrast-ratio based generated colours.
I’m going to have to re-read this article on CSS containment.
As MDN explains:
contain CSS property allows an author to indicate that an element and its contents are, as much as possible, independent of the rest of the document tree. This allows the browser to recalculate layout, style, paint, size, or any combination of them for a limited area of the DOM and not the entire page, leading to obvious performance benefits.