Skip to content

Border

Utilities for controlling the width of an element's borders.

❗ Keep in mind

To establish borders, it's essential to commence class declarations with border.

This action defines a default solid border of 1px rgba(var(--cds-sys-color-stroke), var(--cds-sys-stroke-opacity)) for the element. Subsequently, varying border widths can be implemented by assigning classes as outlined on this page

Class NameCSS Equivalent
.border-0border-width: 0px;
.border-b-0border-block-width: 0px;
.border-i-0border-inline-width: 0px;
.border-bs-0border-block-start-width: 0px;
.border-be-0border-block-end-width: 0px;
.border-is-0border-inline-start-width: 0px;
.border-ie-0border-inline-end-width: 0px;
.border-1border-width: 1px;
.border-b-1border-block-width: 1px;
.border-i-1border-inline-width: 1px;
.border-bs-1border-block-start-width: 1px;
.border-be-1border-block-end-width: 1px;
.border-is-1border-inline-start-width: 1px;
.border-ie-1border-inline-end-width: 1px;
.border-2border-width: 2px;
.border-b-2border-block-width: 2px;
.border-i-2border-inline-width: 2px;
.border-bs-2border-block-start-width: 2px;
.border-be-2border-block-end-width: 2px;
.border-is-2border-inline-start-width: 2px;
.border-ie-2border-inline-end-width: 2px;
.border-3border-width: 3px;
.border-b-3border-block-width: 3px;
.border-i-3border-inline-width: 3px;
.border-bs-3border-block-start-width: 3px;
.border-be-3border-block-end-width: 3px;
.border-is-3border-inline-start-width: 3px;
.border-ie-3border-inline-end-width: 3px;
.border-4border-width: 4px;
.border-b-4border-block-width: 4px;
.border-i-4border-inline-width: 4px;
.border-bs-4border-block-start-width: 4px;
.border-be-4border-block-end-width: 4px;
.border-is-4border-inline-start-width: 4px;
.border-ie-4border-inline-end-width: 4px;
.border-5border-width: 5px;
.border-b-5border-block-width: 5px;
.border-i-5border-inline-width: 5px;
.border-bs-5border-block-start-width: 5px;
.border-be-5border-block-end-width: 5px;
.border-is-5border-inline-start-width: 5px;
.border-ie-5border-inline-end-width: 5px;
.border-6border-width: 6px;
.border-b-6border-block-width: 6px;
.border-i-6border-inline-width: 6px;
.border-bs-6border-block-start-width: 6px;
.border-be-6border-block-end-width: 6px;
.border-is-6border-inline-start-width: 6px;
.border-ie-6border-inline-end-width: 6px;
.border-7border-width: 7px;
.border-b-7border-block-width: 7px;
.border-i-7border-inline-width: 7px;
.border-bs-7border-block-start-width: 7px;
.border-be-7border-block-end-width: 7px;
.border-is-7border-inline-start-width: 7px;
.border-ie-7border-inline-end-width: 7px;
.border-8border-width: 8px;
.border-b-8border-block-width: 8px;
.border-i-8border-inline-width: 8px;
.border-bs-8border-block-start-width: 8px;
.border-be-8border-block-end-width: 8px;
.border-is-8border-inline-start-width: 8px;
.border-ie-8border-inline-end-width: 8px;
.border-9border-width: 9px;
.border-b-9border-block-width: 9px;
.border-i-9border-inline-width: 9px;
.border-bs-9border-block-start-width: 9px;
.border-be-9border-block-end-width: 9px;
.border-is-9border-inline-start-width: 9px;
.border-ie-9border-inline-end-width: 9px;
.border-10border-width: 10px;
.border-b-10border-block-width: 10px;
.border-i-10border-inline-width: 10px;
.border-bs-10border-block-start-width: 10px;
.border-be-10border-block-end-width: 10px;
.border-is-10border-inline-start-width: 10px;
.border-ie-10border-inline-end-width: 10px;
.border-11border-width: 11px;
.border-b-11border-block-width: 11px;
.border-i-11border-inline-width: 11px;
.border-bs-11border-block-start-width: 11px;
.border-be-11border-block-end-width: 11px;
.border-is-11border-inline-start-width: 11px;
.border-ie-11border-inline-end-width: 11px;
.border-12border-width: 12px;
.border-b-12border-block-width: 12px;
.border-i-12border-inline-width: 12px;
.border-bs-12border-block-start-width: 12px;
.border-be-12border-block-end-width: 12px;
.border-is-12border-inline-start-width: 12px;
.border-ie-12border-inline-end-width: 12px;

Setting width on all sides

Use the border, border-{width} utilities to set the border width for all sides of an element.

border-4
border-7
border-10

Setting width on individual sides

Use the border-{i|b}?{e|s}?-{width} utilities to set the border width on the vertical or horizontal sides (based on the text direction) of an element at the same time.

💡 Tip

In our development practices, we aim to avoid the use of physical properties such as top, bottom, right, and left. Instead, we advocate for the use of logical properties: {block|inline}-{end|start}. To enhance your understanding of these logical properties, we recommend visiting the Foundation/Logical Properties page.

Abbriviation
bblock (default vertical axis)
iinline (default horizontal axis)
sstart (top for block, left for inline)
eend (bottom for block, right for inline)

As an illustration, consider using the class border-bs-4 to apply a border-width of 4px on the top side (inline-end) of the element, based on the text direction.

Similarly, the class border-ie-4 will add a border of 4px on the right side (inline-end) of the element, depending on its text direction.

border-i-4
border-ie-7
border-is-10
border-b-4
border-be-8
border-bs-2
border-b-5,border-is-10, border-ie-2
html
<div class="[...] border border-i-4">border-i-4</div>
<div class="[...] border border-ie-7">border-ie-7</div>
<div class="[...] border border-is-10">border-is-10</div>

<div class="[...] border border-b-4">border-b-4</div>
<div class="[...] border border-be-8">border-be-8</div>
<div class="[...] border border-bs-2">border-bs-2</div>

<div class="[...] border border-0 border-b-5 border-is-10 border-ie-2 "> border-b-5,border-is-10, border-ie-2 </div>