Skip to content
NativeCSS
Docs contents

Animations

helpers/animations.css - small, reusable transitions instead of an animation library.

Fade In/Out & Motion

ClassPurpose
.ncss-animate-fade-in / -fade-outFade in/out
.ncss-animate-slide-in-up/-down/-left/-rightSlide in from a direction
.ncss-animate-scale-inGrow in
.ncss-animate-spinEndless rotation (e.g. loading icon)
.ncss-animate-pulsePulsing opacity
.ncss-animate-shakeError shake
.ncss-skeletonShimmer loading state
<div class="ncss-card ncss-animate-fade-in">
  <div class="ncss-card-body">Fades in when inserted</div>
</div>

<span class="ncss-icon ncss-icon-close ncss-animate-spin"></span>

Micro-interactions & Transitions

.ncss-hover-liftLift on hover
.ncss-hover-growSlight grow on hover
.ncss-pressTactile tap feedback (:active-based, see Touch & Mobile Viewports)
.ncss-transition / -slow / -colors / -transformGeneric transition utilities
<button type="button" class="ncss-btn ncss-btn--primary ncss-hover-lift">Lifts on hover</button>

All respect prefers-reduced-motion automatically.

GPU Compositing Hint

Opt-in, translateZ(0): .ncss-gpu-boost promotes an element onto its own compositor layer - against jank on frequently animated/scrolled elements with expensive repaints. Uses the standalone transform property, combinable with .ncss-hover-lift/-grow/-press (which use translate/scale, not transform) without conflict. Deliberately NOT applied automatically - every additional compositor layer costs graphics memory, use it targeted only where jank is actually visible. For an element that already uses transform itself (e.g. .ncss-hero--parallax), set the --ncss-gpu-hint token directly inside its own transform declaration instead - two transform declarations on the same element would otherwise overwrite rather than combine.