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.


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.


                <main style="--border-style: dotted">
  <p>An element with no custom properties directly set. Where registered properties are supported, the padding and margin of this and all the other paragraphs is set to the initial 20px value of <code>--spacing</code>. They also all inherit the dotted border style from a parent as the <code>--border-style</code> custom property.</p>
<p style="--border-color: orange">This is the only element with a value set for the <code>--border-color</code> custom property.</p>
<p id="target" style="--color: darkGreen">This is the element being examined. It has an inline style setting a value for the <code>--color</code> property.</p>
<aside id="serialized"><h2>Serialized Custom Props</h2></aside>
<aside id="computed"><h2>Computed Custom Props</h2></aside>


                body {
  display: grid;
  grid-template: "main s1"
                 "main s2";
  grid-gap: 0.5em;
  padding: 0.5em;
  min-height: 100vh;
  box-sizing: border-box;
body > * {
  border: thin gray solid;
main {
  grid-area: main;
aside {
  padding: 0.5em;

p {
  color: var(--color, purple);
  border: var(--border-style, solid) var(--border-color, gray) 2px;
  margin: var(--spacing, 2px);
  padding: var(--spacing);



                if (CSS && CSS.registerProperty) {
    name: "--spacing",
    syntax: "<length>",
    inherits: false,
    initialValue: "10px"

const target = document.getElementById("target");

const serialized = {
  sidebar : document.getElementById("serialized"),
  props :
const computed = {
  sidebar : document.getElementById("computed"),
  props : window.getComputedStyle(target)

for ({sidebar, props} of [serialized, computed]) {

for (prop in props) {
  if (props.hasOwnProperty(prop) && props[prop].includes('--')) {
  const container = document.createElement('div');
  const label = document.createElement('label');
  const input = document.createElement('input');
   input.setAttribute('readonly', '');
  container.className = 'container';
    label.setAttribute('for', props[prop].replace('--', ''));
    label.innerHTML = props[prop];
    input.setAttribute('id', props[prop].replace('--', ''))
    input.setAttribute('type', 'text');
    input.value = props.getPropertyValue(props[prop]);