Created
July 10, 2012 05:12
-
-
Save foca/3081227 to your computer and use it in GitHub Desktop.
Wizard navigation in CSS (using Twitter Bootstrap)
This file contains hidden or 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
<ol class="wizard-nav"> | |
<li class="done"><a href="#">Step 1</a></li> | |
<li class="done"><a href="#">Step 2</a></li> | |
<li class="active"><a href="#">Step 3</a></li> | |
<li><a href="#" data-disabled>Step 4</a></li> | |
<li><a href="#" data-disabled>Step 5</a></li> | |
</ol> |
This file contains hidden or 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
@mixin wizard-step($bgColor, $shadowTone) { | |
color: $white; | |
text-shadow: 0 1px 0 darken($bgColor, $shadowTone); | |
background: $bgColor; | |
&:before { | |
border-top-color: $bgColor; | |
border-bottom-color: $bgColor; | |
} | |
&:after { | |
border-left-color: $bgColor; | |
} | |
} | |
@mixin wizard-step-group($bgColor) { | |
a { | |
@include wizard-step($bgColor, 15%); | |
} | |
&:hover a { | |
@include wizard-step(darken($bgColor, 20%), 20%); | |
} | |
} | |
.wizard-nav { | |
position: relative; | |
list-style-type: none; | |
li { | |
position: relative; | |
float: left; | |
} | |
a { | |
position: relative; | |
display: inline-block; | |
height: 2 * $baseLineHeight; | |
line-height: 2 * $baseLineHeight; | |
margin-right: $baseLineHeight; | |
padding: 0px 10px; | |
color: lighten($grayDark, 45%); | |
background: #eee; | |
text-decoration: none; | |
font-weight: bold; | |
&:before, &:after { | |
width: 0; | |
height: 0; | |
position: absolute; | |
content: ""; | |
top: 0; | |
border: $baseLineHeight solid #eee; | |
border-right-width: 0; | |
} | |
&:before { | |
border-left: $baseLineHeight / 2 solid transparent; | |
left: -$baseLineHeight / 2; | |
} | |
&:after { | |
border-color: transparent; | |
border-left: $baseLineHeight / 2 solid #eee; | |
right: -$baseLineHeight / 2; | |
} | |
} | |
.done { @include wizard-step-group($btnInfoBackground) } | |
.active { @include wizard-step-group($btnPrimaryBackground) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment