File: input.scss

package info (click to toggle)
node-node-sass 9.0.0%2Bgit20240131.6081731%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 75,520 kB
  • sloc: javascript: 7,313; cpp: 1,495; perl: 428; makefile: 11
file content (30 lines) | stat: -rw-r--r-- 823 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$gutter: 100% / 36.2;
    $gutter_em: 1rem; //This needs to be rem to not mess up margins

// This calculate the gutter
@function col_width($n, $use_calc: false) {
    $divisor: 12 / $n;
    @if ($use_calc) {
        $gutter_offset: $gutter_em * ($divisor - 1);
        @return calc((100% - #{$gutter_offset}) / #{$divisor});
    }
    @else {
        @return (100% - $gutter * ($divisor - 1)) / $divisor;
    }
}

// Each number here becomes a grid: onecol, twocol etc. 
$grids: one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve;
$i: 1;
@each $grid in $grids {
    .#{$grid}col {
        width: col_width( $i );
        width: col_width( $i, true );
    }

    %#{$grid}col {
        width: col_width( $i );
        width: col_width( $i, true );
    }
    $i: $i + 1;
}