Pen Settings



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


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.


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.


    %h1 Hero section
    %p Resize the browser window to see the section height and content position update.

    %h2 Next section
    %h2 Third section


  font-family: Helvetica, sans-serif

body, html
  height: 100%

body, h1, h2
  margin: 0
  padding: 0

h1, h2, p
  padding: 0 40px
  background-color: #eee
  position: relative
  height: 100%
  left: 0
  max-width: 960px
  margin: 0 auto
  position: absolute
  right: 0
  top: 50%
  -webkit-transform: translateY(-50%)
  -moz-transform: translateY(-50%)
  transform: translateY(-50%)


                class browserHeightSection

  constructor: ->
    resizeSection = debounce( =>
    , 50)

    window.addEventListener "resize", resizeSection

  increaseSectionHeight: =>
    windowHeight = window.innerHeight || document.documentElement.clientHeight

    $('section').height(windowHeight).each () ->
      section = $(this).find('.inner')
      sectionTopMargin = (section.height() / 2) * -1 + 'px'
      section.css('margin-top', sectionTopMargin)

  debounce = (func, wait, immediate) ->
    timeout = undefined
      context = this
      args = arguments
      later = ->
        timeout = null
        func.apply context, args  unless immediate

      callNow = immediate and not timeout
      clearTimeout timeout
      timeout = setTimeout(later, wait)
      func.apply context, args  if callNow

$ ->
  if $('.csstransforms').length == 0
    new browserHeightSection()