Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <ol class="wizard">
  <li 
    v-for="step in steps"
    tabindex="1" 
    class="wizard__item"
    v-on:click="setStep(step.id)"
    v-bind:title="step.desc"
    v-bind:class="{
      'wizard__item--visited': step.visited, 
      'wizard__item--disabled': step.disabled, 
      'wizard__item--active': step.active
      }">
    <span class="wizard__item-desc">
      {{ step.desc }}
    </span>
    <span class="wizard__item-arrows"></span>
  </li>
</ol>
            
          
!
            
               @import url('https://fonts.googleapis.com/icon?family=Material+Icons');

body {
  background-color: #fefefe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Open Sans', sans-serif;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.wizard {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: bth-wizard-steps;
  display: flex;
  flex-wrap: no-wrap;
  overflow: hidden;
  
  .wizard__item-arrows {
    
    &:after,
    &:before {
      content: " ";
      display: block;
      position: absolute;
    }
    
    &:before {
      border-top: 30px solid transparent;
      border-bottom: 30px solid transparent;
      border-left: 20px solid white; // gray l20
      top: -4px;
      left: -1px;
      z-index: 1;
    }
    
    &:after {
      border-top: 26px solid transparent;
      border-bottom: 26px solid transparent;
      border-left: 18px solid #EBEDF0; // gray l20
      top: 0;
      right: -17px;
      left: auto;
      z-index: 2;
    }
  }
  
  .wizard__item {
    background-color: #EBEDF0; // gray l20
    color: #595959; //gray d20
    counter-increment: bth-wizard-steps;
    flex-grow: 1;
    font-size: 13px;
    font-weight: 600;
    line-height: 50px;
    min-width: 30px;
    max-width: 100%;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    flex-wrap: no-wrap;
    padding-left: 34px;
    padding-right: 8px;
    cursor: pointer;
    position: relative;
    
    &:before {
      content: counter(bth-wizard-steps);
      font-size: 14px;
      font-weight: 600;
      min-width: 30px;
      display: flex;
      width: 30px;
      height: 30px;
      background-color: white; // gray l40
      margin-right: 8px;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
    }
    
    &:first-child {
      padding-left: 8px;
      .wizard__item-arrows {
        &:before {
          display:none;
        }
      }
    }
    
    &:last-child {
      .wizard__item-arrows {
        &:after {
          display:none;
        }
      }
    }
    
    &-desc {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    &--active {
      background-color: #7FAADC; // blue l20
      color: #222; // gray d30
      min-width: auto;
      
      .wizard__item-arrows {
        &:after {
          border-left-color: #7FAADC; // blue l20
        }
      }
      &:before {
         color: #295D99 ; //blue d10 
      }
    }
    
    &--visited {
      background-color: #CFDFF2; // blue l40
      color: #595959; // gray d20
      
      .wizard__item-arrows {
        &:after {
          border-left-color: #CFDFF2; // blue l40
        }
      }
      
      &:before {
         font-family: 'Material Icons';
         color: #295D99 ; //blue d10 
         content: 'check';
         font-size: 18px;
         text-transform: none;
      }
    }
    
    &--disabled, [disabled] {
      background-color: #F5F7FA; // gray l30
      color: #c0c0c0; // gray d20
      cursor: default;
      
      .wizard__item-arrows {
        &:after {
          border-left-color: #F5F7FA; // gray l30
        }
      }
      
      &:before {
         color: #c0c0c0 ; //gray 
         content: counter(bth-wizard-steps);
      }
    }
    
  }
}
            
          
!
            
              new Vue({
  el: ".wizard",
  data: {
    steps: [
      { id: 1, desc: "Lorem ipsum", visited: true},
      { id: 2, desc: "Lorem ipsum", active: true},
      { id: 3, desc: "Lorem ipsum"},
      { id: 4, desc: "Lorem ipsum"},
      { id: 5, desc: "Lorem ipsum"},
      { id: 6, desc: "Lorem ipsum", disabled: true}
    ]
  },
  methods: {
  	setStep: _setStep
  }
})

function _setStep(step){
	if(this.steps[step - 1].disabled)
  	return;
    
	this.steps.map(s => {
  	if(s.id != step) {
    	s.visited = false;
    	s.active = false;
    }
    
  	if(s.id < step) {
    	s.visited = true;
    }
  });
  this.steps[step - 1].visited = false;
  this.steps[step - 1].active = true;
}



            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console