Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource


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


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.


Auto Save

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.


                <main class="cards">
  <section class="card">
    <h2>Lorem Egestas Tristique Ligula</h2>
    <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum. Nullam quis risus eget urna mollis ornare vel eu leo.</p>
  <section class="card">
    <h2>Cras Fermentum Bibendum Dolor</h2>
    <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nullam quis risus eget urna mollis ornare vel eu leo.</p>
  <section class="card">
    <h2>Pharetra Mattis Tristique Mollis Quam</h2>
    <p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
  <section class="card">
    <h2>Nullam Aenean</h2>
    <p>Vestibulum id ligula porta felis euismod semper. Nullam quis risus eget urna mollis ornare vel eu leo.</p>
  <section class="card">
    <h2>Porta Venenatis Sollicitudin Pharetra</h2>
    <p>Nullam quis risus eget urna mollis ornare vel eu leo. Sed posuere consectetur est at lobortis.</p>
  <section class="card">
    <h2>Fermentum Lorem Parturient Dapibus</h2>
    <p>Donec ullamcorper nulla non metus auctor fringilla. Aenean lacinia bibendum nulla sed consectetur.</p>


                /* Sizes that the rest of our system will be based on */
$ft-screen-width: 1440;
$ft-body: 20;
$ft-body-min: 0.75rem; /* Going this small for demo purposes */
$ft-body-max: 2rem;
$ft-body-vw: $ft-body / $ft-screen-width * 100vw;

/* All of the other sizes we want. The key can be any
   string, and the value should be in pixels without
   the unit */
$ft-sizes: (
  heading: 26,
  small: 12

/* Mixin to generate the the fluid sizes as
   custom properties */
@mixin sizeVar($name, $size, $min: false, $max: false) {
  $proportion: $size / $ft-body;
  @if not $min {
    $min: $ft-body-min * $proportion;
  @if not $max {
    $max: $ft-body-max * $proportion;
  $vw: $ft-body-vw * $proportion;
  --ft-size-#{$name}: clamp(#{$min}, #{$vw}, #{$max});

/* Style mixins to more easily manage font styles */
@mixin style-body() {
  --space-1rem: 1em;
  font-family: Georgia, serif;
  font-size: var(--ft-size-body);
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  word-spacing: normal;

@mixin style-heading() {
  --space-1rem: 0.77em;
  font-family: sans-serif;
  font-size: var(--ft-size-heading);
  font-style: normal;
  font-weight: 400;
  line-height: 1.25;
  text-transform: uppercase;
  word-spacing: 0.15em;

/* Declare the body font size custom property, then use the
   mixin to generate all of the other custom properties */
:root {
  --ft-size-body: clamp(#{$ft-body-min}, #{$ft-body-vw}, #{$ft-body-max});
  @each $name, $size in $ft-sizes {
    @include sizeVar($name, $size);

body {
  @include style-body;
  padding: 1em;

h2 {
  @include style-heading;
  margin-bottom: calc(var(--space-1rem) - 0.25em); // Shave a little bit off of this; there is a difference between exact numerical spacing and better optical spacing
  margin-top: 0;

p {
  margin-bottom: var(--space-1rem);
  margin-top: 0;
  &:last-child {
    margin-bottom: 0;

.cards {
  column-gap: 1em;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 1em;

.card {
  border: 1px solid black;
  padding: 1em;