document.body.style.* modifications seem to trigger a rather "lengthy" style recalculation. However, toggling a class on body (document.body.classList.toggle('.grayscale')) with pre-injected styles seems to drastically reduce the style recalculation (28ms vs 0.6ms).
document.body.style.*
modifications seem to trigger a rather "lengthy" style recalculation. However, toggling a class on body (document.body.classList.toggle('.grayscale')
) with pre-injected styles seems to drastically reduce the style recalculation (28ms vs 0.6ms).