Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <!-- Read the article: http://sassbreak.com/viewport-relative-headings-with-sass -->
<h1 class="headline">An Awesome Headline</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sit amet erat ligula. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin porttitor vulputate augue et sagittis. Proin varius ac urna non laoreet. Aliquam lacinia sapien sed.</p>
              
            
!

CSS

              
                // Read the article: http://sassbreak.com/viewport-relative-headings-with-sass

// Max breakpoint
$max-breakpoint: 1025;

// This could be one of your media query breakpoint variables
$wide-screen: "(min-width: #{$max-breakpoint}px)"; 

// Function
@function get-vw($target) {
  // 1 vw is equal to 1% of the viewport width
  $vw-context: ($max-breakpoint * .01) * 1px; // 1% viewport width
  @return ($target/$vw-context) * 1vw;
}

// Mixin
@mixin vw($size) {
  font-size: get-vw($size);
  // Prevent font-size from getting too big
  @media #{$wide-screen} {
    font-size: $size;
  }
}

// If the width of the viewport is 1025px or wider, the font size will remain at 72px. Otherwise, the value will adjust as 7.2vw.
.headline {
  font-size: 4.5em; // Fallback
  @include vw(72px);
}
              
            
!

JS

              
                // Read the article: http://sassbreak.com/viewport-relative-headings-with-sass
              
            
!
999px

Console