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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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 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