Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

timeline-trigger-activation-range — trigger activation range

The timeline-trigger-activation-range shorthand sets the boundaries of the timeline range whose entry activates a trigger. It does not directly determine animation progress.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

timeline-trigger-activation-range: [ <'timeline-trigger-activation-range-start'> <'timeline-trigger-activation-range-end'>? ]#;

timeline-trigger-activation-range sets timeline-trigger-activation-range-start and timeline-trigger-activation-range-end together. Both initially use normal; neither is inherited or animatable.

Its syntax matches animation-range: it accepts normal, lengths, percentages, and named ranges such as entry. Percentages refer to the specified named range or the entire timeline. Commas separate trigger-list items.

Entering the activation range activates the trigger; leaving timeline-trigger-active-range deactivates it. These ranges match by default. This triggers playback rather than mapping animation progress to scrolling.

The example combines scroll(), 25% 75%, and play reset. The specification is a draft; local verification is required, and the Chromium 152 metadata scope does not establish support.

Examples

<!doctype html>
<meta charset="utf-8">
<style>
  .scroller { height: 200px; overflow-y: auto; }
  .track { height: 1000px; }
  .box {
    position: sticky;
    top: 0;
    width: 80px;
    height: 80px;
    background: teal;
    timeline-trigger-name: --reveal;
    timeline-trigger-source: scroll();
    timeline-trigger-activation-range: 25% 75%;
    animation: reveal 1s linear both;
    animation-trigger: --reveal play reset;
  }
  @keyframes reveal {
    from { opacity: 0.2; }
    to { opacity: 1; }
  }
</style>
<div class="scroller"><div class="track"><div class="box"></div></div></div>

Result

Expected with feature support: scrolling from the top to scrollTop = 400 activates --reveal; the box reaches opacity 1 after one second. Scrolling back to scrollTop = 0 resets it to opacity 0.2.

The stated result describes the expected behavior in a browser that supports this feature. Verify the example locally in the browser you are using.

Sources