Skip to content

Instantly share code, notes, and snippets.

@travismillerweb
Created October 14, 2014 15:00
Show Gist options
  • Save travismillerweb/f801aa032b5b7e0d6e16 to your computer and use it in GitHub Desktop.
Save travismillerweb/f801aa032b5b7e0d6e16 to your computer and use it in GitHub Desktop.
SCSS - Sass Mixin for Headings
/*
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