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.


                <h1>Neat CSS custom properties hack (set value only if another custom property is set)</h1>

<div class="parent"><div class="child">0px border width without variables set</div></div>
<div class="parent" style="--layout-stackpoint: 480px; --layout-margin-h: 8px"><div class="child">set to --layout-margin-h border width when --layout-stackpoint is set</div></div>

<p>Solution inspired by <a href=""></a> via <a href=""></a></p>


                .parent {
  margin: 4px;
.child {
  background-color: #ddd;
  border-style: solid;
  border-color: red;
  border-width: 0;
.child {
  /* Simple version using 0px or 1px: */
  /* border-width: calc( var(--layout-stackpoint, -1px) - var(--layout-stackpoint, 0px) + 1px ); */
  /* Harder version using 0px or --layout-margin-h */
  border-width: calc( var(--layout-stackpoint, -1 * var(--layout-margin-h, 0px)) - var(--layout-stackpoint, 0px) + var(--layout-margin-h, 0px) );