css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              header.m-main-header
.row
  .small-12.small-centered.medium-8.columns
    .panel.m-panel.shadow
      .row.collapse
        .small-12.columns
          header.form-header
            h2 
              'Form example
              small This is foundation !
      .row
        .small-12.columns
          form
            .row
              .small-4.columns
                p.notice
                  'Simple input
              .small-8.columns
                .form-group-material
                  label.material-label for="name" Name
                  input#name.material-field type="text" required="required"
            .row
              .small-4.columns
                p.notice
                  'Input with an error
              .small-8.columns
                .form-group-material.error
                  label.material-label for="firstname" Firstname
                  input#firstname.material-field type="text"
                  small.error Your firstname can't be a number.
            .row
              .small-4.columns
              .small-8.columns
                .form-group-material
                  label.material-label for="email" E-mail
                  input#email.material-field type="email"
            .row
              .small-4.columns
                p.notice
                  'Inputs in any grid
              .small-8.columns
                .row
                  .small-8.columns
                    .form-group-material
                      label.material-label for="city" City
                      input#city.material-field type="text"
                  .small-4.columns
                    .form-group-material
                      label.material-label for="zipcode" Zip code
                      input#zipcode.material-field type="number"
            .row
              .small-12.small-push-4.columns
                button Send it !
            .row
              .small-12.columns.text-right
                a.credits href="https://twitter.com/Dathink" target="_blank"
                  i.fa.fa-twitter>
                  '@Dathink
              
            
          
!
            
              $primary: #4527A0
$primary-light: #7E57C2
$secondary: #E91E63
$neutral: #ffffff
$error: #F44336
$dark: #000000
$bg-color: #f9f9f9
$gray-light: lighten($dark, 90%)

$font-family-body: Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif 

body
  font: 1em/1.45 $font-family-body

h1, h2, h3, h4, h5, h6
  font-family: $font-family-body
  font-weight: 300

a
  color: $primary
  &:hover
    color: $primary-light
  
.m-main-header
  background: $primary
  min-height: 120px

.shadow
  box-shadow: 0 2px 4px -1px rgba($dark, 0.3)
  
.m-panel
  border: 0
  background: $neutral
  margin-top: -50px
  border-top: 5px solid $primary-light

.form-group-material
  position: relative
  margin-top: 16px
  margin-bottom: 26px
  &:after
    height: 1px
    background: $gray-light
    width: 100%
  &:before
    height: 2px
    background: $secondary
    z-index: 1
    width: 0
    transition: width .3s
  &:after, &:before
    display: block
    content: ''
    position: absolute
    bottom: 0
  &.error
    margin-bottom: 36px
    &:before
      background-color: $error
  
  &.focused
    &:before
      width: 100%
    
.error small.error
  position: absolute
  background: transparent
  color: $error
  font-style: normal
  padding-left: 0

.material-label
  display: block
  width: 100%
  position: absolute
  top: 50%
  transform: translateY(-50%)
  line-height: 1
  cursor: text
  color: darken($gray-light, 20%)
  transition: transform ease .3s, color ease .3s
  transform-origin: 0 0
  .error &
    color: $error
  .focused &
    transform: translateY(-220%) scale(.82)
    color: $secondary
  .error.focused &
    color: $error
  .has-value &
    transform: translateY(-220%) scale(.82)

input, textarea
  &.material-field
    border-width: 0
    padding-left: 0
    padding-right: 0
    box-shadow: none
    margin: 0
    background: transparent
    &:focus
      box-shadow: none
      background: none

button
  border-radius: 3px
  padding: 8px 18px
  font-family: $font-family-body
  background: $secondary
  &:hover
    background: lighten($secondary, 20%)
  
p
  &.notice
    font-size: 13px
    color: #6f6f6f
    margin-top: 26px
    
.form-header
  h2
    margin-bottom: 20px

.credits
  font-size: 13px
  
            
          
!
            
              materialForm = ->
  $('.material-field').focus(->
    $(this).closest('.form-group-material').addClass 'focused has-value'
  ).focusout(->
    $(this).closest('.form-group-material').removeClass 'focused'
  ).blur ->
    if !@value
      $(this).closest('.form-group-material').removeClass 'has-value'
    $(this).closest('.form-group-material').removeClass 'focused'

$ ->
  materialForm()
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console