This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Omphaloskepsis/plugins/jetpack/scss/_utilities/mixins/_sections.scss

26 lines
811 B
SCSS
Raw Permalink Normal View History

2018-03-21 18:19:20 +00:00
// ==========================================================================
// 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}
--------------------------------------------------------------*/
}