Skip to content

Instantly share code, notes, and snippets.

@satanworker
Created March 24, 2017 01:59
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 satanworker/da36ee8a5dde307bf726bc62f13a39b2 to your computer and use it in GitHub Desktop.
Save satanworker/da36ee8a5dde307bf726bc62f13a39b2 to your computer and use it in GitHub Desktop.
placeholder mixin
@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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment