Skip to content

Commit 415a4f2

Browse files
committed
Merge pull request #795 from mgreter/todo/issue_239
Add todo spec test for libsass issue 239
2 parents b092549 + e0111f1 commit 415a4f2

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.onecol {
2+
width: 5.8011%;
3+
width: calc((100% - 11rem) / 12); }
4+
5+
.twocol {
6+
width: 14.36464%;
7+
width: calc((100% - 5rem) / 6); }
8+
9+
.threecol {
10+
width: 22.92818%;
11+
width: calc((100% - 3rem) / 4); }
12+
13+
.fourcol {
14+
width: 31.49171%;
15+
width: calc((100% - 2rem) / 3); }
16+
17+
.fivecol {
18+
width: 40.05525%;
19+
width: calc((100% - 1.4rem) / 2.4); }
20+
21+
.sixcol {
22+
width: 48.61878%;
23+
width: calc((100% - 1rem) / 2); }
24+
25+
.sevencol {
26+
width: 57.18232%;
27+
width: calc((100% - 0.71429rem) / 1.71429); }
28+
29+
.eightcol {
30+
width: 65.74586%;
31+
width: calc((100% - 0.5rem) / 1.5); }
32+
33+
.ninecol {
34+
width: 74.30939%;
35+
width: calc((100% - 0.33333rem) / 1.33333); }
36+
37+
.tencol {
38+
width: 82.87293%;
39+
width: calc((100% - 0.2rem) / 1.2); }
40+
41+
.elevencol {
42+
width: 91.43646%;
43+
width: calc((100% - 0.09091rem) / 1.09091); }
44+
45+
.twelvecol {
46+
width: 100%;
47+
width: calc((100% - 0rem) / 1); }
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
$gutter: 100% / 36.2;
2+
$gutter_em: 1rem; //This needs to be rem to not mess up margins
3+
4+
// This calculate the gutter
5+
@function col_width($n, $use_calc: false) {
6+
$divisor: 12 / $n;
7+
@if ($use_calc) {
8+
$gutter_offset: $gutter_em * ($divisor - 1);
9+
@return calc((100% - #{$gutter_offset}) / #{$divisor});
10+
}
11+
@else {
12+
@return (100% - $gutter * ($divisor - 1)) / $divisor;
13+
}
14+
}
15+
16+
// Each number here becomes a grid: onecol, twocol etc.
17+
$grids: one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve;
18+
$i: 1;
19+
@each $grid in $grids {
20+
.#{$grid}col {
21+
width: col_width( $i );
22+
width: col_width( $i, true );
23+
}
24+
25+
%#{$grid}col {
26+
width: col_width( $i );
27+
width: col_width( $i, true );
28+
}
29+
$i: $i + 1;
30+
}

0 commit comments

Comments
 (0)