The overlap problem with multiple CSS keyframe animations

When several CSS @keyframe animations are attached to the same element, they all run — but only as long as they animate different properties. If two animations touch the same property, the later one wins and the earlier declaration is overridden. One established workaround is to spread the keyframes across nested elements so the competing declarations never share a target.

Additive compositing in the Web Animation API

JavaScript's Web Animation API (WAAPI) supports additive animation through the composite: "add" option. Daniel C. Wilson illustrates the effect with margin-left: moving an item by 20px and by 30px in two animations that share duration and direction yields a total displacement of 50px. (Margins are not the most performant way to move an element; the example is only there to demonstrate length values combining.)

Getting the same behavior without leaving CSS animations behind

CSS itself has no equivalent yet, though the feature is under discussion in the CSS working group. In practice, a single line of JavaScript can make an existing CSS animation additive:

el.getAnimations().forEach(animation => {
  animation.effect.composite = 'add';
});

The pattern resembles indeterminate checkboxes: the state is real, but neither HTML nor CSS offers syntax to express it, so JavaScript has to set it.