Gives the character counters of the text fields and TextEditor their warning states.

Functions

f
charCountClass(
len: number,
max: number
): string

Returns the counter's modifier class for len characters out of max, with a leading space so that it appends to text-editor-count. It warns from 85% of max and turns to danger at max.

Usage

import * as mod from "src/utils/shared/charCount.ts";