Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

192
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda