A Pen by erikokoide on CodePen.
Created
December 6, 2014 02:24
-
-
Save shrinkray/735d944e85200397c95c to your computer and use it in GitHub Desktop.
Useful Gradient LESS Mixin
This file contains 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
<h1>Useful Gradient LESS Mixin</h1> | |
<pre> | |
<code> | |
// Mixin | |
.gradient (@origin: left, @start: #ffffff, @stop: #000000) { | |
background-color: @start; | |
background-image: -webkit-linear-gradient(@origin, @start, @stop); | |
background-image: -moz-linear-gradient(@origin, @start, @stop); | |
background-image: -o-linear-gradient(@origin, @start, @stop); | |
background-image: -ms-linear-gradient(@origin, @start, @stop); | |
background-image: linear-gradient(@origin, @start, @stop); | |
} | |
</code> | |
</pre> |
This file contains 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 | |
.gradient (@origin: left, @start: #ffffff, @stop: #000000) { | |
background-color: @start; | |
background-image: -webkit-linear-gradient(@origin, @start, @stop); | |
background-image: -moz-linear-gradient(@origin, @start, @stop); | |
background-image: -o-linear-gradient(@origin, @start, @stop); | |
background-image: -ms-linear-gradient(@origin, @start, @stop); | |
background-image: linear-gradient(@origin, @start, @stop); | |
} | |
body { | |
.gradient(left, #4ea6ca, #ca4ea6); | |
text-align:center; | |
color:#ffffff; | |
} | |
pre { | |
display:inline-block; | |
padding:20px 30px; | |
text-align:left; | |
border:1px #fff solid; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment