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

              
                .progress
  .current

.progress-funky
  .current
              
            
!

CSS

              
                @import "compass/css3";

div {
  height: 50px;
  margin-bottom: 10px;
}

$backColor: #666;
$foreColor: #465298;

.progress {
  // Using percentages prevents weird rendering, using fixed forces positioning to work, so you can align gradients across elements
	background: repeating-linear-gradient(
		-45deg,
		$backColor,
		$backColor 25%,
		shade($backColor,10%) 25%,
		shade($backColor,10%) 50%,
		$backColor 50%
	) top left fixed;
  // Then just define how big the background should be
	background-size: 30px 30px;
  .current {
    width: 25%;
    @include animation(width 5s infinite);
    background: repeating-linear-gradient(
      -45deg,
      $foreColor,
      $foreColor 25%,
      shade($foreColor,10%) 25%,
      shade($foreColor,10%) 50%,
      $foreColor 50%
    ) top left fixed;
    background-size: 30px 30px;
  }
}

// So this one is what happens when you use pixel-based gradients. At time of writing, the bars suffer from rounding errors and are uneven. Even if one day this is fixed, an argument could be made for %-based gradients being more maintainable in case the sizes need to be changed.
.progress-funky {
	background: repeating-linear-gradient(
		-45deg,
		$backColor,
		$backColor 10px,
		shade($backColor,10%) 10px,
		shade($backColor,10%) 20px,
		$backColor 20px
	) top left;
  .current {
    width: 25%;
    animation: width 5s infinite;
    background: repeating-linear-gradient(
      -45deg,
      $foreColor,
      $foreColor 10px,
      shade($foreColor,10%) 10px,
      shade($foreColor,10%) 20px,
      $foreColor 20px
    ) top left;
  }
}

@keyframes width {
  0% { width: 0%; }
  100% { width: 100%; }
}

              
            
!

JS

              
                
              
            
!
999px

Console