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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                <header class="header">
  <div class="header__title">
  <div class="header__reference">
    <ul class="reference-list">
      <li><a class="reference-list__link" href="">MDN reference</a></li>
      <li><a class="reference-list__link" href="">caniuse Support</a></li>

  <div class="example">
      In this example, saturation is set to <code>100%</code> using a CSS Custom Property. By moving the range slider, you can decrease the amount of saturation applied to the photo.
    <div class="controls">
      <label class="controls__label" for="saturation">Saturate:</label>
      <input class="controls__input" type="range" id="saturate" min="0" max="100" value="100">

    <div class="example__demo example__demo--saturate">
        alt="A mantis shrimp lurking on the ocean floor."
        src="" />
      <small><a href="">"Mantis Shrimp"</a> by <a href="">PacificKlaus</a> is licensed under <a href="">CC BY-NC 2.0</a>.</small>


                // Demo
:root {
  --saturate: 100%;

.mantis-shrimp {
  filter: saturate(var(--saturate));

// Pen Setup
.example__demo--saturate {
  box-shadow: 0 1rem 1rem 0 hsla(253, 27%, 6%, 0.4);
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  transform: rotate(-1.5deg);
  margin-bottom: 2rem;

  img {
    height: auto;
    width: 100%;

.controls {
  display: flex;
  flex-direction: column;
  margin-top: var(--size-epsilon);

.controls__label {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;

.controls__input {
  margin-top: 0.5rem;



                // Credit: 
// Update CSS Variables with JS
// Wes Bos

const rangeSlider = []'#saturate'));

// Listen for changes
rangeSlider.forEach(input => input.addEventListener('change', handleUpdate));
rangeSlider.forEach(input => input.addEventListener('mousemove', handleUpdate));

function handleUpdate(e) {
  // Append '%' to the end of the `blur` custom property
  const suffix = ( === 'base' ? '' : '%');`--${}`, this.value + suffix);