Last active
December 20, 2015 21:08
-
-
Save aebsr/6195111 to your computer and use it in GitHub Desktop.
placeholder text mixin
This file contains hidden or 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
// placeholder mixin | |
.placeholder (@el:~'[placeholder]') { | |
@{el}::-webkit-input-placeholder { .styles; } | |
@{el}:-ms-input-placeholder { .styles; } | |
@{el}::input-placeholder { .styles; } | |
@{el}:input-placeholder { .styles; } | |
@{el}::-moz-placeholder { .styles; } | |
@{el}:-moz-placeholder { .styles; } | |
@{el}::placeholder { .styles; } | |
@{el}:placeholder { .styles; } | |
} |
This file contains hidden or 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
// nested example #1 | |
#signup { | |
.styles() { | |
color: green; | |
} | |
.placeholder(~'[type="email"]'); | |
} | |
// nested example #2 | |
#contact { | |
.styles() { | |
color: red; | |
} | |
.placeholder(~'[type="name"]'); | |
} | |
// stand alone example | |
// risky, as it becomes globally set and can be inherited in other style(instances) | |
.styles() { | |
color: purple; | |
} | |
.placeholder(~'[type="search"]'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment