Created
April 18, 2014 15:00
-
-
Save derekwheee/11048591 to your computer and use it in GitHub Desktop.
Lines on Sides
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
// This puts a 1px line on either side of a heading | |
// ------- Like This ------- | |
.lines-on-sides { | |
display: table; | |
text-align: center; | |
white-space: nowrap; | |
&:after, | |
&:before { | |
content: ''; | |
display: table-cell; | |
width: 50%; | |
background: linear-gradient(transparent 50%, currentColor 50%, currentColor calc(50% + 1px), transparent calc(50% + 1px)); | |
background-clip: padding; | |
} | |
&:after { | |
border-left: 1em solid transparent; | |
} | |
&:before { | |
border-right: 1em solid transparent; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This adds lines on either side of your heading.
Or use
@extend .lines-on-sides
in Sass