Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

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


Auto Save

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.


                link(href='', rel='stylesheet', type='text/css')

h1 Search input + animated suggestions
h2 Animation in Sass, simple script in CoffeeScript

      i.fa.fa-search"text", placeholder="Search people")


                // Importing bourbon to make things easy:
@import "bourbon"

// Useful mixins
@mixin border-radius($radius: 4px)
  @include prefixer(border-radius, $radius, webkit moz spec)
@mixin box-sizing($box-model)
  @include prefixer(box-sizing, $box-model, webkit moz spec)
/* General styles */

  background-color: white
  font-family: 'Roboto', Arial, sans-serif
  text-align: center
  padding-top: 30px
  font-size: 14px
  font-size: 1.5em
  color: #666666
h2, a
  font-size: 0.8em
  color: #9BC788
  color: #999
  margin-top: 40px

/* ============================ */
/* VARIABLES                    */
/* ============================ */
$color-primary: #9BC788
$search-width: 400px
$search-icon-width: 32px
$search-height: 40px
$visible-results: 5
/* ============================ */
/* SEARCH BAR                   */
/* ============================ */
  margin: 40px auto
  width: $search-width
  @include border-radius(3px)
  background-color: #f2f2f2
  height: $search-height
  position: relative
  @include box-sizing(border-box)
  float: left
  width: $search-icon-width
  height: $search-height
  color: #999
  font-size: 1.3em
  padding: 7px 15px
  @include box-sizing(border-box)
  width: $search-width - $search-icon-width
  height: $search-height
  float: right
  background-color: transparent
  border: 0px
  padding: 10px
  text-transform: uppercase
  font-family: 'Roboto', Arial, sans-serif
  font-size: 1em
  position: relative
  outline: 0px
//useful for animation
@include keyframes(fadeInTop)
    opacity: 0
    @include transform(translateY(-1.334em) translateZ(0))
    opacity: 1

@mixin fadeInTop($dur: 1s, $delay: 0s, $fill: forwards)
  @include prefixer(animation, fadeInTop $dur $delay $fill, webkit spec)

  list-style: none
  margin: 0
  padding: 0
  position: absolute
  z-index: 999
  width: $search-width - $search-icon-width
  max-height: $search-height * $visible-results
  overflow: scroll
  top: $search-height
  left: $search-icon-width
  text-align: left
    @include box-sizing(border-box)
    padding: 10px
    height: $search-height
    background-color: $color-primary
    color: white
    font-weight: bold
      background-color: darken($color-primary, 7%)
      cursor: pointer
    /* ANIMATION */
    /* remove this part if you dont like the animation */
    @for $i from 1 through $visible-results
        /* Animation */
        @include fadeInTop(0.4s, (($i - 1)/10) * 1s )
        opacity: 0


                names = [

# Match words in a collection
findAll = (wordList, collection) =>
  collection.filter (word) ->
    word = word.toLowerCase()
    wordList.some (w) -> ~word.indexOf w

# Displays results in a list
displayResults = (resultsEl, wordList) ->
  resultsEl.innerHTML = ( (w) -> '<li>'+w+'</li>').join ''

# Handle keyboard events
searchInput = document.getElementById 'search'
resultsOutput = document.getElementById 'results'
maxResults = 7

searchInput.addEventListener 'keyup', (e) =>
    value = searchInput.value.toLowerCase().split ' '
    suggested = (if value[0].length then findAll value, names else [])
    displayResults resultsOutput, suggested