Compass Placeholder Text Mixin
@mixin input-placeholder($color) {
&.placeholder {
color: $color;
}
&:-moz-placeholder {
color: $color;
}
&::-webkit-input-placeholder {
color: $color;
}
}
Steps:
- Add the .input-placeholder() mixin from _placeholderText.scss to your compass stylesheet (or reference it in an @import statement)
-
In your stylesheet, call the .input-placeholder() mixin anywhere you want to style your placeholder text.
.inputCls {
@include input-placeholder(#cccccc);
}
Will compile to:
.inputCls.placeholder {
color: #cccccc;
}
.inputCls:-moz-placeholder {
color: #cccccc;
}
.inputCls::-webkit-input-placeholder {
color: #cccccc;
}
Written by Michael Sacca
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#N
Authors
Related Tags
#n
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#