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

              
                <p class="rhythm-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque gravida eget massa a tincidunt. Morbi interdum elit at sapien vestibulum sodales.</p>
<p class="rhythm-s">Morbi efficitur et ipsum sit amet ullamcorper.</p>
<p class="rhythm-m">Curabitur vel est eget sapien scelerisque efficitur a sit amet risus. Sed scelerisque tortor mi, vel venenatis odio tempor eu. Vestibulum a aliquet nibh.</p>
<p class="rhythm-s">Phasellus mattis vulputate felis, eget porta lectus maximus ac. Proin sed mi vitae diam tempus pharetra.</p>
              
            
!

CSS

              
                // See https://pilot.co/blog/implementing-baseline-rhythm-in-css/

/*
 * Config
*/

$line-height: 24px;

$font-sizes:  (s: 13px, m: 15px, l: 19px, xl: 27px);
$cap-heights: (s: 0.8,  m: 0.8,  l: 0.68, xl: 0.68);

// Accepts `s`, `m`, `l`, or `xl`
@function rhythm-shift($size-name) {
  $font-size: map-get($font-sizes, $size-name);
  $cap-height: map-get($cap-heights, $size-name);

  $offset: ($line-height - $cap-height * $font-size) / 2;
  @return round($offset);
}

/*
 * Solution 2
*/

$offset-s: rhythm-shift(s);
$offset-m: rhythm-shift(m);

.rhythm-s {
  font-size: map-get($font-sizes, s);
  padding-top: $offset-s;
  margin-bottom: -1 * $offset-s;
}

.rhythm-m {
  font-size: map-get($font-sizes, m);
  padding-top: $offset-m;
  margin-bottom: -1 * $offset-m;
}

/*
 * Meta
*/

html {
  $grid-color: rgba(red, 0.15);
  background: linear-gradient($grid-color, $grid-color 1px, transparent 1px);
  background-size: 1px $line-height;
}

body {
  max-width: 400px;
  margin: 0 auto;
  padding: (2 * $line-height) $line-height;
  font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
  line-height: $line-height;
}
              
            
!

JS

              
                
              
            
!
999px

Console