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

              
                <section>
  <h2>LCH</h2>
  <div class="mix lch shorter">shorter</div>
  <div class="mix lch longer">longer</div>
  <div class="mix lch increasing">increasing</div>
  <div class="mix lch decreasing">decreasing</div>
</section>

<section>
  <h2>OKLCH</h2>
  <div class="mix oklch shorter">shorter</div>
  <div class="mix oklch longer">longer</div>
  <div class="mix oklch increasing">increasing</div>
  <div class="mix oklch decreasing">decreasing</div>
</section> 

<section>
  <h2>HSL</h2>
  <div class="mix hsl shorter">shorter</div>
  <div class="mix hsl longer">longer</div>
  <div class="mix hsl increasing">increasing</div>
  <div class="mix hsl decreasing">decreasing</div>
</section>

<section>
  <h2>HWB</h2>
  <div class="mix hwb shorter">shorter</div>
  <div class="mix hwb longer">longer</div>
  <div class="mix hwb increasing">increasing</div>
  <div class="mix hwb decreasing">decreasing</div>
</section>

<div class="no-support">
  This browser doesn't support <code>color-mix()</code> yet.
</div>
              
            
!

CSS

              
                @layer demo {
  :root {
    /* CHANGE ME! */
    --color1: blue;
    --color2: white;
  }
  
  .shorter    { --space: shorter hue }
  .longer     { --space: longer hue }
  .increasing { --space: increasing hue }
  .decreasing { --space: decreasing hue }
  
  .lch {
    background: color-mix(in lch var(--space), var(--color1), var(--color2));
  }
  .oklch {
    background: color-mix(in oklch var(--space), var(--color1), var(--color2));
  }
  .hsl {
    background: color-mix(in hsl var(--space), var(--color1), var(--color2));
  }
  .hwb {
    background: color-mix(in hwb var(--space), var(--color1), var(--color2));
  }
}

@layer demo.support {
  .mix {
    max-inline-size: 90vw;
    aspect-ratio: 4/1;
    display: flex;
    place-content: center;
    place-items: center;
    color: black;
    font-size: clamp(1rem, 5vmin, 24px);
    padding: 2ch;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
  }

  html {
    block-size: 100%;
    color-scheme: dark light;
  }

  body {
    min-block-size: 100%;
    font-family: system-ui, sans-serif;

    display: flex;
    flex-flow: row wrap;
    place-content: center;
    gap: 5vmin;
  }
}

@supports (background: color-mix(in lch, black, white)) {
  .no-support {
    display: none
  }
}

@supports not (background: color-mix(in lch, black, white)) {
  .no-support {
    display: block;
  }
  section {
    display: none
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console