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, brightness is set to <code>50%</code> using a CSS Custom Property. By moving the range slider to either the left or right, you can increase or decrease the brightness effect applied to the photo.
    <div class="controls">
      <label class="controls__label" for="brightness">Brightness:</label>
      <input class="controls__input" type="range" id="brightness" min="0" max="100" value="50">

    <div class="example__demo example__brightness">
      <img class="drink" alt="A Manhattan cocktail placed on a wooden table in a low-lit room." src=""/>
      <small>Photo by <a href="">Jakub Dziubak</a> on <a href="">Unsplash</a>.</small>


                // Demo
:root {
  --brightness: 50%;

.drink {
  filter: brightness(var(--brightness));

// Pen Setup
.example__brightness {
  background-color: var(--color-cinder);
  padding: 2rem 2rem 1.75rem 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 = []'#brightness'));

// 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);