Last active
September 13, 2016 01:41
-
-
Save treetrum/00ab1fb887d9cafc147d3b65a6289026 to your computer and use it in GitHub Desktop.
Sass mixin for easily target placeholder text within an input.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on the content from: https://css-tricks.com/snippets/css/style-placeholder-text/