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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <p>Click the bar to change its width</p>
<div class="progress">
  <div class="progress-bar" style="width: 60%;"></div>
</div>
              
            
!

CSS

              
                /* ========================================================
  Mixins
======================================================== */

.box-shadow(@shadow) {
  -webkit-box-shadow: @shadow;
     -moz-box-shadow: @shadow;
          box-shadow: @shadow;
}

.transition(@transition) {
  -webkit-transition: @transition;
     -moz-transition: @transition;
       -o-transition: @transition;
          transition: @transition;
}

.gradient-vertical(@start-color; @end-color; @start-percent: 0%; @end-percent: 100%) {
  background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);
  background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent);
}
.gradient-striped(@color1; @color2; @angle: 45deg) {
  background-image: -webkit-linear-gradient(
    @angle,
    @color1 30%,
    @color2 30%,
    @color2 33%,
    transparent 33%,
    transparent 46%,
    @color2 46%,
    @color2 50%,
    @color1 50%,
    @color1 80%,
    @color2 80%,
    @color2 83%,
    transparent 83%,
    transparent 97%,
    @color2 97%,
    @color2
  );
  background-image: linear-gradient(
    @angle,
    @color1 30%,
    @color2 30%,
    @color2 34%,
    transparent 34%,
    transparent 46%,
    @color2 46%,
    @color2 50%,
    @color1 50%,
    @color1 80%,
    @color2 80%,
    @color2 84%,
    transparent 84%,
    transparent 96%,
    @color2 96%,
    @color2
  );
}

/* ========================================================
  Progress Bar
======================================================== */

// ANIMATIONS
@-webkit-keyframes progress-bar-animate {
  from  { background-position: 40px 0; }
  to    { background-position: 0 0; }
}

@keyframes progress-bar-animate {
  from  { background-position: 40px 0; }
  to    { background-position: 0 0; }
}


// outer container
.progress {
  overflow: hidden;
  height: 20px;
  border-radius: 10px;
  .gradient-vertical(#ccc, #ddd);
  .box-shadow(inset 0 1px 2px rgba(0,0,0,.1));

  // inner progress bar
  &-bar {
    width: 0%;
    height: 100%;
    float: left;
    box-sizing: border-box;
    background-color: #79b;
    background-size: 40px 40px;
    border-radius: 10px 0 0 10px;
    .gradient-striped(rgba(255,255,255,0.2); rgba(0,0,0,0.1));
    .box-shadow(inset 0 -1px 0 rgba(0,0,0,.1));
    .transition(width 200ms ease);

    -webkit-animation: progress-bar-animate 1s linear infinite;
            animation: progress-bar-animate 1s linear infinite;
  }
}

              
            
!

JS

              
                $('.progress').click(function() {
  $(this).find('.progress-bar').css('width', Math.floor(10 + Math.random()*80) + '%');
});
              
            
!
999px

Console