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

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
  .form-field.example-bad
    input.input(type="text", placeholder="Email")
    
  .form-field.example-good
    input.input(type="text", placeholder="Email")
              
            
!

CSS

              
                placeholder()
  &::-webkit-input-placeholder
    {block}
  &:-moz-placeholder
    {block}
  &::-moz-placeholder
    {block}
  &:-ms-input-placeholder
    {block}

@font-face
  font-family: 'AltisMedium'
  src: url('https://mojotech-static.s3.amazonaws.com/m4/fonts/altis/altis-medium-webfont.eot')
  src: url('https://mojotech-static.s3.amazonaws.com/m4/fonts/altis/altis-medium-webfont.eot?#iefix') format('embedded-opentype'),
       url('https://mojotech-static.s3.amazonaws.com/m4/fonts/altis/altis-medium-webfont.woff2') format('woff2'),
       url('https://mojotech-static.s3.amazonaws.com/m4/fonts/altis/altis-medium-webfont.woff') format('woff'),
       url('https://mojotech-static.s3.amazonaws.com/m4/fonts/altis/altis-medium-webfont.ttf') format('truetype'),
       url('https://mojotech-static.s3.amazonaws.com/m4/fonts/altis/altis-medium-webfont.svg#altismedium') format('svg')
  font-style: normal
  font-weight: normal

html,
body
  font-family: 'AltisMedium'
  height: 100%
  
*
  box-sizing: border-box
  
input
  outline: 0

form
  margin: -40px auto
  position: relative
  top: 50%
  transform: translateY(-50%)
  width: 300px
  
.form-field
  margin: 40px 0
  position: relative
  
  &:before
    background: url('https://mojotech-static.s3.amazonaws.com/m4/blog-post-assets/email.svg')
    content: ""
    height: 16px
    margin-top: -8px
    opacity: 0.5
    position: absolute
    right: 20px
    top: 50%
    transform: translate3d(0,0,0)
    transition: opacity 0.2s ease
    width: 20px
    z-index: 1

.input
  border: 1px solid rgba(#B5CBE6, 0.3)
  padding: 20px
  position: relative
  width: 100%
     
  .example-good &
    border-radius: 6px
    box-shadow: inset 0 1px 2px rgba(black, 0.1), 0 0 0 0 rgba(#279EFD, 0.2)
    color: #8197B2
    padding-right: 60px
    transition: all 0.2s ease
    
    +placeholder()
       color: #B5CBE6
       transition: color 0.2s ease
       
    &:hover
      border-color: rgba(#B5CBE6, 0.6)
     
    &:focus
      border-color: #A8DAFF
      box-shadow: inset 0 0 0 rgba(black, 0.1), 0 0 0 2px rgba(#279EFD, 0.2)
      +placeholder()
         color: rgba(#B5CBE6, 0.5)
         
.example-good.is-focused
  &:before
    opacity: 0.25
  
.example-bad
  &:before
    background: url('https://mojotech-static.s3.amazonaws.com/m4/blog-post-assets/email-gray.svg')
  .input
    border-color: rgba(#9B9B9B, 0.25)
    border-radius: 2px
    
    +placeholder()
       color: #B0B5B5
    
    &:focus
      border-color: #A8DAFF
              
            
!

JS

              
                $(function() {
  $(".input").on('focus blur', function(){
    $(this).parent().toggleClass('is-focused');
  });
});
              
            
!
999px

Console