by jdauriemma · 9y ago · 0 comments
I urge web developers to consider the trade-offs when using CSS hardware acceleration. Properties like `will-change` or `transform3d` substantially increase the client device's energy usage. This has battery-life implications for users on portable devices such as laptops, tablets, and mobile phones. As with any other feature, ask "why" before "how" when prioritizing interactive motion in your webapp.
More info: https://dev.opera.com/articles/css-will-change-property/
They also made the font blurry on Chrome on Windows prior to DirectWrite (it's moot now, though personally I'll say that I hate the use of DirectAnything for simple font rendering).
*, *::before, *::after
{
transition: none !important;
animation: none !important;
}
(For not-so-capable browsers using author level pseudo-user-style sheets the `star` must have raised specificity, like `:not(#\0)`.)I used this in the past when I wanted to play 2048 as fast as possible, resetting also border-radius, text-shadow, box-shadow, text-rendering, image-rendering and background-image [1]. It really made quite a difference :]
here's what i use instead:
/* forgot if this was needed but i think using !important here broke something */
transition-property: none;
/* maybe not needed */
transition-delay: 0!important;
/* non-zero to support "transitionend" event */
transition-duration: 0.0000001s!important;
/* possible tiny optimization */
transition-timing-function: linear!important;
i don't know if `animation` has events associated with it but i haven't came across any sites breaking without themSide note: perhaps using `..duration: ..ms` in and `transition-timing-function: step-start;` could make some additional micro optimisation.
[1] killed it: https://bugs.chromium.org/p/chromium/issues/detail?id=347016
Other nice to have option would be to just force disable rendering all animation by browser itself.