Will Change
Utilities for optimizing upcoming animations of elements that are expected to change.
Use , will-change-contents
and will-change-transform
to optimize an element that’s expected to change in the near future by instructing the browser to prepare the necessary animation before it actually begins.
It’s recommended that you apply these utilities just before an element changes, and then remove it shortly after it finishes using will-change-auto
.
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use to only apply the will-change-scroll
utility on hover.
For a complete list of all available state modifiers, check out the documentation.
You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:will-change-scroll
to apply the will-change-scroll
utility at only medium screen sizes and above.
By default, Tailwind provides four utilities. You can customize these values by editing theme.willChange
or theme.extend.willChange
in your tailwind.config.js
file.
tailwind.config.js
Learn more about customizing the default theme in the documentation.
Learn more about arbitrary value support in the documentation.