Skip to content

Instantly share code, notes, and snippets.

@elijahmanor
Created February 6, 2014 03:57
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 elijahmanor/8838198 to your computer and use it in GitHub Desktop.
Save elijahmanor/8838198 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div>linear-gradient-average</div>
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// Bourbon (v3.2.0.beta.1.a)
// ----
@import "bourbon/bourbon";
@mixin linear-gradient-average($pos: null, $G1: null, $percent: 30%, $fallback: null) {
$pos-type: type-of(nth($pos, 1));
@if ($pos-type == color) or (nth($pos, 1) == "transparent") {
$percent: $G1; $G1: $pos; $pos: null;
}
@include linear-gradient($pos, lighten($G1, $percent), darken($G1, $percent), $fallback);
}
div {
width: 600px;
height: 200px;
@include linear-gradient-average(blue, 25%);
}
div {
width: 600px;
height: 200px;
background-color: #8080ff;
background-image: -webkit-linear-gradient(#8080ff, navy);
background-image: linear-gradient(#8080ff, navy);
}
<div>linear-gradient-average</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment