Skip to content

Instantly share code, notes, and snippets.

@treetrum
Last active September 13, 2016 01:41
Show Gist options
  • Save treetrum/00ab1fb887d9cafc147d3b65a6289026 to your computer and use it in GitHub Desktop.
Save treetrum/00ab1fb887d9cafc147d3b65a6289026 to your computer and use it in GitHub Desktop.
Sass mixin for easily target placeholder text within an input.
@mixin targetPlaceholderText {
&::-webkit-input-placeholder { @content; }
&:-moz-placeholder { @content; } // Firefox 18-
&::-moz-placeholder { @content; } // Firefox 19+
&:-ms-input-placeholder { @content; }
}
// Usage example:
input {
@include targetPlaceholderText {
color: #ff0000;
// Any other standard text styles...
}
}
@treetrum
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment