bricks_apply_bem_component
Assign BEM component classes to page elements using a mapping of element IDs to BEM roles. Optionally apply a modifier to the root element.
Instructions
Apply BEM component classes to page elements. Maps element IDs to their BEM roles (_root, title, price, cta, etc.) and assigns the corresponding global classes. Optionally adds a modifier class to the root element.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| block | Yes | BEM block name (must match a previously generated component) | |
| mapping | Yes | Map of Bricks element IDs to BEM element names. Use "_root" for the block element. Example: { "rt0074": "_root", "rt0075": "title", "rt0076": "price" } | |
| page_id | Yes | Page ID containing the elements | |
| modifier | No | Optional modifier to apply to the root element (e.g., "featured", "dark") |