getBlockClass()function
getBlockClass(variants: BlockProps): string
| Param | Type | |
|---|---|---|
variants | BlockProps | Colour, space, typography, and width variants. required |
.as | BlockElement | Element this <Block> renders as, e.g. "header" to output a "<header>" Defaults to "div" |
| Return | |
|---|---|
string | A space-separated className string combining the block class and resolved variant classes. |
Get the combined className string for a block from its styling variants.
Composes the base block class and tint ladder with the colour, space, typography, and width variant helpers, so anything that wants block-level styling can apply it.
Examples
getBlockClass({ space: "large" }) // "block tint …"