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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                .form-card
  .avatar
  form.material
    .material-input
      label Username
      input(type="text")
    .material-input
      label Email
      input(type="text")
    .material-input
      label Password
      input(type="password")
    .material-input
      label Confirm Password
      input(type="password")
  .buttons
    button.cancel Cancel
    button.update Create Account
              
            
!

CSS

              
                @mixin hoverize($color)
  background: desaturate($color, 25%)

body
  font-family: 'Quattrocento Sans', sans-serif
  font-size: 16px
  width: 100%
  height: 100%
  min-height: 100vh
  display: flex
  justify-content: center
  align-items: center
  background:
    image: linear-gradient(30deg, RoyalBlue, pink)
    size: cover

.form-card
  background: white
  padding: 4rem 2rem
  width: 60%
  @media only screen and (max-width: 680px)
    width: 70%
  max-width: 460px
  box-shadow: 0 8px 22px transparentize(black, 0.60)
  position: relative
  border-radius: 12px
  margin-top: 30px
  
.avatar
  position: absolute
  top: -50px
  left: 50%
  width: 100px
  height: 100px
  background: white
  margin-left: -60px
  box-shadow: 0 12px 12px transparentize(black, 0.75)
  border: 5px solid white
  border-radius: 50%
  background:
    image: url('https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&s=707b9c33066bf8808c934c8ab394dff6')
    position: center -18px
    repeat: no-repeat
    size: 110px
    
form.material
  position: relative
  padding-bottom: 40px
  
.material-input
  position: relative
  padding-top: 20px
  transition: all .15s ease-out
  width: 90%
  margin: 0 auto 20px
  
  label
    position: absolute
    pointer-events: none
    left: 4px
    top: 20px + 6px
    color: darkgray
    transform: scale(1.1)
    transition: all .15s ease-out
    
  input
    border: none
    width: 100%
    color: darken(DarkGray, 45%)
    border-bottom: 2px solid darkgray
    padding: 6px 4px
    outline: none
    transition: all .15s ease-out
    
  &.materialize
    input
      border-bottom: 2px solid crimson
    label
      top: 0
      left: 0
      color: crimson
      transform: scale(0.95)

.buttons
  position: absolute
  width: 100%
  bottom: 0
  left: 0
  display: flex
  justify-content: space-between
  
  & button
    padding: 20px
    margin: 0
    width: 50%
    color: white
    text-shadow: 0 0 8px transparentize(black, 0.5)
    border: none
    cursor: pointer
    
    transition: all 0.25s ease-in-out
    
    &.cancel
      background: Crimson
      border-bottom-left-radius: 8px
      
      &:hover
        @include hoverize(Crimson)
      
    &.update
      background: LimeGreen
      border-bottom-right-radius: 8px
      
      &:hover
        @include hoverize(LimeGreen)
    
              
            
!

JS

              
                const form = document.querySelector('form')
const materialInputs = form.querySelectorAll('.material-input > input')

function materialize() {
  this.parentElement.classList.add('materialize')
}

function dematerialize() {
  if (this.value === '')
    this.parentElement.classList.remove('materialize')
}

materialInputs.forEach(input => {
  input.addEventListener("focus", materialize)
  input.addEventListener("blur", dematerialize)
});

              
            
!
999px

Console