Created
October 14, 2014 15:00
-
-
Save travismillerweb/f801aa032b5b7e0d6e16 to your computer and use it in GitHub Desktop.
SCSS - Sass Mixin for Headings
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
/* | |
SCSS - Sass Mixin for Headings | |
Reference Link: http://jsfiddle.net/jitendravyas/cxJtc/light/ | |
Also Look at: http://www.elijahmanor.com/nested-maps-for-typesetting-in-sass/ | |
*/ | |
@mixin headings($from: 1, $to: 6){ | |
@for $i from $from through $to{ | |
h#{$i}{ | |
@content | |
} | |
} | |
} | |
@include headings(){ | |
font-family:sans-serif; | |
} | |
div{ | |
@include headings(){ | |
color:red; | |
} | |
} | |
.sweet{ | |
@include headings(1,3){ | |
color:red; | |
} | |
// headings(4,6) or just headings(4) | |
@include headings(4){ | |
color:blue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment