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

              
                <center>
  <form>
    <input type="search" id="brand-filter" placeholder="Search..." name="brands" data-list="brands-list" autocomplete="off" required />
    <label for="brand-filter" data-icon="&#128269;"></label>
    <datalist id="brands-list">
      <select>
      <option value="Adidas" />
      <option value="Alexander McQueen" />
      <option value="Armani" />
      <option value="Balenciaga" />
      <option value="Burberry" />
      <option value="Calvin Klein" />
      <option value="Comme Des Garcons" />
      <option value="Diesel" />
      <option value="DKNY" />
      <option value="Dolce & Gabbana" />
      <option value="Dries Van Noten" />
      <option value="Etro" />
      <option value="Fred Perry" />
      <option value="Hugo Boss" />
      <option value="Helmet Lang" />
      <option value="Jil Sander" />
      <option value="Louis Vuitton" />
      <option value="Marc Jacobs" />
      <option value="Margaret Howell" />
      <option value="Marni" />
      <option value="Missoni" />
      <option value="Moncler" />
      <option value="Nike" />
      <option value="Paul Smith" />
      <option value="Prada" />
      <option value="Puma" />
      <option value="Raf Simons" />
      <option value="Rag & Bone" />
      <option value="Rick Owens" />
      <option value="Sacai" />
      <option value="Stone Island" />
      <option value="Yohji Yamamoto" />
      </select>
    </datalist>
  </form>
</center>
              
            
!

CSS

              
                @import "compass/css3";

// HTML5 Search Filter
// -----------------------------------------------------
// Coded up this nifty little shot by Joris Rigerl -
// http://dribbble.com/shots/1165145-Product-Filter-animated

// Imports
// -----------------------------------------------------
// Font - Entypo
@import url(http://weloveiconfonts.com/api/?family=entypo);

// Mixins
// -----------------------------------------------------
// Input placeholder attribute
@mixin input-placeholder {
  @if $experimental-support-for-webkit {
    &::-webkit-input-placeholder { @content; }
  }
  @if $experimental-support-for-mozilla {
    &::-moz-placeholder { @content; }
  }
  @if $experimental-support-for-microsoft {
    &:-ms-input-placeholder { @content; }
  }
}

body {
  // Scroll Bars
  // IE
  scrollbar-base-color: #fff;
  scrollbar-track-color: #7ad7c7; 
  scrollbar-3dlight-color: #fff;
  scrollbar-highlight-color: #fff;
  scrollbar-arrow-color: #7ad7c7;
  scrollbar-shadow-color: #fff;
  scrollbar-dark-shadow-color: #fff;
}

// Entypo - Data Icons
[data-icon]:after {
  font-family: "entypo";
  content: attr(data-icon);
  speak: none;
} 

// Input - Search
input[type="search"] {
  // Hide the placeholder until :focus
  &::-webkit-input-placeholder {
    color: transparent;
  }
  &::-moz-input-placeholder {
    color: transparent;
  }
  &:-ms-input-placeholder {
    color: transparent;
  }
  /*@include input-placeholder {
    color: transparent;
  }*/ 
  @include border-radius(5px);
  width: 196px;
  height: 36px;
  padding: 0;
  line-height: 32px;
  background: #56e2c9;
  color: #fff;
  border: 0;
  font: bold italic 14px Arial,Helvetica,sans-serif;
  text-indent: 12px;
  outline: none;
  -webkit-appearance: textfield;
 
  // Input - Search - Cancel and Results Button
  &::-webkit-search-cancel-button,
  &::-webkit-search-results-button,
  &::-webkit-search-results-decoration {
    -webkit-appearance: none;
    width: 32px;
    height: 32px;
    line-height: 30px;
    color: white;
    text-align: left;
    cursor: pointer;
      
    // Input - Search - Cancel and Results Button
    // Custom content / styling
    &:before {
      position: absolute;
      content: 'x';
      font-style: normal;
    }
  }
    
  &:invalid {
    border: 0 !important;
      
    &::-webkit-search-cancel-button,
    &::-webkit-search-results-button,
    &::-webkit-search-results-decoration {
      // Input - Search - Cancel and Results Button
      // Custom content / styling
      &:before {
        font-family: "entypo";
        content: attr(data-icon);
      }
    }    
  }

  + label {
      position: absolute;
      margin: 8px 0 0 -30px;
      cursor: pointer;
      
      &:before {
        position: absolute;
        content: 'Brand Filter';
        left: -152px;
        width: 180px;
        color: #fff;
        font: bold 14px/20px "Arial", sans-serif;
        text-align: left;
      }

      // Entypo - Icon - Down Arrow
      &:after {
        margin-left: 7px;
        color: #fff;
        content: '\25BE';
      }    
  }
  
  &:focus {    
    // Show the placeholder if the form is in focus
    &::-webkit-input-placeholder {
      font-weight: normal;
      color: #fff;
    }
    &::-moz-input-placeholder {
      font-weight: normal;
      color: #fff;
    }
    &:-ms-input-placeholder {
      font-weight: normal;
      color: #fff;
    }
    /*@include input-placeholder {
      font-weight: normal;
      color: #fff;
    } */    
      
    // Show the search icon if the form is in focus and empty
    &:invalid + label {     
      &:before {
        display: none;
      }
      // Entpyo - Icon - Search
      &:after {
        margin-left: 4px;
        content: attr(data-icon);
      }
    }  
  }
    
  // Hide the search label/icon if the form is valid  
  &:valid + label {
    display: none;
  }
}

.ui-autocomplete {
  @include border-radius(0 0 5px 5px);
  width: 190px;
  max-height: 180px;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #2ec5aa;
  color: #fff;
  border-width: 4px 4px 4px 0;
  border-style: solid;
  border-color: #2ec5aa;
  
  ul {
    list-style: none;
  }
  
  li {
    height: 36px;
    margin: 0;
    font: bold 14px/36px Arial, Helvetica, sans-serif; 
    white-space: nowrap;

    &:hover {
      @include transition(background 0.15s ease-in);
      background: #3ED1B7/*#50ddc3*/;
   
      &:nth-child(5),
      &:last-child {
        @include border-radius(0 0 5px 5px);    
      }
    }
    
    a {
      display: block;
      padding: 0 12px;    
      cursor: pointer;
    }
  }
}

// Scroll Bars

// Webkit
::-webkit-scrollbar {
  @include border-radius(3px);
  background: #7AD7C7;
  width: 6px;
}

::-webkit-scrollbar-thumb {
  @include border-radius(3px);
  background: #fff;
}
              
            
!

JS

              
                // This demo uses jQuery UI Autocomplete
// https://jqueryui.com/autocomplete

// Cannot style datalist elements yet, so get
// each option value and pass to jQuery UI Autocomplete
$('input[data-list]').each(function () {
  var availableTags = $('#' + $(this).attr("data-list")).find('option').map(function () {
    return this.value;
  }).get();

  $(this).autocomplete({
    source: availableTags
  }).on('focus', function () {
    $(this).autocomplete('search', ' ');
  }).on('search', function () {
    if ($(this).val() === '') {
      $(this).autocomplete('search', ' ');
    }
  });
});
              
            
!
999px

Console