Skip to content

Instantly share code, notes, and snippets.

@DriftwoodJP
Last active August 29, 2015 14:10
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 DriftwoodJP/e1b2c8b6a23b423e9770 to your computer and use it in GitHub Desktop.
Save DriftwoodJP/e1b2c8b6a23b423e9770 to your computer and use it in GitHub Desktop.
CSS Gradient Bottom Border
%h3.h__linear Lorem ipsum dolor sit amet
.h__linear--gradient
%h3 Lorem ipsum dolor sit amet
@import "compass/css3";
// Compass for linear-gradient
@mixin bd-gradient(
$bd-with: 4px,
$color-from: #0083f6,
$color-to: null
) {
position: relative;
margin-bottom: $bd-with;
&:before, &:after {
content: "";
position: absolute;
bottom: $bd-with * -1;
left: 0; }
&:after {
right: 0;
height: $bd-with;
background-color: $color-from;
@if $color-to != null {
@include background-image(linear-gradient(to right, $color-from, $color-to)); } }
}
.h__linear {
@include bd-gradient();
}
.h__linear--gradient {
@include bd-gradient($bd-with: 8px, $color-from: #0083f6, $color-to: #5dcdfa);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment