Skip to content

Instantly share code, notes, and snippets.

@DBasic
Forked from antsa/placeholder.scss
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save DBasic/46c69b5bee71b53e174b to your computer and use it in GitHub Desktop.

Select an option

Save DBasic/46c69b5bee71b53e174b to your computer and use it in GitHub Desktop.
[SASS] Placeholder mixin
// Placeholder @mixin for Sass
//
// A mixin to style placeholders in HTML5 form elements.
// Includes also a .placeholder class to be used with a polyfill e.g.
// https://github.com/mathiasbynens/jquery-placeholder
// Requires Sass 3.2.
//
// Example usage (.scss):
//
// input {
// @include placeholder {
// /* styles for placeholder here */
// }
// }
//
@mixin placeholder {
&::-webkit-input-placeholder {
@content;
}
&:-moz-placeholder { /* Firefox 18- */
@content;
}
&::-moz-placeholder { /* Firefox 19+ */
@content;
}
&:-ms-input-placeholder {
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment