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.
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 anIDeref
evaluating to either. Returns updated class string.If
val
evaluates to a string, it will be appended toexisting
.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.mergeClasses("foo bar", { foo: false, baz: true }) // "bar baz" mergeClasses("foo bar", "baz"); // "baz"