Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                .step-container
  %h1
    Experimental step animation
    
  .step.active{:data => {:step => 1}}
    1
  .step-separator{:data => {:step => 1}}
  
  
  .step{:data => {:step => 2}}
    2
  .step-separator{:data => {:step => 2}}
  
  
  .step{:data => {:step => 3}}
    3
    
  .next-step
    Next step
              
            
!

CSS

              
                $color: #79A529

body,
html
  background: #eee
  font-size: 14px
  color: #333
  font-family: 'Open Sans', 'Helvetica Neue', 'sans-serif'
  
*
  -webkit-box-sizing: border-box
  -moz-box-sizing: 	border-box
  box-sizing: 		border-box
    
h1
  font-weight: 300
  margin: 0 0 5% 0
  
.next-step
  background: #ccc
  color: #555
  padding: 15px
  font-size: 16px
  font-weight: 300
  display: block
  margin: 80px auto 0
  border-radius: 4px
  width: 150px
  cursor: pointer
  
  &:hover
    background: #bbb

.step-container
  margin: 3% auto
  text-align: center

  .step
    position: relative
    z-index: 2
    display: inline-block
    text-align: center
    background: #000
    width: 80px
    height: 80px
    font-weight: bold
    border-radius: 50%
    padding-top: 30px
    transition: background 1000ms ease, color 1000ms ease
    transition-delay: 800ms
    background: linear-gradient( to right, $color 50%, #fff 50%)
    background-size: 200% 100%
    background-position: right bottom
    
    &.active
      background-position: left bottom
      color: #fff
  
  .step-separator
    position: relative
    z-index: 1
    background: #444
    height: 30px
    width: 100px
    margin: 0 -10px -10px -10px
    display: inline-block
    background: linear-gradient( to right, $color 50%, rgba(255,255,255,.5) 50%)
    background-size: 200% 100%
    background-position: right bottom
    transition: background 1000ms ease
    
    &.active
      background-position: left bottom

              
            
!

JS

              
                var currentStep = 1;

$(document).ready( function () {
  $(".next-step").click( function () {
    $(".step-container .step-separator[data-step='" + currentStep + "']").addClass('active');

    currentStep++;

    $(".step-container .step[data-step='" + currentStep + "']").addClass('active');

  });
})
              
            
!
999px

Console