Skip to content

Instantly share code, notes, and snippets.

@martdn
Last active March 22, 2016 10:44
Show Gist options
  • Save martdn/1cfdfb58e310f1ed0a21 to your computer and use it in GitHub Desktop.
Save martdn/1cfdfb58e310f1ed0a21 to your computer and use it in GitHub Desktop.
mixin for input placegolder "text-overflow:hidden" and state ":focus" color on SCSS
//Input placeholder text-overflow, focus color
@mixin input-placeholder($text, $color) {
&[placeholder] {text-overflow: $text;}
&::-webkit-input-placeholder {text-overflow: $text;}
&::-moz-placeholder {text-overflow: $text;}/* Firefox 19+ */
&:-moz-placeholder {text-overflow: $text;}/* Firefox 18- */
&:-ms-input-placeholder {text-overflow: $text;}
//Input placeholder :focus
&:focus {
&::-webkit-input-placeholder {color:$color}
&::-moz-placeholder {color:$color}/* Firefox 19+ */
&:-moz-placeholder {color:$color}/* Firefox 18- */
&:-ms-input-placeholder {color:$color}
}
}
@MirShaon
Copy link

Awesome!Man

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