-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
195 lines (187 loc) · 7.13 KB
/
index.html
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Alliants SCSS Grid Demo</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>
<body class="grid-demo">
<div class="grid">
<div class="grid__row">
<div class="col col--xs-12">
<h2>Grid Layout</h2>
<p>This is an example of a mobile-first responsive grid system built using Flexbox and BEM class notation.<br/>To improve adoption rates, it is designed to follow the Bootstrap style DOM structure as closely as possible.<br/><br/>The grid is made up of three distinct elements:</p>
<ul>
<li><code>.grid</code> (the top level grid container)</li>
<li><code>.grid__row</code> (an element for each grid row)</li>
<li><code>.col</code> (the individual grid column elements)</li>
</ul>
<h3><code>.grid</code></h3>
<p>This element is the top level grid component. Similar to bootstrap, you should only use one of these per grid (eg. a <code>.grid</code> element should never be nested under another <code>.grid</code> element).
<h3><code>.grid__row</code></h3>
<p>This element is the container for all your grid columns. Combined with <code>.grid</code>, it uses the <a href="http://www.helloerik.com/the-subtle-magic-behind-why-the-bootstrap-3-grid-works">Boostrap negative margin trick</a> to frame the layout and provide grid gutters. It should only ever be a child of a <code>.grid</code> element or a <code>.col</code> element.</p>
<h3><code>.col</code></h3>
<p>This is the main column class - all your grid content should sit within a col. Each <code>.col</code> element also needs at least one other class to determine the width of the column. These can be combined to create different layouts at different responsive breakpoints:</p>
<ul>
<li><code>.col--xs-*</code></li>
<li><code>.col--sm-*</code></li>
<li><code>.col--md-*</code></li>
<li><code>.col--lg-*</code></li>
<li><code>.col--xlg-*</code></li>
</ul>
The <code>*</code> should be replaced by the number of columns you want the element to span. The grid is configured to use 12 columns by default.
</div>
<div class="col col--xs-12">
<h2>Column Examples</h2>
</div>
<div class="col col--xs-1">
<p class="col__label">.col--xs-1</p>
</div>
<div class="col col--xs-11">
<p class="col__label">.col--xs-11</p>
</div>
<div class="col col--xs-2">
<p class="col__label">.col--xs-2</p>
</div>
<div class="col col--xs-10">
<p class="col__label">.col--xs-10</p>
</div>
<div class="col col--xs-3">
<p class="col__label">.col--xs-3</p>
</div>
<div class="col col--xs-9">
<p class="col__label">.col--xs-9</p>
</div>
<div class="col col--xs-4">
<p class="col__label">.col--xs-4</p>
</div>
<div class="col col--xs-8">
<p class="col__label">.col--xs-8</p>
</div>
<div class="col col--xs-5">
<p class="col__label">.col--xs-5</p>
</div>
<div class="col col--xs-7">
<p class="col__label">.col--xs-7</p>
</div>
<div class="col col--xs-6">
<p class="col__label">.col--xs-6</p>
</div>
<div class="col col--xs-6">
<p class="col__label">.col--xs-6</p>
</div>
</div>
</div>
<div class="grid">
<div class="grid__row">
<div class="col col--xs-12">
<h2>Responsive Layout</h2>
<p>The grid is configured to use the same media query breakpoints as Bootstrap:</p>
<ul>
<li><code>$xsmall</code> - 0px and up</li>
<li><code>$small</code> - 576px and up</li>
<li><code>$medium</code> - 768px and up</li>
<li><code>$large</code> - 992px and up</li>
<li><code>$x-large</code> - 1200px and up</li>
</ul>
<p>These are used with the <code>min-width</code> CSS property to provide a Mobile First approach to a responsive DOM.</p>
</div>
<div class="col col--xs-12 col--sm-4">
<p class="col__label">.col--xs-12<br/>.col--sm-4</p>
</div>
<div class="col col--xs-12 col--sm-8">
<p class="col__label">.col--xs-12<br/>.col--sm-8</p>
</div>
<div class="col col--xs-12 col--sm-3">
<p class="col__label">.col--xs-12<br/>.col--sm-3</p>
</div>
<div class="col col--xs-12 col--sm-9">
<p class="col__label">.col--xs-12<br/>.col--sm-9</p>
</div>
<div class="col col--xs-12 col--md-10">
<p class="col__label">.col--xs-12<br/>.col--md-10</p>
</div>
<div class="col col--xs-12 col--md-2">
<p class="col__label">.col--xs-12<br/>.col--md-2</p>
</div>
<div class="col col--xs-6 col--xlg-3">
<p class="col__label">.col--xs-6<br/>.col-xlg-3</p>
</div>
<div class="col col--xs-6 col--xlg-3">
<p class="col__label">.col--xs-6<br/>.col-xlg-3</p>
</div>
<div class="col col--xs-12 col--xlg-3">
<p class="col__label">.col--xs-12<br/>.col--xlg-3</p>
</div>
<div class="col col--xs-12 col--xlg-3">
<p class="col__label">.col--xs-12<br/>.col-xlg-3</p>
</div>
</div>
</div>
<div class="grid">
<div class="grid__row">
<div class="col col--xs-12">
<h2>Nested Grid</h2>
<p>To create a nested grid, add a <code>.grid__row</code> element inside a <code>.col</code> element.</p>
</div>
<div class="col col--xs-6">
<p class="col__label">.col--xs-6</p>
<div class="grid__row">
<div class="col col--xs-12 col--md-4">
<p class="col__label">.col--xs-12<br/>.col--md-4</p>
</div>
<div class="col col--xs-12 col--md-4">
<p class="col__label">.col--xs-12<br/>.col--md-4</p>
</div>
<div class="col col--xs-12 col--md-4">
<p class="col__label">.col--xs-12<br/>.col--md-4</p>
</div>
</div>
</div>
<div class="col col--xs-6">
<p class="col__label">.col--xs-6</p>
<div class="grid__row">
<div class="col col--xs-4 col--md-12">
<p class="col__label">.col--xs-4<br/>.col--md-12</p>
</div>
<div class="col col--xs-4 col--md-12">
<p class="col__label">.col--xs-4<br/>.col--md-12</p>
</div>
<div class="col col--xs-4 col--md-12">
<p class="col__label">.col--xs-4<br/>.col--md-12</p>
</div>
</div>
</div>
</div>
</div>
<style>
body {
margin: 0;
font-family: 'Roboto', sans-serif;
}
.col__label {
box-sizing: border-box;
font-size: 10px;
background-color: #eee;
padding: 15px 10px;
line-height: 15px;
white-space: nowrap;
max-width: 100%;
overflow: hidden;
margin: 0;
}
li {
line-height: 2;
}
code {
background-color: #eee;
padding: 5px;
}
img {
width: 100%;
height: 50px;
}
</style>
</body>
</html>