Skip to content

Instantly share code, notes, and snippets.

@jasonheecs
Created April 5, 2016 10:24
Show Gist options
  • Save jasonheecs/7b8a77f4c101f8e3ab52474b05a73236 to your computer and use it in GitHub Desktop.
Save jasonheecs/7b8a77f4c101f8e3ab52474b05a73236 to your computer and use it in GitHub Desktop.
Sass mixin to set the placeholder color of input elements
// Set the color of placeholder text in input fields
@mixin set-placeholder-color($color) {
// scss-lint:disable PseudoElement, VendorPrefix
::-webkit-input-placeholder { // WebKit, Blink, Edge
color: $color;
}
:-moz-placeholder { // Mozilla Firefox 4 to 18
color: $color;
opacity: 1;
}
::-moz-placeholder { // Mozilla Firefox 19+
color: $color;
opacity: 1;
}
:-ms-input-placeholder { // Internet Explorer 10-11
color: $color;
}
:placeholder-shown { // Standard (https://drafts.csswg.org/selectors-4/#placeholder)
color: $color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment