Skip to content

Commit 239de79

Browse files
committed
Add container class and grid system
1 parent c4e84c8 commit 239de79

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

scss/index.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
// requirements
22
@import "variables.scss";
33
@import "mixins/clearfix.scss";
4+
5+
// layout
6+
@import "layout/container.scss";
7+
@import "layout/grid.scss";

scss/layout/container.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.container {
2+
margin-left: auto;
3+
margin-right: auto;
4+
max-width: $container-width;
5+
6+
@include clearfix;
7+
}

scss/layout/grid.scss

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// class for every element containing columns
2+
.row {
3+
display: table;
4+
width: 100%;
5+
}
6+
7+
// classes to define when columns inside a .row should break
8+
@each $breakpoint, $width in $breakpoints {
9+
@media (max-width: $width) {
10+
.break-#{$breakpoint} .column {
11+
padding: 0;
12+
width: 100%;
13+
}
14+
}
15+
}
16+
17+
// class for every column
18+
.column {
19+
display: inline-block;
20+
float: left;
21+
padding-left: round($column-padding / 2);
22+
padding-right: round($column-padding / 2);
23+
24+
&:first-child {
25+
padding-left: 0;
26+
}
27+
28+
&:last-child {
29+
padding-right: 0;
30+
}
31+
}
32+
33+
// classes to define the width of a column
34+
@for $index from 1 through 12 {
35+
.width-#{$index} {
36+
width: ($index/12 * 100%);
37+
}
38+
}

scss/variables.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@ $spacer-3: nth($spacers, 3);
3131
$spacer-4: nth($spacers, 4);
3232
$spacer-5: nth($spacers, 5);
3333
$spacer-6: nth($spacers, 6);
34+
35+
// *** components ***
36+
37+
// ** layout **
38+
39+
// responsive container
40+
$container-width: 980px !default;
41+
42+
// grid
43+
$column-padding: $spacer-2 !default;

0 commit comments

Comments
 (0)