|
1 |
/*
|
|
2 |
* WCS Steps
|
|
3 |
*
|
|
4 |
* Affiche les étapes/pages d'un formulaire
|
|
5 |
*
|
|
6 |
* Template : wcs/front/formdata_steps.html
|
|
7 |
*
|
|
8 |
* $form-sidebar-position define Steps orientation
|
|
9 |
*
|
|
10 |
*/
|
|
11 |
|
|
12 |
|
|
13 |
//
|
|
14 |
// Config
|
|
15 |
//
|
|
16 |
|
|
17 |
// Steps Bloc
|
|
18 |
$wcs-steps-background: transparent !default;
|
|
19 |
$wcs-steps-spacing: 0.35rem !default; // half of default 0.7rem used in publik
|
|
20 |
|
|
21 |
// Step
|
|
22 |
$wcs-step-color: #868686 !default; // color for default marker & label
|
|
23 |
$wcs-step-current-color: $primary-color !default;
|
|
24 |
$wcs-step-background: transparent !default;
|
|
25 |
$wcs-step-current-background: $wcs-step-background !default;
|
|
26 |
$wcs-step-border-bottom: 1px solid $wcs-step-color !default;
|
|
27 |
$wcs-step-current-border-bottom: 3px solid $wcs-step-current-color !default;
|
|
28 |
@if ($wcs-step-border-bottom == none) {
|
|
29 |
$wcs-step-current-border-bottom: none;
|
|
30 |
}
|
|
31 |
// Step option
|
|
32 |
$wsc-step-before-piled: false !default;
|
|
33 |
|
|
34 |
// marker
|
|
35 |
$wcs-step-marker-color: $wcs-step-color !default;
|
|
36 |
$wcs-step-current-marker-color: $wcs-step-current-color !default;
|
|
37 |
$wcs-step-marker-background: $wcs-step-background !default;
|
|
38 |
$wcs-step-current-marker-background: $wcs-step-current-background !default;
|
|
39 |
// marker options
|
|
40 |
$wcs-step-marker-size: 2.1em !default;
|
|
41 |
$wcs-step-current-marker-enlarge: 1 !default;
|
|
42 |
$wcs-step-marker-type: square !default; // square || tied || disc || disc tied
|
|
43 |
$wcs-step-marker-tie-color: $wcs-step-color !default;
|
|
44 |
$wcs-step-marker-tie-width: 5px !default;
|
|
45 |
$wcs-step-marker-background-type: solid !default;
|
|
46 |
|
|
47 |
// Label
|
|
48 |
$wcs-step-current-label-color: $wcs-step-current-color !default;
|
|
49 |
|
|
50 |
// Breakpoints between small & horizontal layout
|
|
51 |
$bq-max--wcs-steps-small-layout: $very-small-limit !default;
|
|
52 |
|
|
53 |
// UTILS for custom code
|
|
54 |
// media queries between small & horizontal layout
|
|
55 |
$mq-max--wcs-steps-small-layout: "max-width: #{$bq-max--wcs-steps-small-layout}";
|
|
56 |
$mq-min--wcs-steps-horizontal-layout: "min-width: #{$bq-max--wcs-steps-small-layout+1}";
|
|
57 |
// Desktop Steps orientation sass mixins
|
|
58 |
// Steps orientations depend on media-queries & $form-sidebar-position
|
|
59 |
@mixin desktop-horizontal-steps() {
|
|
60 |
@if ($form-sidebar-position == top) {
|
|
61 |
@media (min-width: $mobile-limit + 1) {
|
|
62 |
@content;
|
|
63 |
}
|
|
64 |
}
|
|
65 |
}
|
|
66 |
@mixin desktop-vertical-steps() {
|
|
67 |
@if ($form-sidebar-position == left or $form-sidebar-position == right) {
|
|
68 |
@media (min-width: $mobile-limit + 1) {
|
|
69 |
@content;
|
|
70 |
}
|
|
71 |
}
|
|
72 |
}
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
/*
|
|
77 |
* Default Steps (with SQUARES markers)
|
|
78 |
*/
|
|
79 |
|
|
80 |
/* Steps bloc */
|
|
81 |
.wcs-steps {
|
|
82 |
background: $wcs-steps-background;
|
|
83 |
margin-bottom: 0.7rem;
|
|
84 |
border-radius: $border-radius;
|
|
85 |
|
|
86 |
@if $wcs-steps-background != transparent {
|
|
87 |
padding: $wcs-steps-spacing;
|
|
88 |
}
|
|
89 |
|
|
90 |
|
|
91 |
&--list {
|
|
92 |
margin: 0;
|
|
93 |
padding: 0;
|
|
94 |
list-style: none;
|
|
95 |
color: $wcs-step-color;
|
|
96 |
}
|
|
97 |
}
|
|
98 |
|
|
99 |
/* Step item */
|
|
100 |
.wcs-step {
|
|
101 |
border-radius: $border-radius;
|
|
102 |
background-color: $wcs-step-background;
|
|
103 |
display: flex;
|
|
104 |
|
|
105 |
&--marker {
|
|
106 |
// marker is abbr tag
|
|
107 |
text-decoration: none;
|
|
108 |
box-sizing: border-box;
|
|
109 |
|
|
110 |
font-size: 1em;
|
|
111 |
line-height: nomal;
|
|
112 |
text-align: center;
|
|
113 |
|
|
114 |
display: flex;
|
|
115 |
|
|
116 |
color: $wcs-step-marker-color;
|
|
117 |
background: $wcs-step-marker-background;
|
|
118 |
border-radius: $border-radius;
|
|
119 |
|
|
120 |
width: $wcs-step-marker-size;
|
|
121 |
height: $wcs-step-marker-size;
|
|
122 |
flex: 0 0 $wcs-step-marker-size;
|
|
123 |
|
|
124 |
&-nb {
|
|
125 |
margin: auto;
|
|
126 |
}
|
|
127 |
|
|
128 |
&-total {
|
|
129 |
display: none;
|
|
130 |
}
|
|
131 |
}
|
|
132 |
|
|
133 |
&--label {
|
|
134 |
display: block;
|
|
135 |
align-self: center;
|
|
136 |
letter-spacing: 1px;
|
|
137 |
line-height: 1.25;
|
|
138 |
}
|
|
139 |
|
|
140 |
|
|
141 |
// If step is current
|
|
142 |
&.current {
|
|
143 |
font-weight: bold;
|
|
144 |
background: $wcs-step-current-background;
|
|
145 |
}
|
|
146 |
|
|
147 |
&.current & {
|
|
148 |
&--marker {
|
|
149 |
background: $wcs-step-current-marker-background;
|
|
150 |
color: $wcs-step-current-marker-color;
|
|
151 |
|
|
152 |
transform: scale($wcs-step-current-marker-enlarge);
|
|
153 |
}
|
|
154 |
&--label {
|
|
155 |
color: $wcs-step-current-label-color;
|
|
156 |
}
|
|
157 |
}
|
|
158 |
|
|
159 |
// If step is NOT current
|
|
160 |
&:not(.current) & {
|
|
161 |
&--label {
|
|
162 |
display: none;
|
|
163 |
}
|
|
164 |
}
|
|
165 |
}
|
|
166 |
|
|
167 |
/* Sidebar on TOP, SMALL LAYOUT (very-small viewport)
|
|
168 |
* Display only current step with nb and total in marker
|
|
169 |
*/
|
|
170 |
@media ($mq-max--wcs-steps-small-layout) {
|
|
171 |
.wcs-step {
|
|
172 |
@if ($wcs-step-background != transparent or $wcs-step-current-background != transparent) {
|
|
173 |
padding: $wcs-steps-spacing;
|
|
174 |
}
|
|
175 |
|
|
176 |
&--marker {
|
|
177 |
|
|
178 |
$size: $wcs-step-marker-size + 0.8;
|
|
179 |
|
|
180 |
width: $size;
|
|
181 |
height: $size;
|
|
182 |
flex: 0 0 auto;
|
|
183 |
align-items: center;
|
|
184 |
justify-content: center;
|
|
185 |
|
|
186 |
&-nb {
|
|
187 |
margin: 0;
|
|
188 |
transform: translateY(-0.5em);
|
|
189 |
order: 1;
|
|
190 |
}
|
|
191 |
|
|
192 |
&-total {
|
|
193 |
display: block;
|
|
194 |
transform: translateY(0.5em);
|
|
195 |
font-size: 0.75em;
|
|
196 |
font-weight: normal;
|
|
197 |
order: 3;
|
|
198 |
}
|
|
199 |
|
|
200 |
// add slash
|
|
201 |
&::before {
|
|
202 |
content: "";
|
|
203 |
display: block;
|
|
204 |
flex: 0 0 0.1em;
|
|
205 |
height: 2em;
|
|
206 |
margin: 0 0.1em;
|
|
207 |
background: $wcs-step-current-marker-color;
|
|
208 |
transform: rotate(30deg);
|
|
209 |
order: 2;
|
|
210 |
}
|
|
211 |
}
|
|
212 |
|
|
213 |
&--label {
|
|
214 |
margin-left: $wcs-steps-spacing*2;
|
|
215 |
}
|
|
216 |
|
|
217 |
// If step is NOT current
|
|
218 |
&:not(.current) {
|
|
219 |
display: none;
|
|
220 |
}
|
|
221 |
}
|
|
222 |
}
|
|
223 |
|
|
224 |
/* Horizontal Layout
|
|
225 |
* Sidebar on TOP, SMALL and more viewport
|
|
226 |
* Diplay all marker, but only current Label
|
|
227 |
*/
|
|
228 |
@media ($mq-min--wcs-steps-horizontal-layout) {
|
|
229 |
|
|
230 |
.wcs-steps {
|
|
231 |
&--list {
|
|
232 |
position: relative;
|
|
233 |
display: flex;
|
|
234 |
flex-wrap: wrap;
|
|
235 |
|
|
236 |
// keep space for label
|
|
237 |
margin-bottom: 2em;
|
|
238 |
}
|
|
239 |
}
|
|
240 |
|
|
241 |
.wcs-step {
|
|
242 |
margin-bottom: $wcs-steps-spacing;
|
|
243 |
margin-right: $wcs-steps-spacing;
|
|
244 |
border-bottom: $wcs-step-border-bottom;
|
|
245 |
|
|
246 |
&--label {
|
|
247 |
position: absolute;
|
|
248 |
top: 100%;
|
|
249 |
left: 0;
|
|
250 |
width: 100%;
|
|
251 |
padding-bottom: $wcs-steps-spacing;
|
|
252 |
}
|
|
253 |
|
|
254 |
&.current {
|
|
255 |
border-bottom: $wcs-step-current-border-bottom;
|
|
256 |
}
|
|
257 |
}
|
|
258 |
}
|
|
259 |
|
|
260 |
|
|
261 |
@include desktop-horizontal-steps() {
|
|
262 |
.wcs-steps {
|
|
263 |
font-size: 1.25em;
|
|
264 |
}
|
|
265 |
.wcs-step {
|
|
266 |
margin-bottom: $wcs-steps-spacing*2;
|
|
267 |
margin-right: $wcs-steps-spacing*2;
|
|
268 |
}
|
|
269 |
}
|
|
270 |
|
|
271 |
/* Vertical Steps
|
|
272 |
* Sidebar on LEFT or RIGHT, DESKTOP only
|
|
273 |
* Display All steps with marker and label. One below the other.
|
|
274 |
*/
|
|
275 |
@include desktop-vertical-steps() {
|
|
276 |
.wcs-steps {
|
|
277 |
font-size: 1.25em;
|
|
278 |
|
|
279 |
&--list {
|
|
280 |
flex-wrap: nowrap;
|
|
281 |
flex-direction: column;
|
|
282 |
// remove keep space for label
|
|
283 |
padding-bottom: 0;
|
|
284 |
}
|
|
285 |
}
|
|
286 |
|
|
287 |
.wcs-step {
|
|
288 |
@if $wcs-step-border-bottom != none {
|
|
289 |
padding-bottom: $wcs-steps-spacing;
|
|
290 |
}
|
|
291 |
@if ($wcs-step-background != transparent or $wcs-step-current-background != transparent) {
|
|
292 |
padding: $wcs-steps-spacing;
|
|
293 |
}
|
|
294 |
|
|
295 |
margin-right: 0;
|
|
296 |
|
|
297 |
&--label {
|
|
298 |
position: static;
|
|
299 |
font-size: 0.7em;
|
|
300 |
margin-left: $wcs-steps-spacing;
|
|
301 |
padding-bottom: 0;
|
|
302 |
}
|
|
303 |
|
|
304 |
// If step is NOT current
|
|
305 |
&:not(.current) & {
|
|
306 |
&--label {
|
|
307 |
display: block;
|
|
308 |
}
|
|
309 |
}
|
|
310 |
}
|
|
311 |
}
|
|
312 |
|
|
313 |
|
|
314 |
/*
|
|
315 |
* OPTION marker-background-type: gradient.
|
|
316 |
* Generate automatically a gradient based on background-color
|
|
317 |
*/
|
|
318 |
|
|
319 |
@if $wcs-step-marker-background-type == gradient {
|
|
320 |
.wcs-step {
|
|
321 |
&--marker {
|
|
322 |
background-attachment: fixed;
|
|
323 |
@media (min-width: $very-small-limit + 1) {
|
|
324 |
background-image: linear-gradient(to right, lighten($wcs-step-marker-background, 10%), darken($wcs-step-marker-background, 10%));
|
|
325 |
}
|
|
326 |
|
|
327 |
@include desktop-vertical-steps() {
|
|
328 |
background-image: linear-gradient(to bottom, lighten($wcs-step_marker-background, 10%), darken($wcs-step_marker-background, 10%));
|
|
329 |
}
|
|
330 |
}
|
|
331 |
}
|
|
332 |
}
|
|
333 |
|
|
334 |
/*
|
|
335 |
* OPTION Pile Step Before
|
|
336 |
* Work only for
|
|
337 |
* * horizontal mode: desktop breakpoint and sidebar on left or right
|
|
338 |
* * with background-color on step
|
|
339 |
*/
|
|
340 |
@if ($wsc-step-before-piled ) {
|
|
341 |
@include desktop-vertical-steps() {
|
|
342 |
.wcs-step {
|
|
343 |
&:not(:first-child) {
|
|
344 |
&.step-before,
|
|
345 |
&.current {
|
|
346 |
box-shadow: 0 -4px 4px -4px darken($wcs-step-background, 40%);
|
|
347 |
}
|
|
348 |
}
|
|
349 |
|
|
350 |
&.step-before,
|
|
351 |
&.current {
|
|
352 |
z-index: 1;
|
|
353 |
transition: margin 400ms, box-shadow 400ms;
|
|
354 |
}
|
|
355 |
|
|
356 |
&.step-before {
|
|
357 |
margin-bottom: calc( (#{$wcs-step-marker-size} + #{$wcs-steps-spacing * 2}) / 2 * -1);
|
|
358 |
|
|
359 |
&:hover {
|
|
360 |
margin-bottom: $wcs-steps-spacing;
|
|
361 |
|
|
362 |
& + .wcs-step {
|
|
363 |
box-shadow: 0 0 0 0 darken($wcs-step-background, 40%);
|
|
364 |
}
|
|
365 |
}
|
|
366 |
}
|
|
367 |
}
|
|
368 |
}
|
|
369 |
}
|
|
370 |
|
|
371 |
|
|
372 |
/*
|
|
373 |
* OPTION marker type DISC
|
|
374 |
*/
|
|
375 |
@if (str-index(quote($wcs-step-marker-type), 'disc')) {
|
|
376 |
.wcs-step {
|
|
377 |
&--marker {
|
|
378 |
border-radius: 50% !important;
|
|
379 |
|
|
380 |
@media ($mq-max--wcs-steps-small-layout) {
|
|
381 |
$size: $wcs-step-marker-size + 1.4;
|
|
382 |
width: $size;
|
|
383 |
height: $size;
|
|
384 |
}
|
|
385 |
}
|
|
386 |
}
|
|
387 |
}
|
|
388 |
|
|
389 |
/*
|
|
390 |
* OPTION marker type TIED
|
|
391 |
*/
|
|
392 |
@if (str-index(quote($wcs-step-marker-type), 'tied')) {
|
|
393 |
|
|
394 |
.wcs-step {
|
|
395 |
&:not(:last-child) {
|
|
396 |
@media ($mq-min--wcs-steps-horizontal-layout) {
|
|
397 |
&::after {
|
|
398 |
content: "";
|
|
399 |
display: block;
|
|
400 |
height: $wcs-step-marker-tie-width;
|
|
401 |
flex: 0 0 100%;
|
|
402 |
background-color: $wcs-step-marker-tie-color;
|
|
403 |
margin: auto;
|
|
404 |
}
|
|
405 |
}
|
|
406 |
|
|
407 |
@include desktop-vertical-steps() {
|
|
408 |
position: relative;
|
|
409 |
|
|
410 |
&::after {
|
|
411 |
height: calc(100% + #{$wcs-steps-spacing});
|
|
412 |
width: $wcs-step-marker-tie-width;
|
|
413 |
|
|
414 |
position: absolute;
|
|
415 |
z-index: 1;
|
|
416 |
top: $wcs-steps-spacing;
|
|
417 |
left: calc( (#{$wcs-step-marker-size} - #{$wcs-step-marker-tie-width}) / 2 );
|
|
418 |
|
|
419 |
@if $wcs-step-background != transparent {
|
|
420 |
left: calc( (#{$wcs-step-marker-size} - #{$wcs-step-marker-tie-width}) / 2 + #{$wcs-steps-spacing});
|
|
421 |
}
|
|
422 |
}
|
|
423 |
}
|
|
424 |
}
|
|
425 |
|
|
426 |
&--marker {
|
|
427 |
position: relative;
|
|
428 |
z-index: 2;
|
|
429 |
}
|
|
430 |
}
|
|
431 |
}
|