-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.scss
133 lines (115 loc) · 6.1 KB
/
main.scss
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
@import "reset";
@import "column-settings";
@import "column-setter";
* {
box-sizing: border-box;
}
@include grid( main, overlay); // Make elements with a class of 'main' the context
// for the column structure, and include a translucent
// column overlay as a guide
h1 {
background-color: cyan;
margin-bottom: 0.5em;
@include full-width; // Make this the full width of the viewport
}
p {
background: #0f0;
margin-bottom: 0.5em;
&:nth-of-type(1) {
@include breakpoint-min( xs ) { width: colspan( 1, 4 ); } // 1 column out of 4
@include breakpoint-min( sm ) { width: colspan( 1, 6 ); } // 1 column out of 6
@include breakpoint-min( md ) { width: colspan( 1, 8 ); } // 1 column out of 8
@include breakpoint-min( lg ) { width: colspan( 1, 12 ); } // 1 column out of 12
@include breakpoint-min( xl ) { width: colspan( 1, 16 ); } // 1 column out of 16
}
&:nth-of-type(2) {
@include breakpoint-min( xs ) { width: colspan( 2, 4 ); } // 2 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 2, 6 ); } // 2 columns out of 6
@include breakpoint-min( md ) { width: colspan( 2, 8 ); } // 2 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 2, 12 ); } // 2 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 2, 16 ); } // 2 columns out of 16
}
&:nth-of-type(3) {
@include breakpoint-min( xs ) { width: colspan( 3, 4 ); } // 3 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 3, 6 ); } // 3 columns out of 6
@include breakpoint-min( md ) { width: colspan( 3, 8 ); } // 3 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 3, 12 ); } // 3 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 3, 16 ); } // 3 columns out of 16
}
&:nth-of-type(4) {
@include breakpoint-min( xs ) { width: colspan( 4, 4 ); } // 4 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 4, 6 ); } // 4 columns out of 6
@include breakpoint-min( md ) { width: colspan( 4, 8 ); } // 4 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 4, 12 ); } // 4 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 4, 16 ); } // 4 columns out of 16
}
&:nth-of-type(5) {
@include breakpoint-min( xs ) { width: colspan( 5, 4 ); } // 5 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 5, 6 ); } // 5 columns out of 6
@include breakpoint-min( md ) { width: colspan( 5, 8 ); } // 5 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 5, 12 ); } // 5 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 5, 16 ); } // 5 columns out of 16
}
&:nth-of-type(6) {
@include breakpoint-min( xs ) { width: colspan( 6, 4 ); } // 6 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 6, 6 ); } // 6 columns out of 6
@include breakpoint-min( md ) { width: colspan( 6, 8 ); } // 6 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 6, 12 ); } // 6 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 6, 16 ); } // 6 columns out of 16
}
&:nth-of-type(7) {
@include breakpoint-min( xs ) { width: colspan( 7, 4 ); } // 7 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 7, 6 ); } // 7 columns out of 6
@include breakpoint-min( md ) { width: colspan( 7, 8 ); } // 7 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 7, 12 ); } // 7 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 7, 16 ); } // 7 columns out of 16
}
&:nth-of-type(8) {
@include breakpoint-min( xs ) { width: colspan( 8, 4 ); } // 8 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 8, 6 ); } // 8 columns out of 6
@include breakpoint-min( md ) { width: colspan( 8, 8 ); } // 8 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 8, 12 ); } // 8 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 8, 16 ); } // 8 columns out of 16
}
&:nth-of-type(9) {
@include breakpoint-min( xs ) { width: colspan( 9, 4 ); } // 9 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 9, 6 ); } // 9 columns out of 6
@include breakpoint-min( md ) { width: colspan( 9, 8 ); } // 9 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 9, 12 ); } // 9 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 9, 16 ); } // 9 columns out of 16
}
&:nth-of-type(10) {
@include breakpoint-min( xs ) { width: colspan( 10, 4 ); } // 10 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 10, 6 ); } // 10 columns out of 6
@include breakpoint-min( md ) { width: colspan( 10, 8 ); } // 10 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 10, 12 ); } // 10 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 10, 16 ); } // 10 columns out of 16
}
&:nth-of-type(11) {
@include breakpoint-min( xs ) { width: colspan( 11, 4 ); } // 11 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 11, 6 ); } // 11 columns out of 6
@include breakpoint-min( md ) { width: colspan( 11, 8 ); } // 11 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 11, 12 ); } // 11 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 11, 16 ); } // 11 columns out of 16
}
&:nth-of-type(12) {
@include breakpoint-min( xs ) { width: colspan( 12, 4 ); } // 12 columns out of 4
@include breakpoint-min( sm ) { width: colspan( 12, 6 ); } // 12 columns out of 6
@include breakpoint-min( md ) { width: colspan( 12, 8 ); } // 12 columns out of 8
@include breakpoint-min( lg ) { width: colspan( 12, 12 ); } // 12 columns out of 12
@include breakpoint-min( xl ) { width: colspan( 12, 16 ); } // 12 columns out of 16
}
}
// More efficient version of the above:
//
// p {
// background: #0f0;
// margin-bottom: 0.5em;
// @for $i from 1 through 12 {
// &:nth-of-type(#{$i}) {
// @each $bp, $value in $breakpoints {
// @include breakpoint-min($bp) { width: colspan($i, bp-attribute($bp, cols)); }
// }
// }
// }
// }