Skip to content

Instantly share code, notes, and snippets.

@Camwyn
Last active November 3, 2016 14:57
Show Gist options
  • Select an option

  • Save Camwyn/4e8f44a71217cd9e7986c4f56f06ab97 to your computer and use it in GitHub Desktop.

Select an option

Save Camwyn/4e8f44a71217cd9e7986c4f56f06ab97 to your computer and use it in GitHub Desktop.
Placeholder State
/**
* @alias placeholder-state
* Styling placeholder text color states ( default, hover, focus )
* USE: @include placholder( #999, #999, #222 );
*/
@mixin placeholder-state( $default: inherit, $hover: $default, $focus: $default ) {
// You have to declare the -moz/-webkit separately in order for them to work
&::-webkit-input-placeholder {
color: $default;
}
&:-moz-placeholder {
color: $default;
}
&:hover::-webkit-input-placeholder {
color: $hover;
}
&:hover:-moz-placeholder {
color: $hover;
}
&:focus::-webkit-input-placeholder {
color: $focus;
}
&:focus:-moz-placeholder {
color: $focus;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment