Skip to content

Instantly share code, notes, and snippets.

@ohidurbappy
Created November 23, 2018 22:01
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 ohidurbappy/875f7f042f5180de38514f20efd65aad to your computer and use it in GitHub Desktop.
Save ohidurbappy/875f7f042f5180de38514f20efd65aad to your computer and use it in GitHub Desktop.
Gradients
<section class="bg-1"></section>
<section class="bg-2"></section>
<section class="bg-3"></section>
<section class="bg-4"></section>
<section class="bg-5"></section>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
$t: transparent;
$n: 5; // # of sections
section {
height: 100%;
position: absolute;
width: calc(100% / #{$n});
@for $i from 1 through $n {
&:nth-of-type(#{$i}) {
left: calc((100% / #{$n}) * #{$i - 1});
}
}
}
.bg-1 {
background: linear-gradient(135deg, #85C9C8, #D4FEE6, #E5FDC9);
}
.bg-2 {
background: linear-gradient(to bottom, #C1EBE1, #93B4AC);
}
.bg-3 {
background: -webkit-radial-gradient(top left, ellipse, #FDE152 0%, $t), linear-gradient(to bottom, #FA715F, #FA715F 60%, #DB1174, #9B4CA7);
}
.bg-4 {
background: linear-gradient(5deg, #556270, #C44D58);
}
.bg-5 {
background: linear-gradient(5deg, #036564, #033649);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment