Created
January 18, 2016 21:22
-
-
Save rtivital/3b3ee316ae83698f82f2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<input type="text" placeholder="Normal input" class="input"> | |
<input type="text" placeholder="Shift right" class="input pl-shift-right"> | |
<input type="text" placeholder="Shift left" class="input pl-shift-left"> | |
<input type="text" placeholder="Slide down" class="input pl-slide-down"> | |
<input type="text" placeholder="Fade out" class="input pl-fade-out"> |
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
// ---- | |
// libsass (v3.3.2) | |
// ---- | |
@mixin placeholder { | |
&::-webkit-input-placeholder {@content} | |
&:-moz-placeholder {@content} | |
&::-moz-placeholder {@content} | |
&:-ms-input-placeholder {@content} | |
} | |
@mixin pl-shift($side: left, $position: 500px, $duration: 200ms) { | |
@include placeholder { | |
text-indent: 0; | |
transition: text-indent $duration; | |
} | |
&:focus { | |
@include placeholder { | |
text-indent: if($side == left, -$position, $position); | |
} | |
} | |
} | |
@mixin pl-slide-down($position: 5, $duration: 200ms) { | |
@include placeholder { | |
line-height: 1; | |
transition: line-height $duration; | |
} | |
&:focus { | |
@include placeholder { | |
line-height: $position; | |
} | |
} | |
} | |
@mixin pl-fade-out($duration: 200ms) { | |
@include placeholder { | |
opacity: 1; | |
transition: opacity $duration; | |
} | |
&:focus { | |
@include placeholder { | |
opacity: 0; | |
} | |
} | |
} | |
.input { | |
padding: .5rem 1rem; | |
} | |
.pl-shift-right { | |
@include pl-shift( right ); | |
} | |
.pl-shift-left { | |
@include pl-shift( left ); | |
} | |
.pl-slide-down { | |
@include pl-slide-down; | |
} | |
.pl-fade-out { | |
@include pl-fade-out; | |
} |
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
.input { | |
padding: .5rem 1rem; | |
} | |
.pl-shift-right::-webkit-input-placeholder { | |
text-indent: 0; | |
transition: text-indent 200ms; | |
} | |
.pl-shift-right:-moz-placeholder { | |
text-indent: 0; | |
transition: text-indent 200ms; | |
} | |
.pl-shift-right::-moz-placeholder { | |
text-indent: 0; | |
transition: text-indent 200ms; | |
} | |
.pl-shift-right:-ms-input-placeholder { | |
text-indent: 0; | |
transition: text-indent 200ms; | |
} | |
.pl-shift-right:focus::-webkit-input-placeholder { | |
text-indent: 500px; | |
} | |
.pl-shift-right:focus:-moz-placeholder { | |
text-indent: 500px; | |
} | |
.pl-shift-right:focus::-moz-placeholder { | |
text-indent: 500px; | |
} | |
.pl-shift-right:focus:-ms-input-placeholder { | |
text-indent: 500px; | |
} | |
.pl-shift-left::-webkit-input-placeholder { | |
text-indent: 0; | |
transition: text-indent 200ms; | |
} | |
.pl-shift-left:-moz-placeholder { | |
text-indent: 0; | |
transition: text-indent 200ms; | |
} | |
.pl-shift-left::-moz-placeholder { | |
text-indent: 0; | |
transition: text-indent 200ms; | |
} | |
.pl-shift-left:-ms-input-placeholder { | |
text-indent: 0; | |
transition: text-indent 200ms; | |
} | |
.pl-shift-left:focus::-webkit-input-placeholder { | |
text-indent: -500px; | |
} | |
.pl-shift-left:focus:-moz-placeholder { | |
text-indent: -500px; | |
} | |
.pl-shift-left:focus::-moz-placeholder { | |
text-indent: -500px; | |
} | |
.pl-shift-left:focus:-ms-input-placeholder { | |
text-indent: -500px; | |
} | |
.pl-slide-down::-webkit-input-placeholder { | |
line-height: 1; | |
transition: line-height 200ms; | |
} | |
.pl-slide-down:-moz-placeholder { | |
line-height: 1; | |
transition: line-height 200ms; | |
} | |
.pl-slide-down::-moz-placeholder { | |
line-height: 1; | |
transition: line-height 200ms; | |
} | |
.pl-slide-down:-ms-input-placeholder { | |
line-height: 1; | |
transition: line-height 200ms; | |
} | |
.pl-slide-down:focus::-webkit-input-placeholder { | |
line-height: 5; | |
} | |
.pl-slide-down:focus:-moz-placeholder { | |
line-height: 5; | |
} | |
.pl-slide-down:focus::-moz-placeholder { | |
line-height: 5; | |
} | |
.pl-slide-down:focus:-ms-input-placeholder { | |
line-height: 5; | |
} | |
.pl-fade-out::-webkit-input-placeholder { | |
opacity: 1; | |
transition: opacity 200ms; | |
} | |
.pl-fade-out:-moz-placeholder { | |
opacity: 1; | |
transition: opacity 200ms; | |
} | |
.pl-fade-out::-moz-placeholder { | |
opacity: 1; | |
transition: opacity 200ms; | |
} | |
.pl-fade-out:-ms-input-placeholder { | |
opacity: 1; | |
transition: opacity 200ms; | |
} | |
.pl-fade-out:focus::-webkit-input-placeholder { | |
opacity: 0; | |
} | |
.pl-fade-out:focus:-moz-placeholder { | |
opacity: 0; | |
} | |
.pl-fade-out:focus::-moz-placeholder { | |
opacity: 0; | |
} | |
.pl-fade-out:focus:-ms-input-placeholder { | |
opacity: 0; | |
} |
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
<input type="text" placeholder="Normal input" class="input"> | |
<input type="text" placeholder="Shift right" class="input pl-shift-right"> | |
<input type="text" placeholder="Shift left" class="input pl-shift-left"> | |
<input type="text" placeholder="Slide down" class="input pl-slide-down"> | |
<input type="text" placeholder="Fade out" class="input pl-fade-out"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment