Box Sizing
Controls the calculation of the total size of an element.
Class | Properties |
---|---|
bs-bb | box-sizing: border-box; |
bs-cb | box-sizing: content-box; |
Border Box
This example sets the box sizing to border-box. The element’s width and height include padding and borders.
<div class="stripes dim-26 b-2 bc-indigo bs-bb p-8"> <div class="ai-c bg-indigo d-f dim-full jc-c tc-white">Box</div></div>
Content Box
This example sets the box sizing to content-box. The element’s width and height do not include padding and borders.
<div class="stripes dim-26 b-2 bc-indigo bs-cb p-8"> <div class="ai-c bg-indigo d-f dim-full jc-c tc-white">Content</div></div>
Utilizing utilities conditionally
Override existing utilities based on the user's screen size or other factors, such as hover states. Learn more about modifiers in our documentation.
Responsive breakpoints
You can combine responsive breakpoints like sm:bs-*
,md:bs-*
, lg:bs-*
, and xxl:bs-*
allows targeting specific utilities in
different viewports.
<div class="bs-cb md:bs-bb ..."></div>
Utilizing utilities conditionally
Override existing utilities based on the user's screen size or other factors, such as hover states. Learn more about modifiers in our documentation.
Hover states
Alternatively, you can apply :hover
by using h:bs-*
utility to override elements
and change their values when hovering over them.
<div class="bs-cb h:bs-bb ..."></div>