Raxol.Core.Animation.Hint (Raxol Core v2.6.0)

Copy Markdown View Source

CSS mapping functions for animation hints.

Provides the canonical CSS property and timing function mappings used by both the main animation framework (Raxol.Animation.Hint) and the LiveView bridge (Raxol.LiveView.TerminalBridge).

This module lives in raxol_core so that raxol_liveview can depend on it without pulling in the full raxol package.

Summary

Functions

Maps a Raxol animation property to a CSS property name.

Maps a Raxol easing atom to a CSS timing function string.

Functions

to_css_property(arg1)

@spec to_css_property(atom()) :: String.t() | nil

Maps a Raxol animation property to a CSS property name.

Returns nil for properties that have no CSS equivalent.

to_css_timing(arg1)

@spec to_css_timing(atom()) :: String.t()

Maps a Raxol easing atom to a CSS timing function string.

All 30+ easing functions are mapped to their cubic-bezier() equivalents. Easing names that cannot be expressed as cubic-bezier (bounce, elastic) fall back to "linear" since CSS cannot natively represent them.