Vanilla Breeze

Effect Compositing

How Vanilla Breeze effects compose naturally via space-separated data-effect values, CSS property separation, and the VB trigger system.

Why compositing matters

Traditional effect systems use one attribute per effect: data-shimmer, data-neon, data-reveal. This creates two problems:

  • No stacking — you can't combine shimmer + gradient-text on the same element.
  • Hardcoded triggers — each effect decides when it activates (scroll, hover, always). You can't change the trigger without changing the effect.

The data-effect system solves both. Effects are space-separated values that compose at the CSS selector level. Triggers are a separate attribute.

How effects compose

Most effects use different CSS properties and compose naturally — the browser applies both without conflict:

EffectPrimary CSS Property
shimmerbackground (clip: text)
neontext-shadow, color
outline-webkit-text-stroke
gradient-textbackground (clip: text)
rainbowfilter (hue-rotate)
bounceanimation (transform)
wiggleanimation (rotate)
sparkle::before / ::after

When two effects target different properties, they compose with zero extra CSS.

Natural composition

Neon uses text-shadow. Rainbow uses filter. Both apply simultaneously:

Designed combinations

When two effects target the same CSS property (like text-shadow), VB ships a compound CSS rule that merges them:

The override hierarchy

Tune composed effects with the standard CSS cascade:

  1. Built-in defaultdata-effect="fade-in"
  2. Class variantclass="slow" sets --vb-duration: 900ms
  3. Inline stylestyle="--vb-duration: 2s"

Trigger independence

An effect doesn't know what triggered it. The same fade-in slide-up effect can be activated by scroll, hover, click, or a timer — the visual result is identical:

Stagger as composition

Parent stagger + child effects = choreographed sequences. The data-stagger attribute sets --vb-stagger-index on each child, cascading the --vb-delay:

Extending with VB.effect()

Register custom effects using the VB API. Custom effects compose with built-in effects automatically:

Extending with VB.trigger()

Register custom triggers that work with any effect:

Related

  • Feel — the small visual + motion details that compose alongside effects (concentric radius, image outlines, shadow-flush, blur-in, and the keyframe-vs-transition rule).