This repository has been archived on 2022-08-01. You can view files and clone it, but cannot push or open issues or pull requests.
Oldphaloskepsis/plugins/jetpack/scss/_utilities/mixins/_sections.scss
2017-01-12 23:10:07 +00:00

25 lines
811 B
SCSS

// ==========================================================================
// Retina background
// ==========================================================================
@mixin section($section, $sub: false) {
// Creates value to be used as section numbers
@if variable-exists(toc-value){} @else {
$toc-value: 0 !global;
}
// Sets index numbering
@if $sub == false { // increments by 1 (rounding down)
$toc-value: floor($toc-value) + 1 !global;
} @else { // increments by .1
$toc-value: $toc-value + .1 !global;
}
$spacing: ' ';
@for $i from 1 to (6 - str-length('#{$toc-value}')) {
$spacing: $spacing + ' ';
}
/*--------------------------------------------------------------
#{$toc-value}#{$spacing}#{$section}
--------------------------------------------------------------*/
}