-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stepped process): add the component from v4
- Loading branch information
LE DIOURON Kevin
committed
Feb 25, 2021
1 parent
e6906f9
commit 2a8426f
Showing
9 changed files
with
291 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// | ||
// Orange stepped process | ||
// | ||
.stepped-process { | ||
ol { | ||
display: flex; | ||
padding: 0; | ||
margin: 0; | ||
overflow: hidden; | ||
font-weight: $font-weight-bold; | ||
text-align: center; | ||
list-style: none; | ||
counter-reset: $stepped-process-counter; | ||
} | ||
} | ||
|
||
.stepped-process-item { | ||
display: flex; | ||
flex: 1; | ||
padding: $step-item-padding; | ||
margin-right: $step-item-margin-end; | ||
counter-increment: $stepped-process-counter; | ||
background-color: $step-item-bg; | ||
|
||
&.active { | ||
background-color: $step-item-active-bg; | ||
} | ||
|
||
.active ~ & { | ||
background-color: $step-item-next-bg; | ||
} | ||
} | ||
|
||
.stepped-process-link { | ||
flex: 1 0 $step-link-width; | ||
max-width: $step-link-width; | ||
margin: auto; | ||
overflow: hidden; | ||
color: $step-link-color; | ||
text-decoration: if($link-decoration == none, null, none); | ||
white-space: nowrap; | ||
outline-offset: $spacer; | ||
|
||
&::before { | ||
content: $step-link-marker; | ||
} | ||
|
||
&:hover, | ||
&:focus { | ||
color: $step-link-color; | ||
} | ||
|
||
&:hover { | ||
text-decoration: if($link-hover-decoration == underline, null, underline); | ||
} | ||
|
||
&:focus { | ||
text-decoration: $link-decoration; | ||
outline-offset: $spacer / 4; | ||
} | ||
|
||
.active &, | ||
.active ~ .stepped-process-item & { | ||
color: $step-link-active-color; | ||
} | ||
} | ||
|
||
@include media-breakpoint-up(sm) { | ||
.stepped-process-item { | ||
position: relative; | ||
max-width: $step-item-max-width; | ||
padding: $step-item-padding 0; | ||
margin: 0; | ||
filter: $step-item-drop-shadow; | ||
|
||
& + & { | ||
padding-left: $step-item-padding-end; | ||
} | ||
|
||
&:last-child { | ||
padding-right: $step-item-padding-end; | ||
} | ||
|
||
&:not(:last-child)::after { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
left: subtract(100%, 1px); | ||
z-index: -1; | ||
width: $step-item-arrow-width; | ||
content: ""; | ||
background-color: inherit; | ||
clip-path: $step-item-arrow-shape; | ||
} | ||
|
||
&.active { | ||
max-width: none; | ||
} | ||
} | ||
|
||
@for $i from 1 through $stepped-process-max-items { | ||
.stepped-process-item:nth-child(#{$i}) { | ||
$index: subtract($stepped-process-max-items, $i); | ||
z-index: if($index == 0, null, $index); | ||
} | ||
} | ||
|
||
.active .stepped-process-link { | ||
max-width: none; | ||
|
||
&::before { | ||
content: $step-link-marker-lg; | ||
} | ||
} | ||
} | ||
|
||
@include media-breakpoint-up(xl) { | ||
.stepped-process-item, | ||
.stepped-process-link { | ||
max-width: none; | ||
} | ||
|
||
.stepped-process-link::before { | ||
content: $step-link-marker-lg; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ | |
|
||
// Boosted | ||
@import "back-to-top"; | ||
@import "stepped-process"; | ||
|
||
// Helpers | ||
@import "helpers"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
layout: docs | ||
title: Stepped process | ||
description: Stepped process bar used for multiple steps forms process | ||
group: components | ||
toc: true | ||
--- | ||
|
||
## How to use | ||
|
||
Use a `nav` element with `.stepped-process` class, containing an ordered list `<ol>` with `.stepped-process-item` class on list items. | ||
|
||
Use short labels for each step, otherwise they will be cut off to preserve inline layout. More information can be carried on the `title` attribute of the `.stepped-process-link`. | ||
|
||
Add `.active` to a `.stepped-process-item` to indicate the current step, alongside `aria-current="step"` to convey the active state to assistive technologies. | ||
|
||
## Example | ||
|
||
{{< example >}} | ||
<nav class="stepped-process" aria-label="Checkout process"> | ||
<p class="float-start mt-2 me-2 fw-bold d-sm-none">Step</p> | ||
<ol> | ||
<li class="stepped-process-item"> | ||
<a class="stepped-process-link" href="#" title="1. Sign in">Sign in</a> | ||
</li> | ||
<li class="stepped-process-item active"> | ||
<a class="stepped-process-link" href="#" title="2. Review" aria-current="step">Review</a> | ||
</li> | ||
<li class="stepped-process-item"> | ||
<a class="stepped-process-link" href="#" title="3. Delivery">Delivery</a> | ||
</li> | ||
<li class="stepped-process-item"> | ||
<a class="stepped-process-link" href="#" title="4. Payment">Payment</a> | ||
</li> | ||
<li class="stepped-process-item"> | ||
<a class="stepped-process-link" href="#" title="5. Place order">Place order</a> | ||
</li> | ||
</ol> | ||
</nav> | ||
{{< /example >}} | ||
|
||
## Sass | ||
|
||
### Variables | ||
|
||
For more details, please have a look at the exhaustive list of available variables: | ||
|
||
{{< scss-docs name="stepped-process" file="scss/_variables.scss" >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters