-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.html
323 lines (291 loc) · 8.56 KB
/
bootstrap.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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
---
# You don't need to edit this file, it's empty on purpose.
# Edit theme's home layout instead if you wanna make some changes
# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults
layout: default
permalink: bootstrap
online: true
image-brand: /images/bootstrap-4.svg
---
<h1>Bootstrap</h1>
<h2>What is bootstrap</h2>
<p>
Bootstrap is a css framework. It provides a grid, some components and some
sass variables and mixins. This is very convenient for fast developement.
This website shows some grid and sass features. The components are useful
for a quick frontend but we lose the graphical identity. My goal is to show
that we can use bootstrap without losing our identity.
</p>
<h2>Mobile first</h2>
<p>
Bootstrap provides responsive breakpoints. That means that we can adapt the
size of our elements depending on the screen size.
</p>
<p>
The strategy chosen by bootstrap is mobile first. If we don't specify any
breakpoint, the size will apply to all screen sizes beginning by the smallest.
If we specify one, the spacing will apply to the one that is specified and
the bigger ones. Thus you need to think about what happens when the screen
size increase.
</p>
<div class="section">
<h2>The Grid</h2>
<p>
</p>
<div class="example">
{% highlight HTML %}
<div class="container">
<div class="row">
<div class="col">
1 of 3
</div>
<div class="col-6">
2 of 3 (wider)
</div>
<div class="col">
3 of 3
</div>
</div>
</div>
{% endhighlight %}
<div class="container">
<div class="row">
<div class="col example-div">
1 of 3
</div>
<div class="col-6 example-div">
2 of 3 (wider)
</div>
<div class="col example-div">
3 of 3
</div>
</div>
</div>
</div>
<hr>
<div class="example">
{% highlight html %}
<div class="container">
<div class="row">
<div class="col d-none d-md-flex">
1 of 3
</div>
<div class="col-md-8 col-12">
2 of 3 (wider)
</div>
<div class="col d-none d-md-flex">
3 of 3
</div>
</div>
</div>
{% endhighlight %}
<div class="container">
<div class="row">
<div class="col d-none d-md-flex example-div">
1 of 3
</div>
<div class="col-md-8 col-block example-div">
2 of 3 (wider)
</div>
<div class="col d-none d-md-flex example-div">
3 of 3
</div>
</div>
</div>
</div>
<hr>
<div class="example">
{% highlight html %}
<div class="container">
<div class="row">
<div class="col d-none d-md-flex">
1 of 3
</div>
<div class="col-md-8 col-10 offset-1 offset-md-0">
2 of 3 (wider)
</div>
<div class="col d-none d-md-flex">
3 of 3
</div>
</div>
</div>
{% endhighlight %}
<div class="container">
<div class="row">
<div class="col d-none d-md-flex example-div">
1 of 3
</div>
<div class="col-md-8 col-10 offset-1 offset-md-0 example-div">
2 of 3 (wider)
</div>
<div class="col d-none d-md-flex example-div">
3 of 3
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="section">
<h2>Horizontal alignment</h2>
<div class="example">
{% highlight html %}
<div class="container">
<div class="row justify-content-start">
<div class="col-4">One of two columns</div>
<div class="col-4">One of two columns</div>
</div>
<div class="row justify-content-center">
<div class="col-4">One of two columns</div>
<div class="col-4">One of two columns</div>
</div>
<div class="row justify-content-end">
<div class="col-4">One of two columns</div>
<div class="col-4">One of two columns</div>
</div>
<div class="row justify-content-around">
<div class="col-4">One of two columns</div>
<div class="col-4">One of two columns</div>
</div>
<div class="row justify-content-between">
<div class="col-4">One of two columns</div>
<div class="col-4">One of two columns</div>
</div>
</div>
{% endhighlight %}
<div class="container">
<div class="example-row justify-content-start">
<div class="col-4 example-div">One of two columns</div>
<div class="col-4 example-div">One of two columns</div>
</div>
<div class="example-row justify-content-center">
<div class="col-4 example-div">One of two columns</div>
<div class="col-4 example-div">One of two columns</div>
</div>
<div class="example-row justify-content-end">
<div class="col-4 example-div">One of two columns</div>
<div class="col-4 example-div">One of two columns</div>
</div>
<div class="example-row justify-content-around">
<div class="col-4 example-div">One of two columns</div>
<div class="col-4 example-div">One of two columns</div>
</div>
<div class="example-row justify-content-between">
<div class="col-4 example-div">One of two columns</div>
<div class="col-4 example-div">One of two columns</div>
</div>
</div>
</div>
</div>
<hr>
<div class="section">
<h2>Vertical alignment</h2>
<div class="example">
{% highlight html %}
<div class="container">
<div class="row align-items-start">
<div class="col">One of three columns</div>
<div class="col">One of three columns</div>
<div class="col">One of three columns</div>
</div>
<div class="row align-items-center">
<div class="col">One of three columns</div>
<div class="col">One of three columns</div>
<div class="col">One of three columns</div>
</div>
<div class="row align-items-end">
<div class="col">One of three columns</div>
<div class="col">One of three columns</div>
<div class="col">One of three columns</div>
</div>
</div>
{% endhighlight %}
<div class="container">
<div class="big-row align-items-start">
<div class="col example-div">One of three columns</div>
<div class="col example-div">One of three columns</div>
<div class="col example-div">One of three columns</div>
</div>
<div class="big-row align-items-center">
<div class="col example-div">One of three columns</div>
<div class="col example-div">One of three columns</div>
<div class="col example-div">One of three columns</div>
</div>
<div class="big-row align-items-end">
<div class="col example-div">One of three columns</div>
<div class="col example-div">One of three columns</div>
<div class="col example-div">One of three columns</div>
</div>
</div>
</div>
</div>
<hr>
<div class="section">
<h2>Sass mixins (custom class)</h2>
<div class="example">
<p>We have this mixin:</p>
{% highlight scss %}
.example-content-main {
@include make-col-ready();
@include make-col(6);
@include media-breakpoint-up(lg) {
@include make-col(8);
}
}
{% endhighlight %}
</div>
<div class="example">
<p>So those two codes should render the same way:<p>
{% highlight html %}
<div class="example-content-main">
<!-- content here -->
</div>
{% endhighlight %}
<div class="example-content-main example-div">
<!-- content here -->
</div>
</div>
<div class="example">
{% highlight html %}
<div class="container-fluid" style="padding-right: 0px;padding-left: 0px;">
<div class="col-6 col-lg-8">
<!-- content here -->
</div>
</div>
{% endhighlight %}
<div class="container-fluid" style="padding-right: 0px;padding-left: 0px;">
<div class="col-6 col-lg-8 example-div">
<!-- content here -->
</div>
</div>
<div class="explanation-below">
<p>
As you can see the only difference is a padding because of the
.container class. That's why we remove it the bad way. We could also
add some padding in the .example-content-main but that's not what we
want in the current example. Another option would be to @extend .container-fluid.
</p>
</div>
</div>
<div class="example">
{% highlight scss %}
.container-fluid-no-padding {
@extend .container-fluid;
padding-right: 0px;
padding-left: 0px;
}
{% endhighlight %}
{% highlight html %}
<div class="container-fluid-no-padding">
<div class="col-6 col-lg-8">
<!-- content here -->
</div>
</div>
{% endhighlight %}
<div class="container-fluid-no-padding">
<div class="col-6 col-lg-8 example-div">
<!-- content here -->
</div>
</div>
</div>
</div>