Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div class="component">With default shadow</div>

<div class="component no-shadow">No shadow</div>

<div class="component unset-all">Unset all properties</div>

<hr>

<div class="fallbacks">Fallbacks</div>

              
            
!

CSS

              
                :root {
  // Option 1
  //
  // Set custom values and override locally as you wish via custom property or utility class that sets custom property for you.
  
  // string, none
  --component-shadow: 0 .5rem 1rem rgba(0,0,0,.1);
  // --component-shadow: none;
  
  // float, integer, none
  --component-radius: .4rem;
  // --component-radius: none;
  
  
  // Option 2
  //
  // Use custom property fallbacks. By default, we set to none, but if you remove these lines, our "fallback values" (aka the extra styles) kick in.
  //
  // Try commenting out either of these lines and watch the styles change.
  
  --enable-shadows: none;
  --enable-radius: none;
}

.component {
  padding: 3rem;
  margin-bottom: 3rem;
  background-color: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: var(--component-radius);
  box-shadow: var(--component-shadow);
}

.no-shadow {
  --component-shadow: none;
}

.fallbacks {
  padding: 3rem;
  margin-bottom: 3rem;
  background-color: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: var(--enable-radius, .4rem);
  box-shadow: var(--enable-shadows, 0 .5rem 1rem rgba(0,0,0,.1));
}

// Drop our current text reset clas for this?
.unset-all {
  all: unset;
}

body {
  max-width: 40rem;
  padding: 3rem;
  margin: 0 auto;
  font: 16px/1.5 system-ui;
  background-color: #f5f5f5;
}

hr {
  margin-top: 3rem;
  margin-bottom: 3rem;
}
              
            
!

JS

              
                
              
            
!
999px

Console