Tips and Tricks
Floating
float: left;, display: block; is not required anymore as every element which is floated automatically gets the block state. This does not apply to sub-elements.Image Optimisation
Contribution
Code of Conduct
- Ensure code validates against or own guidelines
- Write documentation about what you are doing
- If you are not sure, just ask - join our community #aldryn on Freenode
Documentation
- clone the repository using
git clone https://github.com/aldryn/aldryn-boilerplate-bootstrap3.git - navigate to the documentation through
cd aldryn-boilerplate-bootstrap3/docs - run
make installto install additional requirements - run
make runto let the server run
docs/.- Always start paths with a
/and leave the trailing slash. - Leave two spaces before a title.
- Write “Django”, “django CMS” or “Aldryn”.
- Write names properly: Sass, Bootstrap, JavaScript instead of sass (or SASS), bootstrap and javascript.
- Additional guidelines from django CMS apply.
Pull Requests
- master is used for hotfix releases (1.1.x)
- develop is used for features and issues (1.x.x)
Releases
- Adapt the CHANGELOG.rst
- Adapt AUTHORS.rst if required
- Bump version in boilerplate.json
- Create a GitHub tag
- Add the release notes on the GitHub tag
- Build new tag on readthedocs.org
- Run
bash tools/release.shbefore release on Aldryn - Run
aldryn boilerplate uploadto release on Aldryn - Test, inform, present
Use case
Solution
Five columns Layout
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
|
.col-xs-5ths,
.col-sm-5ths,
.col-md-5ths,
.col-lg-5ths {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
.col-xs-5ths {
width: 20%;
float: left;
}
@media (min-width: 768px) {
.col-sm-5ths {
width: 20%;
float: left;
}
}
@media (min-width: 992px) {
.col-md-5ths {
width: 20%;
float: left;
}
}
@media (min-width: 1200px) {
.col-lg-5ths {
width: 20%;
float: left;
}
}
|
1
2
3
4
5
|
<div class="row">
<div class="col-md-5ths col-xs-6">
...
</div>
</div>
|
How to Enable Bootstrap 3 Hover Dropdowns
1
2
3
4
5
6
|
@media only screen and (min-width : 768px) {
/* Make Navigation Toggle on Desktop Hover */
.dropdown:hover .dropdown-menu {
display: block;
}
}
|
1
2
3
4
5
|
$('.dropdown-toggle').click(function() {
var location = $(this).attr('href');
window.location.href = location;
return false;
});
|
Don’t forget Container Fluid for Full Width Rows
Column ordering
Let’s study the following example:
1
2
3
4
5
6
7
8
|
<div class="row">
<div class="col-sm-6 col-sm-push-6">
<!-- Column A -->
</div>
<div class="col-sm-6 col-sm-pull-6">
<!-- Column B -->
</div>
</div>
|
Labels for Screen Readers
1
2
|
<label for="id-of-input" class="sr-only">My Input</label>
<input type="text" name="myinput" placeholder="My Input" id="id-of-input">
|
No Gutter Column
1
2
3
4
|
.no-gutter > [class*='col-'] {
padding-right:0;
padding-left:0;
}
|
1
2
3
4
5
6
7
8
9
10
11
|
<div class="row no-gutter">
<div class="col-md-4">
...
</div>
<div class="col-md-4">
...
</div>
<div class="col-md-4">
...
</div>
</div>
|













