Breadcrumb
Improve user navigation experience with breadcrumbs
You can create a breadcrumb element with the breadcrumb
class and a single child ul
tag. The dividers are created automatically in the content CSS property of the ::before
pseudo-element of the li
tag.
<nav class="breadcrumb"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Documentation</a></li> <li><a href="#">Navigation</a></li> <li><a href="#">Breadcrumb</a></li> </ul> </nav>
Controls
Active
The is-active
modifier can be used to signify the currently active page.
<nav class="breadcrumb"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Documentation</a></li> <li><a href="#">Navigation</a></li> <li class="is-active">Breadcrumb</li> </ul> </nav>
Disabled
The is-disabled
modifier can be used to grey out an item in the breadcrumb.
<nav class="breadcrumb"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Documentation</a></li> <li><a href="#">Navigation</a></li> <li class="is-disabled">Breadcrumb</li> </ul> </nav>
Alignment
These modifiers are not specific to the Breadcrumb module and can be found within the OrbitCSS global modifiers.
Center alignment
The has-centered
modifier will position all of the items to the center of the breadcrumb list.
<nav class="breadcrumb"> <ul class="has-centered"> <li><a href="#">Home</a></li> <li><a href="#">Documentation</a></li> <li><a href="#">Navigation</a></li> <li><a href="#">Breadcrumb</a></li> </ul> </nav>
Right alignment
The has-end
modifier will align the items from right to left.
<nav class="breadcrumb"> <ul class="has-end"> <li><a href="#">Home</a></li> <li><a href="#">Documentation</a></li> <li><a href="#">Navigation</a></li> <li><a href="#">Breadcrumb</a></li> </ul> </nav>
CSS variables
You can customize the breadcrumb element using the following CSS variables.
.breadcrumb { --font-color: var(--color-link); --separator-color: var(--color-black); --separator-padding: 0 0.625rem; --hover-font-color: var(--color-black); --disabled-font-color: var(--color-muted); --active-font-color: var(--color-black); }
Sass variables
The default styles can be overridden with the following variables. Set one or more of these variables before you import the framework.
Variable | Type | Default value |
---|---|---|
$breadcrumb-color | color | hsl(234deg, 100%, 64%, 1) |
$breadcrumb-disabled-color | color | hsl(0deg, 0%, 73%, 1) |
$breadcrumb-active-color | color | hsl(0deg, 0%, 22%, 1) |
$breadcrumb-hover-color | color | hsl(0deg, 0%, 22%, 1) |
$breadcrumb-separator-color | color | hsl(0deg, 0%, 22%, 1) |
$breadcrumb-separator-padding | padding | 0 0.625rem |
$breadcrumb-separator | string | / |