Progress-based navigation bar, useful for checkouts or registrations.
@mixin progress()
None.
nav.progress>ul>(li.complete*2>a)+(li.active>a)+(li*2>a)
<nav class=" progress">
<ul class="progress__list">
<li class="progress__item">
<a class="progress__link -complete" href="#">
<svg class="progress__icon" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none">
<circle cx="9" cy="19" r="2" />
<circle cx="17" cy="19" r="2" />
<path d="M3 3h2l2 12a3 3 0 0 0 3 2h7a3 3 0 0 0 3 -2l1 -7h-15.2" />
</svg>
Nav Item 1
</a>
</li>
<li class="progress__item">
<a class="progress__link -complete" href="#">
<svg class="progress__icon" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none">
<circle cx="9" cy="19" r="2" />
<circle cx="17" cy="19" r="2" />
<path d="M3 3h2l2 12a3 3 0 0 0 3 2h7a3 3 0 0 0 3 -2l1 -7h-15.2" />
</svg>
Nav Item 2
</a>
</li>
<li class="progress__item">
<a class="progress__link -active" href="#">
<svg class="progress__icon" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none">
<circle cx="9" cy="19" r="2" />
<circle cx="17" cy="19" r="2" />
<path d="M3 3h2l2 12a3 3 0 0 0 3 2h7a3 3 0 0 0 3 -2l1 -7h-15.2" />
</svg>
Nav Item 3
</a>
</li>
<li class="progress__item">
<a class="progress__link" href="#">
<svg class="progress__icon" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none">
<circle cx="9" cy="19" r="2" />
<circle cx="17" cy="19" r="2" />
<path d="M3 3h2l2 12a3 3 0 0 0 3 2h7a3 3 0 0 0 3 -2l1 -7h-15.2" />
</svg>
Nav Item 4
</a>
</li>
</ul>
</nav>
///
/// PROGRESS provides a basic, pill-style progress nav bar like you
/// might find as part of an ecommerce or registration process.
///
@mixin progress() {
&__list {
@include no-bullets;
position: relative;
&::before {
border-left: .5em solid $blue-300;
bottom: 1em;
content: '';
left: .75em;
position: absolute;
top: 1em;
z-index: -1;
}
}
&__item {
margin-bottom: 1em;
}
&__link {
color: $blue-400;
&:hover {
.progress__icon {
transform: scale(1.25);
}
}
&.-active {
font-weight: bold;
.progress__icon {
transform: scale(1.25);
}
}
}
&__icon {
background-color: $blue-300;
border-radius: 2em;
color: $white;
height: 2em;
margin-right: $thin-h-space;
padding: .25em;
transition: transform $fade-easing $fast;
vertical-align: middle;
width: 2em;
}
@include at(md) {
display: flex;
justify-content: center;
&__list {
display: flex;
justify-content: center;
&::before {
display: none;
}
}
&__link {
align-items: center;
display: flex;
flex-flow: column nowrap;
padding: $padding;
position: relative;
&::before {
content: '';
border-top: .5em solid $blue-300;
position: absolute;
left: 0;
right: 0;
top: #{$v-space + .75rem};
z-index: -1;
.progress__item:first-child & {
left: 50%;
}
.progress__item:last-child & {
right: 50%;
}
}
}
&__icon {
margin-right: 0;
margin-bottom: $v-space;
}
}
}
.progress {
@include progress;
}