Skip to content

Instantly share code, notes, and snippets.

@mattdanielbrown
Forked from antsa/placeholder.scss
Created October 5, 2016 17:17
Show Gist options
  • Save mattdanielbrown/ff0172a99d954260d877cc51e544b431 to your computer and use it in GitHub Desktop.
Save mattdanielbrown/ff0172a99d954260d877cc51e544b431 to your computer and use it in GitHub Desktop.
Placeholder mixin for Sass
// 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