Box ModelBox Sizing

Box Sizing

Controls the calculation of the total size of an element.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari
ClassStyle
bs-bbbox-sizing: border-box;
bs-cbbox-sizing: content-box;

Content Box

Initial value

The element's width and height do not include padding and borders.

Content
<div class="d-26 bs-cb p-8">
<div class="ai-c bg-indigo d-f d-full jc-c tc-white">Content</div>
</div>

Border Box

The element's width and height include padding and borders.

Yumma CSS uses the border-box CSS property by default. Learn more about it in the base styles docs.
Box
<div class="d-26 bs-bb p-8">
<div class="ai-c bg-indigo d-f d-full jc-c tc-white">Box</div>
</div>

Using utility variants

Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.

Targeting different viewports

You can combine responsive breakpoints like sm:bs-*, md:bs-*, lg:bs-*, and xxl:bs-* to allow targeting specific utilities in different viewports.

Targeting hover states

Alternatively, you can apply :hover by using h:bs-* utility to override elements and change their values when hovering over them.