Pen Settings

HTML

CSS

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

JavaScript

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

Behavior

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <label>Mode:</label>
<input type="radio" id="light-mode" name="mode" value="light"  checked=checked />
<label for="light-mode">Light</label>

  <input type="radio" id="dark-mode" name="mode" value="dark" />
<label for="dark-mode">Dark</label>

<main>
  <header>
    <h1>Page Title</h1>
  </header>

  <article>
    <header>
      <h2>This is an article title</h2>
      <p>And the Article's Subtitle</p>
    </header>
    <p>One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin.</p>

  <p>He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment.</p>

  <p>His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked. "What's happened to me? " he thought. It wasn't a dream. His room, a proper human room although a little too small, lay peacefully between its four familiar walls.</p>

  <p>A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops</p>
  </article>

  <footer>
    <h2>This is the footer!</h2>
    <p>© 2018</p>
  </footer>
</main>
            
          
!

CSS

            
              :root {
  --light-mode-bg-color: #FEFEFE;
  --light-mode-font-color: #333;
  
  --dark-mode-bg-color: #111;
  --dark-mode-font-color: #DEDEDE;
  
  --background-color-transition: background-color 0.6s ease;
  --font-color-transition: color 2s ease;
  
  --theme-transition: var(--background-color-transition), var(--font-color-transition);
}

html, body {
  padding: 0;
  margin: 0;
  background-color: #0D3;
  color: #333;
}

main {
  background-color: var(--bg-color, white);
  color: var(--font-color, black);
  padding: 1em;
  transition: var(--theme-transition);
}


/* Let the variables do the work! */

input[value='light']:checked ~ main {
  --bg-color: var(--light-mode-bg-color);
  --font-color: var(--light-mode-font-color);
}

input[value='dark']:checked ~ main {
  --bg-color: var(--dark-mode-bg-color);
  --font-color: var(--dark-mode-font-color);
}
            
          
!

JS

            
              
            
          
!
999px

Console