Skip to content

Instantly share code, notes, and snippets.

@mbonaci
Last active August 29, 2015 14:20
Show Gist options
  • Save mbonaci/4cb8bf170d4421cb9bd2 to your computer and use it in GitHub Desktop.
Save mbonaci/4cb8bf170d4421cb9bd2 to your computer and use it in GitHub Desktop.
$transp: rgba(255,255,255,0);
$colors:
lighten(steelblue, 20%),
lightblue,
skyblue,
steelblue,
darken(steelblue, 10%),
darken(steelblue, 10%),
darken(steelblue, 10%),
lighten(steelblue, 20%),
darken(steelblue, 10%),
darken(steelblue, 10%),
darken(steelblue, 10%),
darken(steelblue, 1%),
lighten(steelblue, 20%);
$warm: (
colors: $colors,
bg-color: white
);
@function gradient($colors, $direct: 60deg) {
$out: null;
@for $item from 1 through length($colors) {
$color: nth($colors, $item);
$pos: percentage($item/length($colors)/2);
$out-string: $color #{$pos - 10}, $color #{$pos};
$out: append($out, $out-string, comma);
}
@for $item from 1 through length($colors) {
$color: nth($colors, $item);
$pos: percentage($item/length($colors)/2) + 50;
$out-string: $color #{$pos - 10}, $color #{$pos};
$out: append($out, $out-string, comma);
}
@return linear-gradient($direct, $out);
}
@mixin gradient-set ($colors-set: $cold,$direct: 60deg, $size: 6){
$grad-colors: map-get($colors-set, colors);
$bg-color: map-get($colors-set, bg-color);
background-image: gradient($grad-colors,$direct),
gradient($grad-colors, $direct: -$direct);
background-color: $bg-color;
background-size: #{$size}em #{$size*1.72}em;
}
HTML, BODY {
height: 100%;
}
BODY {
@include gradient-set($warm, 60deg, 6);
background-blend-mode: multiply, normal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment