getModuleClass()function
getModuleClass(module: CSSModule | string, ...classes: unknown[]): string | undefined
| Param | Type | |
|---|---|---|
module | CSSModulestring | CSS module object or a string. - Allows "string" because if this environment does not process *.module.css files then import styles from "./styles.module.css" will be a string.- This allows this situation to be handled gracefully and classes will be silently ignored in this environment. required |
classes | unknown[] | Class keys/values to merge. required |
| Return | |
|---|---|
string | undefined | The merged string classname, or undefined when module is a string (unprocessed CSS module). |
Examples
getModuleClass(styles, "base", { active: true }) // "base_x7q active_p2k"