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. 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


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


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.


      h3 Clean markup
        label(for="file") Attachment
          input.file(type='file', name='file', size='40', id="file")

      h3 WordPress contact form 7 plugin
      label Attachment
          input.wpcf7-form-control.wpcf7-file(type='file', name='file-input', size='40')



  position: absolute // hide and stretch
  top: 0
  left: 0
  width: 100%
  height: 100%
  opacity: 0
  z-index: 10
  cursor: pointer

  @extend %input // add standard input styles
  display: block
  position: relative
  overflow: hidden
  cursor: pointer
    content: '\00a0' // by default it\'s empty, avoid 0 height
    content: 'Choose file' // or data attribute
    @extend %button  // add button
    position: absolute
    top: 0
    right: 0
    bottom: 0 // to stretch it, just in case

  @extend %hidden-input  
  @extend %file-input
label[for], span.floating-label
  @extend %floating-label

$text: black
$bg: white

$label: $text

  padding: .75em 1.5em
  appearance: none
  outline: none
  line-height: normal
  border-radius: 0
  border: none
  @extend %block
  font: inherit
  line-height: normal
  cursor: pointer

  text-transform: uppercase
  text-align: center
  letter-spacing: #{(2/14)}em
  border-width: 2px 
  border-style: solid

  transition: all .3s cubic-bezier(0.5, 0.000, 0.000, 1.000)

  // &:active:not(select):not(input):not([class*=Select])
  //   position: relative
  //   top: 1px
  //   left: 1px

  @extend %button-style

  background-color: $text
  border-color: $text
  color: white

  &:hover, &:focus, &:active
    color: $text
    background: white
    border-color: $text
    text-shadow: none

  padding: calc(.75em + 2px) 1.25em
  appearance: none
  outline: none
  line-height: normal
  border-radius: 0
  border: none

  @extend %form-block

  font: inherit
  line-height: normal
  width: 100%
  box-sizing: border-box
  display: block

  background: rgba(black,.05)
  outline: none
  border: none
  box-shadow: inset 0 1px 1px 0px rgba(black,.1)
  transition: all .15s ease

  color: inherit

    color: inherit

  &.error, .error &
    background-color: mix(red,white,10%)
  .form:not(.has-floated-label) &
    &:active, &:focus
      border-color: transparent transparent $text transparent

    box-shadow: inset 0 2px 1px 0px rgba(black,.2)
    background: rgba(black,.1)

  font-size: .75rem
  font-weight: 600
  text-transform: uppercase
  color: inherit
  letter-spacing: .1em

  @extend %form-block
  position: absolute
  z-index: 10
  pointer-events: none
  @extend %floated
  top: 0
  left: 0
  color: inheir
  transition: color .3s
  &.active, .active &
    @extend %label-style
    padding-left: 0
    top: auto
    bottom: 100%
    line-height: 1

  .focus &
    color: inherit
    pointer-events: auto

  max-width: 60rem
  margin: 2rem

  > label, > p
    margin: 1.5em 0
    position: relative
    display: block
      display: none
p + h3
  margin-top: 2em
  margin-bottom: 1.5em

  .background-gradient &
    background: linear-gradient(to right bottom, #f3904f, #3b4371)
    color: white
    text-shadow: 0 1px 2px rgba(black,.5)
    fill: black


                class customFileInput

  constructor: ( fileInputs ) ->
    for fileInput in fileInputs
      fileInput.form.classList.add 'has-custom-file-inputs'
      fileInput.classList.add 'custom-file-input'

      fileInput.addEventListener 'change', ->
        files = ( for file in @files )
        if @parentNode.lastChild.nodeValue
          @parentNode.lastChild.nodeValue = files.join(', ') 
          @parentNode.appendChild document.createTextNode(files.join(', '))
new customFileInput document.querySelectorAll('[type=file]')

# additional

class floatingLabel
  constructor: ( labels, classes={} ) ->
    classes.focus ||= "focus" ||= "active"
    classes.error ||= "error"

    for label in labels

      return unless input = label.control

      if label.querySelector('input, textarea')
        span = document.createElement('span')
        span.appendChild document.createTextNode(label.firstChild.nodeValue)
        label.replaceChild span, label.firstChild
        label = label.firstChild
      label.classList.add 'floating-label'
      input.form.classList.add 'has-floating-labels'
      while (input.parent ||= input).tagName not in ['DIV','P','LI']
        input.parent = input.parent.parentNode
      for event in ['keyup','input', 'change']
        input.addEventListener event, ->
          @parent.classList.remove classes.error
          @parent.classList.toggle, !!@value
      input.addEventListener 'focus', ->
        @parent.classList.add classes.focus
      input.addEventListener 'blur', ->
        @parent.classList.remove classes.focus
      input.parent.classList.toggle, !!input.value
new floatingLabel document.querySelectorAll('form label')