Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "animation"

Index

Interfaces

Functions

Functions

Const animation

  • animation(id: string, opts: Partial<AnimationOpts>, ...keyframes: any): (any[] | ((acc: string[], opts: CSSOpts) => string[]))[]
  • Defines new @keyframes with given id and creates related class of same name to configure given animation opts. Only the duration option is given a default value (250ms), all others are optional.

    example
    css(
      animation(
        "fadein",
        { delay: "0.5s" },
        { opacity: 0 },
        { opacity: 1 }
      )
    );
    @keyframes fadein {
        0% {
            opacity: 0;
        }
        100% {
            opacity: 1;
        }
    }
    
    .fadein {
        animation-duration: 250ms;
        animation-name: fadein;
        animation-delay: 0.5s;
    }

    Parameters

    • id: string

      animation name

    • opts: Partial<AnimationOpts>

      animation config options

    • Rest ...keyframes: any

      keyframes

    Returns (any[] | ((acc: string[], opts: CSSOpts) => string[]))[]

Generated using TypeDoc