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.

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

              
                <article>
  <h1>Dark Mode</h1>
  <p>This is quick Test for the usage of Dark Mode in webdesign. In macOS 10.14 Apple introduced a system-wide dark appearance accompanying the known light appearance. Dark Mode can be enabled in the General Settings of macOS.</p>
  <p>There is a Level 5 Media Query which detects whether someone uses the light or dark appearance of their macOS. As of today only Safari 12.1 has implemented it, but there is a good chance other browsers will follow. The media query reads as follows:</p>
  <pre><code>@media (prefers-color-scheme: dark) {
  /* dark mode styles */ 
}</code></pre>
  <p>This quick test uses a basic implementation of the media query.</p>
  <h2>Ressources</h2>
  <ul>
    <li><a href="https://developer.apple.com/documentation/appkit/supporting_dark_mode_in_your_interface" target="_blank">Apple Developer: Supporting Dark Mode in Your Interface</a></li>
    <li><a href="https://stuffandnonsense.co.uk/blog/redesigning-your-product-and-website-for-dark-mode" target="_blank">Stuff &amp; Nonsense: Redesigning your product and website for dark mode</a></li>
  </ul>
</article>
              
            
!

CSS

              
                :root {
  --color-background: #efefef;
  --color-text-default: #1a1a1a;
  --color-accent: #008700;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #1a1a1a;
    --color-text-default: #ccc;
    --color-accent: #00b900;
  }
}

html {
  background-color: var(--color-background);
  color: var(--color-text-default);
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

article {
  margin: 2em auto;
  max-width: 640px;
}

h1 {
  font-size: 2.5rem;
}

p, ul {
  font-size: 1.25rem;
}

pre {
  font-size: 1.5rem;
  overflow-x: scroll;
}

a, a:visited {
  color: var(--color-accent);
  transition: color 0.3s ease-out;
}

a:hover, a:focus {
 color: var(--color-text-default); 
}
              
            
!

JS

              
                
              
            
!
999px

Console