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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <div class="swatch"><pre>base</pre></div>

<div class="swatch darken"><pre>darken</pre></div>

<div class="swatch lighten"><pre>lighten</pre></div>

<div class="swatch saturate"><pre>saturate</pre></div>

<div class="swatch desaturate"><pre>desaturate</pre></div>

<div class="swatch adjust-hue"><pre>adjust-hue</pre></div>

<div class="swatch adjust-opacity"><pre>opacity</pre></div>

<div class="swatch adjust-tint"><pre>tint</pre></div>

<div class="swatch adjust-shade"><pre>shade</pre></div>


                @import "bourbon";

// set your primary color only, but feel free to adjust the other color percentages
$base-color:       #6699CC;

$darken-color:     darken( $base-color, 20% );
$lighten-color:    lighten( $base-color, 20% );
$saturate-color:   saturate( $base-color, 50% );
$desaturate-color: desaturate( $base-color, 20% );
$hue-color:        adjust-hue( $base-color, 50% );
$opacity-color:    rgba( $base-color, .5 );
$tint-color:       tint( $base-color, 50% );
$shade-color:      shade( $base-color, 50% );

// dynamically changes the text color based on the lightness of the primary color:
@function set-text-color($color) {
  @if (lightness($color) >= 50) {
    @return #000000; // Lighter backgorund, return dark color
  } @else {
    @return #ffffff; // Darker background, return light color
// centers the text in the box
@mixin vertical-align {
  margin: 0;
  position: relative;
  top: 50%;
  transform: translateY(-50%);

// creates the swatch boxes
.swatch {
  background: $base-color;
  display: block;
  float: left;
  margin: 5px;
  text-align: center; 
  width: calc(100% / 3 - 10px);
  height: calc(100vh / 3 - 15px);

  pre {
    @include vertical-align;

// adjusting each box color
.darken {
  background-color: $darken-color;
  color: set-text-color($darken-color);

.lighten {
  background-color: $lighten-color;
  color: set-text-color($lighten-color);

.saturate {
  background-color: $saturate-color;
  color: set-text-color($saturate-color);

.desaturate {
  background-color: $desaturate-color;
  color: set-text-color($desaturate-color);

.adjust-hue {
  background-color: $hue-color;
  color: set-text-color($hue-color);

.adjust-opacity {
  background-color: $base-color;
  background-color: $opacity-color;
  color: set-text-color($opacity-color);

.adjust-tint {
  background-color: $tint-color;
  color: set-text-color($tint-color);

.adjust-shade {
  background-color: $shade-color;
  color: set-text-color($shade-color);