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

              
                
  <h1>H1 - Lorem ipsum dolor, sit amet consectetur adipisicing elit. Pariatur provident deleniti impedit a recusandae ipsam reprehenderit voluptatem sequi reiciendis autem officiis, maiores doloribus odit? Itaque optio hic ad quod laudantium!</h1>
  <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Aliquid dolore officiis velit molestiae pariatur, id perferendis? Repudiandae neque consectetur nemo!</p>
  <h2>H2 - Lorem ipsum dolor, sit amet consectetur adipisicing elit. Pariatur provident deleniti impedit a recusandae ipsam reprehenderit voluptatem sequi reiciendis autem officiis, maiores doloribus odit? Itaque optio hic ad quod laudantium!</h2>
  <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Facilis nostrum consequatur odit excepturi magni iusto numquam possimus veniam aperiam rerum quo doloremque, ipsam, in culpa odio quae adipisci dolore. Pariatur.</p>
  <h3>H3 - Lorem ipsum dolor sit amet consectetur, adipisicing elit. Et assumenda facere dolore laboriosam quod eos sed soluta architecto eligendi corporis?</h3>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Minima, ipsa reiciendis. Magni omnis itaque facere odit debitis aperiam quod incidunt maxime dolor iusto corrupti, et expedita ipsam corporis nihil ab.</p>
  <h4>H4 - Lorem ipsum, dolor sit amet consectetur adipisicing elit. Suscipit eaque deleniti dignissimos itaque adipisci voluptas illo distinctio repellendus hic praesentium.</h4>
  <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Magni aut quia blanditiis. Eaque doloribus fugiat illum officiis minus, incidunt aperiam. Vero ab ratione quo accusamus soluta quasi officiis minus aut illum, dolores beatae esse itaque ullam temporibus, sed quod corrupti.</p>
  <h5>H5 - Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error magnam, voluptatibus iste harum officia repellat at nulla necessitatibus quos blanditiis.</h5>
  <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Aspernatur et sint natus porro, incidunt odio iure dolorem mollitia a officia.</p>
  <h6>H6 - Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eius ducimus, perspiciatis neque quis atque harum!</h6>
  <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Commodi facilis eius fugiat culpa quibusdam.</p>

<h3 class="title">Title class</h3>

<h3 class="canon">Canon class</h3>



              
            
!

CSS

              
                /// Settings
///

$baseline         : 4px;
$base             : 16px;

/// Typography sizes
///
/// @type map
///
$types: (
  'canon'         : (
    'base'        : 36px,
    'small'       : 32px
  ),
  'doublepica'    : (
    'base'        : 32px,
    'small'       : 28px
  ),
  'paragon'       : (
    'base'        : 28px,
    'small'       : 26px
  ),
  'columbian'     : (
    'base'        : 24px
  ),
  'primer'        : (
    'base'        : 20px
  ),
  'pica'          : (
    'base'        : 16px
  ),
  'brevier'       : (
    'base'        : 14px
  ),
  'minion'        : (
    'base'        : 12px
  )
);

/// Typography tokens
///
/// @type map
///
$type-tokens: (
  heading-01: (
    size: 16px,
    line: 20px,
    weight: 700,
  )
);


/// Breakpoints
///
/// @type map
///
$breakpoints: (
  'small'         : 480px,
  'medium'        : 740px,
  'large'         : 992px,
  'xlarge'        : 1200px
);

/// Typography tokens
///
@mixin type($type) {
  font-size: map-get(map-get($type-tokens, $type), size);
}

@each $type, $name in $type-tokens {
  .#{$type} {
    @include type($type);
  }
}

//
// Tools
//

// PX to REM function
@function rem($value) {
  $rem-value: $value / $base; 
  @return #{$rem-value}rem;
}

// Return breakpoint value from breakpoints map
@function mq($bp) {
  @return map-get($breakpoints, $bp);
}

// Return type value from types map, specifying what $size you need
@function type-size($type, $size) {
  @return map-get(map-get($types, $type), $size);
}

// Breakpoint mixin
@mixin bp($breakpoint) {
  @if map-has-key($breakpoints, $breakpoint) {
    $breakpoint-value: map-get($breakpoints, $breakpoint);
    
    @media screen and (min-width: $breakpoint-value) {
      @content;
    }
  }
  
  @else {
    @warn 'Invalid breakpoint: #{$breakpoint}.';
  }
}

// Resposive type size based on type map values - media query is defined in it, not editable
@mixin type-size($type) {
  $size-small-px: type-size($type, small);
  $size-base-px: type-size($type, base);

  @if map-has-key(map-get($types, $type), small) {
    font-size: rem($size-small-px);
    @include bp(medium) {
      font-size: rem($size-base-px);
    }
  }
  @else {
    font-size: rem($size-base-px);
  }
  line-height: calc(1em + #{$baseline});
}

// Loop throught types map printing classnames based on type names
@each $type, $sizes in $types {
  .#{$type} {
    @include type-size($type)
  }
}

//
// Styles
//

body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

html {
  font-size: 100%;
}

h1 {
  @include type-size(canon);
}

h2 {
  @include type-size(paragon);
}

h3 {
  @include type-size(doublepica);
}

h4 {
  @include type-size(columbian);
}

h5 {
  @include type-size(primer);
}

h6 {
  @include type-size(pica);
}

.title {
  @include type-size(canon);
}
              
            
!

JS

              
                
              
            
!
999px

Console