Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "classes"

Index

Functions

Functions

Const mergeClasses

  • mergeClasses(existing: string, val: any): string
  • Takes a space separated string of existing CSS class names and merges it with val, which is either another string of class names, an object of booleans or an IDeref evaluating to either. Returns updated class string.

    remarks

    If val evaluates to a string, it will be appended to existing.

    If val is an object, its keys are used as class names and their values indicate if the class should be added or removed from the existing set.

    example
    mergeClasses("foo bar", { foo: false, baz: true })
    // "bar baz"
    
    mergeClasses("foo bar", "baz");
    // "baz"

    Parameters

    • existing: string
    • val: any

    Returns string

Generated using TypeDoc