Created
September 13, 2018 02:26
-
-
Save PiotrKrzyzek/b33359e85a4813f8829fe473f9bfb3ac to your computer and use it in GitHub Desktop.
SCSS (SASS) Input Placeholder Template
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
@mixin optional-at-root($sel) { | |
@at-root #{if(not &, $sel, selector-append(&, $sel))} { | |
@content; | |
} | |
} | |
@mixin placeholder { | |
@include optional-at-root('::-webkit-input-placeholder') { | |
@content; | |
} | |
@include optional-at-root(':-moz-placeholder') { | |
@content; | |
} | |
@include optional-at-root('::-moz-placeholder') { | |
@content; | |
} | |
@include optional-at-root(':-ms-input-placeholder') { | |
@content; | |
} | |
} | |
.foobar { | |
@include placeholder { | |
color: #AAAAAA; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment