Pen Settings



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


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.


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.


  <div class="article">
    <h1>Cascade Layers.</h1>
    <p>In this example, I'm showcasing the power of <a href="">cascade layers</a>, using <code>@layer</code>. This is a <a href="#">link without class name</a>. You can see it appears green. This is a <a href="#" class="link"> link with class of <code>link</code></a>. It, too, appears green, even though I specify the color of <code>.link</code> elements to be blue. While <code>.link</code> has a higher element-level specificity than <code>a</code>, I am setting a color style on <code>a</code> in a higher-precedence <code>@layer</code>.</p>
    <div class="callout">
      <p>The <em>layer</em> precedence beats the <em>element specificity</em>.</p>
    <p>Now, I have an even <em>more</em> specific layer called <code>utilities</code> where I have a class called <code>pink</code>. This is a <a href="#" class="pink">link with class of <code>pink</code></a>. This specificity wins.</p>
    <p>Here's what the code looks like (editable). Try removing the <code>typography</code> layer, or adjusting the order of the layers to see what happens:</p>
    <style contenteditable>
@layer base {
  a {
    font-weight: 800;
    color: red; /* ignored */

  .link {
    color: blue; /* ignored */

@layer typography {
  a {
    color: green; /* styles *all* links */

@layer utilities {
  .pink {
    color: hotpink;  /* styles *all* .pink's */
    <div class="callout"><p>If you reverse the layer order at the top of the file (i.e. the first time the name of the layer is introduced), you'll see a different result. <code>@layer utilities, typography, base;</code> will make the links appear red and blue.</p></div>


                /* Layer style code is editable in the body */

body {
  font-family: system-ui, serif;
  font-size: 20px;
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  height: 100vh;
  place-items: center;

code {
  background-color: gold;
  padding: 0.25rem;

.article {
  background-color: aliceblue;
  padding: 3rem;

.callout {
  padding-left: 2rem;
  margin-left: 2rem;
  font-size: 1.5rem;
  border-left: 4px solid hotpink;

style {
  display: block;
  background: white;
  border: 1px solid deepskyblue;
  padding: 1rem 2rem;
  line-height: 1.25;
  font-family: monospace;
  white-space: pre-wrap;
  font-size: 1rem;