Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
Chrome ignores `filter: hue-rotate(...)` if argument is `attr(...)`

I have set up a small site where the background color changes as you scroll. I used the following code to set a data-scroll attribute on the html element:

const debounce = (fn) => {
    let frame;

    return (...args) => {
        if (frame)
            cancelAnimationFrame(frame);

        frame = requestAnimationFrame(() => fn(...args));
    };
};

const storeScroll = () => {
    document.documentElement.dataset.scroll = window.scrollY;
};

document.addEventListener('scroll', debounce(storeScroll), { passive: true });

storeScroll();

and the following css to change the background color:

h1 {
    /* Add some height to the page */
    padding-bottom: 10000000px;
}

html {
    background: #f00;
    filter: hue-rotate(attr(data-scroll));
}

Chrome DevTools shows me this, with no information.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!