Skip to content

Instantly share code, notes, and snippets.

@foca
Created July 10, 2012 05:12
Show Gist options
  • Select an option

  • Save foca/3081227 to your computer and use it in GitHub Desktop.

Select an option

Save foca/3081227 to your computer and use it in GitHub Desktop.

Revisions

  1. foca revised this gist Jul 10, 2012. 1 changed file with 27 additions and 59 deletions.
    86 changes: 27 additions & 59 deletions wizard.scss
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,28 @@
    @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;
    @@ -41,63 +66,6 @@
    }
    }

    .done a {
    color: $white;
    text-shadow: 0 1px 0 darken($btnInfoBackground, 15%);
    background: $btnInfoBackground;

    &:before {
    border-top-color: $btnInfoBackground;
    border-bottom-color: $btnInfoBackground;
    }

    &:after {
    border-left-color: $btnInfoBackground;
    }
    }

    .done:hover a {
    color: $white;
    text-shadow: 0 1px 0 darken($btnInfoBackground, 40%);
    background: darken($btnInfoBackground, 20%);

    &:before {
    border-top-color: darken($btnInfoBackground, 20%);
    border-bottom-color: darken($btnInfoBackground, 20%);
    }

    &:after {
    border-left-color: darken($btnInfoBackground, 20%);
    }
    }

    .active a {
    color: $white;
    text-shadow: 0 1px 0 darken($btnPrimaryBackground, 15%);
    background: $btnPrimaryBackground;

    &:before {
    border-top-color: $btnPrimaryBackground;
    border-bottom-color: $btnPrimaryBackground;
    }

    &:after {
    border-left-color: $btnPrimaryBackground;
    }
    }

    .active:hover a {
    color: $white;
    text-shadow: 0 1px 0 darken($btnPrimaryBackground, 40%);
    background: darken($btnPrimaryBackground, 20%);

    &:before {
    border-top-color: darken($btnPrimaryBackground, 20%);
    border-bottom-color: darken($btnPrimaryBackground, 20%);
    }

    &:after {
    border-left-color: darken($btnPrimaryBackground, 20%);
    }
    }
    .done { @include wizard-step-group($btnInfoBackground) }
    .active { @include wizard-step-group($btnPrimaryBackground) }
    }
  2. foca created this gist Jul 10, 2012.
    7 changes: 7 additions & 0 deletions wizard.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <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>
    103 changes: 103 additions & 0 deletions wizard.scss
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,103 @@
    .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 a {
    color: $white;
    text-shadow: 0 1px 0 darken($btnInfoBackground, 15%);
    background: $btnInfoBackground;

    &:before {
    border-top-color: $btnInfoBackground;
    border-bottom-color: $btnInfoBackground;
    }

    &:after {
    border-left-color: $btnInfoBackground;
    }
    }

    .done:hover a {
    color: $white;
    text-shadow: 0 1px 0 darken($btnInfoBackground, 40%);
    background: darken($btnInfoBackground, 20%);

    &:before {
    border-top-color: darken($btnInfoBackground, 20%);
    border-bottom-color: darken($btnInfoBackground, 20%);
    }

    &:after {
    border-left-color: darken($btnInfoBackground, 20%);
    }
    }

    .active a {
    color: $white;
    text-shadow: 0 1px 0 darken($btnPrimaryBackground, 15%);
    background: $btnPrimaryBackground;

    &:before {
    border-top-color: $btnPrimaryBackground;
    border-bottom-color: $btnPrimaryBackground;
    }

    &:after {
    border-left-color: $btnPrimaryBackground;
    }
    }

    .active:hover a {
    color: $white;
    text-shadow: 0 1px 0 darken($btnPrimaryBackground, 40%);
    background: darken($btnPrimaryBackground, 20%);

    &:before {
    border-top-color: darken($btnPrimaryBackground, 20%);
    border-bottom-color: darken($btnPrimaryBackground, 20%);
    }

    &:after {
    border-left-color: darken($btnPrimaryBackground, 20%);
    }
    }
    }