/
_progress.scss
126 lines (109 loc) · 3.09 KB
/
_progress.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// @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;
}
}