Skip to content

Instantly share code, notes, and snippets.

@Kcko
Forked from paramburu/headings.scss
Last active March 8, 2019 19:13
Show Gist options
  • Save Kcko/cbf0b080524749b3c7b3d95070f6700c to your computer and use it in GitHub Desktop.
Save Kcko/cbf0b080524749b3c7b3d95070f6700c to your computer and use it in GitHub Desktop.
Sass recursive headings function (h1, h2, h3...)
// orig source: https://guwii.com/bytes/sass-function-loop-headings-h1h2h3h4h5h6/
@function headings($from:1, $to:6) {
@if $from == $to {
@return 'h#{$from}';
} @else {
@return 'h#{$from},' + headings($from+1, $to);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment