Adds or removes a list of CSS classes to/from the given element.

IMPORTANT: When constructed, it removes all given classes from the element as a form of initialization.


To use with auto-widgets (HTML API) as part of a trigger specification:

  • Action name: "add-class".
  • Accepted string arguments: one or more CSS classes
  • Accepted options: none
<div data-lisn-on-view="@add-class: clsA, clsB"></div>

Implements

Methods

Constructors

Properties

Methods

Constructors

Properties

do: () => Promise<void>

Adds the classes given to the constructor.

toggle: () => Promise<void>

Toggles each class given to the constructor.

undo: () => Promise<void>

Removes the classes given to the constructor.