Projet

Général

Profil

Development #23533 » _circle-steps.scss

Anonyme, 26 juin 2018 16:06

 
1
$custom-steps-container-padding: 0 3em;
2
$custom-step-margin: 25px 0;
3
$custom-step-padding: 0.5ex;
4
$custom-label-margin: 1em;
5
$custom-current-marker-background: #CF0D8A;
6
$custom-current-marker-color: white;
7
$custom-step-current-background: white;
8
$custom-step-mobile-padding: 0 0.6em 1ex 0;
9
$custom-step-marker-margin: 0 auto;
10
$custom-step-marker-color: gray;
11
$custom-step-marker-border: gray;
12
$custom-step-marker-background: transparent;
13

    
14
div#steps {
15
	padding: $custom-steps-container-padding;
16
	ol li {
17
		@include flexbox();
18
		@include flex-direction(column);
19

    
20
		margin: $custom-step-margin;
21
		padding: $custom-step-padding;
22
		position: relative;
23
		border: 0;
24

    
25
		span.marker {
26
			@include justify-content(center);
27
			@include vendor-prefix(align-items, center);
28
			display: inline-flex;
29
			margin: $custom-step-marker-margin;
30
			position: relative;
31
			color: $custom-step-marker-color;
32
			background: $custom-step-marker-background;
33
			border: 1px solid $custom-step-marker-border;
34
			border-radius: 50%;
35
			font-size: calc(12px + 1.2vw);
36
			font-weight: bold;
37
			text-align: center;
38
			vertical-align: middle;
39
			width: 4vw;
40
			height: 4vw;
41
			// flexbug 2 on IE11 (https://github.com/philipwalton/flexbugs#flexbug-2)
42
			max-width: 100%;
43
			max-height: 100%;
44
			box-sizing: border-box;
45

    
46
			&::before {
47
				display: block;
48
				content: ' ';
49
				border-radius: 50%;
50
				position: absolute;
51
				background: $button-background;
52
				z-index: -1;
53
				padding: 6px;
54
			}
55
		}
56

    
57
		span.label {
58
			margin: $custom-label-margin;
59
			text-align: center;
60
			text-transform: uppercase;
61
		}
62

    
63
		&.current {
64
			background: $custom-step-current-background;
65
			font-weight: bold;
66

    
67
			span.label {
68
				color: $title-color;
69
			}
70

    
71
			span.marker {
72
				color: $custom-current-marker-color;
73
				border-color: $custom-current-marker-background;
74
				background: $custom-current-marker-background;
75
			}
76
		}
77
	}
78
}
79
@media screen and (max-width: $mobile-limit) {
80
	div#gauche div#steps {
81

    
82
		@include order(1);
83
		padding: 0;
84

    
85
		ol {
86
			@include flexbox();
87
			@include flex-direction(row);
88
			@include justify-content(center);
89
			@include vendor-prefix(flex-flow, nowrap);
90
			@include vendor-prefix(align-items, center);
91
			// flexbug 2 on IE11 (https://github.com/philipwalton/flexbugs#flexbug-2)
92
			max-width: 100%;
93
			max-height: 100%;
94
			box-sizing: border-box;
95

    
96
			li {
97
				padding: $custom-step-mobile-padding;
98

    
99
				span.marker {
100
					border-radius: 50%;
101
					padding: 0.3em;
102
					width: 4rem; // reset size without vw
103
					height: 4rem;
104
					&::after {
105
						content: ' ';
106
						position: absolute;
107
						height: 1px;
108
						width: 10px;
109
						bottom: 50%;
110
						padding: 0;
111
						left: -10px;
112
					}
113
				}
114
				// hide steps label on little screens
115
				span.label {
116
					display: none;
117
				}
118
			}
119
		}
120
	}
121
}
122

    
123
// with line betwwen circles
124

    
125
div#steps {
126
	ol li {
127
		&.first {
128
			span.marker::after {
129
				display: none;
130
			}
131
		}
132

    
133
		span.marker::after {
134
			content: ' ';
135
			position: absolute;
136
			height: 50%;
137
			width: 1px;
138
			bottom: 100%;
139
			right: 50%;
140
			background-color: $custom-step-marker-color;
141
			padding: 0;
142
		}
143
	}
144
}