Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "attribs"

Index

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

Const mergeEmmetAttribs

  • mergeEmmetAttribs(attribs: any, id?: undefined | string, classes?: undefined | string): any
  • Takes an attrib object and optional element ID and CSS class names from Emmet-style hiccup tag, then transforms and merges definitions, returns attribs.

    Parameters

    • attribs: any
    • Optional id: undefined | string
    • Optional classes: undefined | string

    Returns any

Generated using TypeDoc