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="type-grinding"
  style="--variant: success;"
>
  My inline style is setting the `--variant` variable - edit it in the HTML panel!<br>
  Throw both good and bad data it, try removing it!<br>
  These values are valid: <b>primary|secondary|success|error</b><br>
  See how it affects our bits:
</div>



<style>
  /* This is boilerplate to render our bits as-is for demonstration before we move on to makeing them useful. The CSS panel has our library code; Our users will not be using these variables directly. */
  div::after {
    display: block;
    white-space: pre;
    font-family: monospace;
    counter-reset: primary var(--_v-primary-bit) secondary var(--_v-secondary-bit) success var(--_v-success-bit) error var(--_v-error-bit);
    content: "\a --_v-primary-bit: " counter(primary)
      "\a --_v-secondary-bit: " counter(secondary)
      "\a --_v-success-bit: " counter(success)
      "\a --_v-error-bit: " counter(error)
  }
</style>

              
            
!

CSS

              
                .type-grinding {
  --_v-primary-else-0: var(--variant);
  --_v-secondary-else-0: var(--variant);
  --_v-success-else-0: var(--variant);
  --_v-error-else-0: var(--variant);

  --_v-primary-bit: var(--_v-primary-else-0);
  --_v-secondary-bit: var(--_v-secondary-else-0);
  --_v-success-bit: var(--_v-success-else-0);
  --_v-error-bit: var(--_v-error-else-0);
}

@property --variant {
  syntax: "primary|secondary|success|error";
  initial-value: primary;
  inherits: true;
}

@property --_v-primary-else-0 {
  syntax: "primary|<integer>"; initial-value: 0; inherits: true;
}
@property --_v-secondary-else-0 {
  syntax: "secondary|<integer>"; initial-value: 0; inherits: true;
}
@property --_v-success-else-0 {
  syntax: "success|<integer>"; initial-value: 0; inherits: true;
}
@property --_v-error-else-0 {
  syntax: "error|<integer>"; initial-value: 0; inherits: true;
}

@property --_v-primary-bit {
  syntax: "<integer>"; initial-value: 1; inherits: true;
}
@property --_v-secondary-bit {
  syntax: "<integer>"; initial-value: 1; inherits: true;
}
@property --_v-success-bit {
  syntax: "<integer>"; initial-value: 1; inherits: true;
}
@property --_v-error-bit {
  syntax: "<integer>"; initial-value: 1; inherits: true;
}

              
            
!

JS

              
                // Still Nope!

              
            
!
999px

Console