Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know why, but to me it feels like that will-change property should have been associated to the HTML, not CSS.

    <section class="animatable" will-change='transition'></section>

    section.animatable:active {
     // someanimation
    }
The above makes more sense to me than the following:

    section.animatable {
      will-change: 'transition';
      &.animating {
        // Some animation
      }
    }


I don't understand why people complain about this. It makes perfect sense: when you change your CSS (maybe adding `opacity` to `transform: translate`), you will notice this property and remember to update it. If it stays in your HTML or JS, you (or whoever changes CSS later) won't keep it up-to-date and the optimization hint will be wrong (which can hurt performance).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: