Skip to content

Instantly share code, notes, and snippets.

@jeremyworboys
Forked from antsa/placeholder.scss
Created April 4, 2012 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyworboys/2296741 to your computer and use it in GitHub Desktop.
Save jeremyworboys/2296741 to your computer and use it in GitHub Desktop.
SCSS: Placeholder
// 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 {
&.placeholder { @content }
&:-moz-placeholder { @content }
&::-webkit-input-placeholder { @content }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment