-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalcGrid.css
24 lines (19 loc) · 1.03 KB
/
calcGrid.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Calc Grid */
/* Col Setup */
[class*="col-"] section { padding: 1.5em; background: #ccc; float: left; }
/* Col Two */
.col-2 section { width: calc(100% / 2 - (1.5em / 2) ); }
.col-2 section:nth-of-type(1) { margin-right: calc(1.5em / 2); }
.col-2 section:nth-of-type(2) { margin-left: calc(1.5em / 2); }
/* Col Three */
.col-3 section { width: calc(100% / 3 - (1.5em * 2 / 3) ); }
.col-3 section:nth-of-type(2) { margin-right: 1.5em; margin-left: 1.5em; }
/* Col Four */
.col-4 section { width: calc(100% / 4 - (1.5em * 3 / 4) ); }
.col-4 section:nth-of-type(2) { margin-right: calc(1.5em / 2); margin-left: 1.5em; }
.col-4 section:nth-of-type(3) { margin-right: 1.5em; margin-left: calc(1.5em / 2); }
/* Col Five */
.col-5 section { width: calc(100% / 5 - (1.5em * 4 / 5) ); }
.col-5 section:nth-of-type(2) { margin-right: calc(1.5em / 2); margin-left: 1.5em; }
.col-5 section:nth-of-type(3) { margin-right: calc(1.5em / 2); margin-left: calc(1.5em / 2); }
.col-5 section:nth-of-type(4) { margin-right: 1.5em; margin-left: calc(1.5em / 2); }