-
Notifications
You must be signed in to change notification settings - Fork 0
/
calcGrid.sass
56 lines (50 loc) · 936 Bytes
/
calcGrid.sass
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Variables
$em: 1.5em
// Mixin
@mixin m-r
margin-right: $em
@mixin m-r/2
margin-right: calc($em / 2)
@mixin m-l
margin-left: $em
@mixin m-l/2
margin-left: calc($em / 2)
// Col Base
[class*="col-"] section
padding: $em
background: #ccc
float: left
// Col Two
.col-2 section
width: calc(100% / 2 - ($em / 2) )
&:nth-of-type(1)
@mixin m-r/2
&:nth-of-type(2)
@include m-l/2
// Col Three
.col-3 section
width: calc(100% / 3 - ($em * 2 / 3) )
&:nth-of-type(2)
@include m-r
@include m-l
// Col Four
.col-4 section
width: calc(100% / 4 - ($em * 3 / 4) )
&:nth-of-type(2)
@include m-r/2
@include m-l
&:nth-of-type(3)
@include m-r
@include m-l/2
// Col Four
.col-5 section
width: calc(100% / 5 - ($em * 4 / 5) )
&:nth-of-type(2)
@mixin m-r/2
@include m-l
&:nth-of-type(3)
@mixin m-r/2
@include m-l/2
&:nth-of-type(4)
@include m-r
@include m-l/2