I am currently working on a corporate website and have been tasked with creating a unique design for a specific page. The design includes the following elements:
A body background gradient that transitions from their primary color to white in a top-to-bottom static manner.
All headers (h1, h2, h3, etc.) must be displayed in white text.
My challenge now is finding a way to ensure that header colors complement the overall design, even when they are not positioned at the very top of the page. This is especially important for sub-headers and section titles.
Is there anyone out there who knows a CSS, Javascript, or jQuery solution that would dynamically change the text color of headers based on their position on the page? For instance, having headers display in white at the top of the page to contrast the primary color of the body gradient, but switch to the primary color further down the page to contrast the white background?