Skip to content

Instantly share code, notes, and snippets.

@ozinepank
Last active November 18, 2015 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozinepank/429abd146ef92742389f to your computer and use it in GitHub Desktop.
Save ozinepank/429abd146ef92742389f to your computer and use it in GitHub Desktop.
Using Mixing pseudo palceholder (SASS)
@mixin psuedo-placeholder($color-placeholder) {
&::-webkit-input-placeholder {
color: $color-placeholder;
@include transition-color;
}
&:-moz-placeholder { /* Firefox 18- */
color: $color-placeholder;
@include transition-color;
}
&::-moz-placeholder { /* Firefox 19+ */
color: $color-placeholder;
@include transition-color;
}
&:-ms-input-placeholder {
color: $color-placeholder;
@include transition-color;
}
&:focus {
&::-webkit-input-placeholder {
color: transparent;
}
&:-moz-placeholder { /* Firefox 18- */
color: transparent;
}
&::-moz-placeholder { /* Firefox 19+ */
color: transparent;
}
&:-ms-input-placeholder {
color: transparent;
}
}
}
// Using
.input-form input {
include psuedo-placeholder($color);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment