loading

CSS properties

Transforms and opacity are the properties that animate cheaply, and most of this library is about them. This page is the other half: Bmotion's typed props reach across the whole style surface - typography, spacing, positioning, clipping and backgrounds - the cssVars bag animates CSS custom properties, and the generic css bag animates anything else by name. These are the ones that trigger layout or paint rather than compositing, so they are worth spending deliberately. Each group below toggles on its own.

Typography

letterSpacing, fontSize and lineHeight interpolate like any length.

letterSpacing
BMOTION
fontSize
Scale me
lineHeight
Motion that reads well breathes between its lines.
Razor

Spacing

gap animates on a flex/grid container; padding grows a box from the inside; margin pushes it within its track.

gap (flex container)
padding
PAD
margin
Razor

Positioning

Animate top, left, right and bottom on a positioned element.

left
top + left
Razor

Clipping & backgrounds

clipPath, backgroundPosition and backgroundSize interpolate their numeric parts frame by frame.

clipPath
backgroundPosition
backgroundSize
Razor

Generic Css escape hatch

The css bag animates any CSS property by name (dash- or camelCase) - the equivalent of motion.dev's animate().

css: word-spacing
the quick fox
css: text-indent
Indented on demand.
Razor

CSS custom properties

cssVars writes CSS custom properties (keys must start with --) on the animated element, where they cascade to everything inside it. That is the lever for the things inline styles cannot reach directly: a value used several times in one declaration, a gradient stop, a pseudo-element. One animated variable below drives a glow, a border and an inner ring at once, and none of those three is addressed by name.

cssVars: --glow
Razor

Accessibility & safety knobs

These are configured once at registration in Program.cs:

  • Reduced motion - AddBitBmotionServices(o => o.ReducedMotion = BmReducedMotionMode.User) respects the OS prefers-reduced-motion everywhere. When reduced, transforms snap while opacity/color still animate.
  • CSS-injection safe mode - o.CssSafeMode = BmCssSafeMode.Throw validates string values before they reach inline style (reject ;, }, javascript:, …). Enable it when binding untrusted input.
  • Capabilities - inject BmotionCapabilities to branch on SupportsFrameLoop (false on Blazor Server, where per-frame features degrade).
Bmotion 0 el · 0 active
An unhandled error has occurred. Reload 🗙