getBlockClass()function

getBlockClass(variants: BlockProps): string
ParamType
variantsBlockProps
Colour, space, typography, and width variants. required
    .asBlockElement
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 …"