Skip to main content

Function: addCssClassesToRecord()

addCssClassesToRecord(record, classesToAdd, allowOverwrite, filter?): ToggleableClassNameRecord

Defined in: src/sdk/components/FSComponent.ts:992

Adds CSS classes to a ToggleableClassNameRecord.

Parameters​

ParameterTypeDefault valueDescription
recordToggleableClassNameRecordundefinedThe CSS class record to which to add the new classes. The record will be mutated as classes are added.
classesToAddstring | ToggleableClassNameRecord | Iterable<string>undefinedThe CSS classes to add to the record, as a space-delimited class string, an iterable of individual class names, or a ToggleableClassNameRecord.
allowOverwritebooleantrueWhether to allow the new classes to overwrite existing entries in the CSS class record. Defaults to true.
filter?(cssClass) => booleanundefinedA function which filters the classes to add. For each class, the function should return true if the class should be included in the record and false otherwise.

Returns​

ToggleableClassNameRecord

The mutated CSS class record, after the new classes have been added.