Semantic Helpers
What they are
Section titled “What they are”A helper is a class that sets one Level 2 token on a group of components at once. Put it on any container; every matching component inside inherits the value.
.bp-controls--square { --btn-border-radius: 0; --input-border-radius: 0; --datepicker-border-radius: 0; --pagination-border-radius: 0; --checkbox-border-radius: 0;}Helpers use the same contract as your own CSS: public tokens named after the CSS property, set on a scoped selector. No extra token level, no new variables. They live in @layer bp-utilities.
Available helpers
Section titled “Available helpers”| Class | Sets | On |
|---|---|---|
bp-controls--square |
border-radius: 0 |
button, input, datepicker, pagination, checkbox |
bp-controls--pill |
border-radius: var(--bp-radius-full) |
button, input, datepicker, pagination |
bp-surfaces--square |
border-radius: 0 |
card, modal, popover, dropdown, toast, alert, table, accordion, carousel, file-upload, tooltip |
bp-surfaces--flat |
box-shadow: none |
card, modal, popover, dropdown, toast |
Pill controls and square, flat surfaces in one section
<section class="bp-controls--pill bp-surfaces--square bp-surfaces--flat"><article class="bp-card"> <h3 class="bp-card__title">Newsletter</h3> <button class="bp-btn" type="button">Subscribe</button></article></section>Precedence
Section titled “Precedence”Helpers set tokens on the container, so anything closer to the component wins:
- A token on the component itself (
.my-cta { --btn-border-radius: 4px }). - A token or helper on a closer ancestor.
- The helper on the outer container.
- The component default.
Variants (.bp-btn--danger, .bp-badge--success…) don’t block helpers: DS modifiers never write Level 2 tokens, they only change the default of the Level 3 resolver (rule C9).
Your own helper
Section titled “Your own helper”Write one the same way in your CSS — a class that sets public tokens:
.acme-compact { --btn-padding: var(--bp-space-2) var(--bp-space-3); --input-padding: var(--bp-space-2) var(--bp-space-3); --card-padding: var(--bp-space-4);}Use only tokens listed in each component’s Public API table.