A Pen by DriftwoodJP on CodePen.
Last active
August 29, 2015 14:10
-
-
Save DriftwoodJP/e1b2c8b6a23b423e9770 to your computer and use it in GitHub Desktop.
CSS Gradient Bottom Border
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
%h3.h__linear Lorem ipsum dolor sit amet | |
.h__linear--gradient | |
%h3 Lorem ipsum dolor sit amet |
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
@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