Permalink
Fetching contributors…
Cannot retrieve contributors at this time
127 lines (109 sloc) 3.09 KB
// @page Pattern Library/Components
// @name Progress navigation
//
// @description
// The progress navigation should be used for any funnel journeys on the website. Once a section has been completed the user should be able to get back to that step.
// The mobile view of the navigation just has the dotted numbers.
//
// @markup
// <div class="us-progress">
// <nav>
// <ul class="us-progress__nav us-clearfix">
// <li class="us-progress__item">
// <a href="#" class="us-progress__link us-progress__link--complete">
// <span class="us-tablet--inline">Current supplier</span>
// </a>
// </li>
// <li class="us-progress__item">
// <a href="#" class="us-progress__link us-progress__link--complete">
// <span class="us-tablet--inline">Usage</span>
// </a>
// </li>
// <li class="us-progress__item">
// <span class="us-progress__link us-progress__link--current">
// <span class="us-tablet--inline">Results</span>
// </span>
// </li>
// <li class="us-progress__item">
// <span class="us-progress__link us-progress__link--next">
// <span class="us-tablet--inline">New tariff</span>
// </span>
// </li>
// <li class="us-progress__item">
// <span class="us-progress__link us-progress__link--next">
// <span class="us-tablet--inline">Apply</span>
// </span>
// </li>
// </ul>
// </nav>
// </div>
//
$progress-bg-color: $c-navy;
$progress-current-color: #fff;
$progress-complete-color: $c-cyan;
$progress-next-color: tint($c-navy, 50%);
.us-progress {
position: relative;
z-index: 4;
background-color: $progress-bg-color;
}
.us-progress__nav {
@extend %reset-box-model;
list-style: none;
counter-reset: number-counter;
}
.us-progress__item {
@extend %reset-box-model;
position: relative;
float: left;
line-height: 1.5em;
counter-increment: number-counter;
@include respond-to(tablet, true) {
margin-right: $gutter-width;
}
}
.us-progress__link {
position: relative;
display: block;
padding-top: .5em;
padding-bottom: .5em;
@include respond-to(tablet, true) {
padding-top: 1em;
padding-bottom: 1em;
}
&:before {
position: relative;
display: inline-block;
width: 1.5em;
height: 1.5em;
margin-right: $gutter-width/3;
font-weight: 700;
color: $c-navy;
text-align: center;
border-radius: 50%;
content: counter(number-counter);
transition: background-color .3s;
}
}
.us-progress__link--next {
color: $progress-next-color;
&:before {
background-color: $progress-next-color;
}
}
.us-progress__link--current {
color: $progress-current-color;
&:before {
background-color: $progress-current-color;
}
}
.us-progress__link--complete {
@include link-colors($progress-complete-color, #fff, $progress-complete-color, $progress-complete-color, #fff);
&:before {
background-color: $progress-complete-color;
}
&:hover:before,
&:active:before {
background-color: #fff;
}
}