Last active
March 22, 2016 10:44
-
-
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
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
//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} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome!Man