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

            
              <article class="card">
  <h1 class="title">
    Rescale components in an intuitive way with RFS
  </h1>
  <p>
    This card uses <a href="https://github.com/twbs/rfs" target="_blank">RFS</a> to rescale <code>margin</code>, <code>padding</code>, <code>font-size</code>, <code>box-shadow</code> &amp; <code>border-radius</code>. Resize the codepen to see it in action.
  </p>
  <p>
    This is the codepen example using the PostCSS plugin to rescale values, for more demo's and documentation, check the <a href="https://github.com/twbs/rfs" target="_blank">Github repo</a>.
  </p>
  <p class="small">
    Made by
    <a href="https://twitter.com/Martijn_Cuppens" target="_blank" title="Visit Martijn's Twitter profile">Martijn Cuppens</a>
  </p>
</article>
            
          
!

CSS

            
              /* Bootstrap's reboot is included to reset some styles */
/* Roboto Slab is included from Google fonts */
/* Some default styles, eg. to center the card, are included from another pen  */

.card {
  max-width: 540px;
  padding: rfs(3rem);
  margin: rfs(2rem);
  background-color: #fff;
  box-shadow: rfs(0 0 2rem rgba(0, 0, 0, .25));
  border-radius: rfs(4rem);
}
  
.card > :last-child {
  margin-bottom: 0;
}

.title {
  margin-bottom: .5em;
  font-size: rfs(2.125rem);
  font-weight: 400;
  line-height: 1.2;
}
            
          
!

JS

            
              // If you want to use the rfs() function in your codepen, just add the following pen to your codepen scripts:
// https://codepen.io/MartijnCuppens/pen/KOPxKW


// This technique is used to make use of the RFS PostCSS plugin:
// https://codepen.io/jonneal/post/testing-postcss-plugins#creating-a-browser-safe-version-of-a-postcss-plugin-0
            
          
!
999px

Console