Created
September 24, 2013 07:34
-
-
Save Garito/6681487 to your computer and use it in GitHub Desktop.
Bootstrap 3 mixins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Grid | |
With bootstrap 2 you do: | |
<div class="span2"> | |
</div> | |
With boostrap 3 I do: | |
<div class="Logo"> | |
</div> | |
then at a less file: | |
.Logo { | |
.make-xs-column(2); # This is the mixin used to small mobile screens | |
@media (min-width: @screen-sm) { # Medium mobile screens (alias tablets) | |
.make-sm-column(2); | |
} | |
@media (min-width: @screen-md) { # Small desktops | |
.make-md-column(2); | |
} | |
@media (min-width: @screen-lg) { # Large desktops | |
.make-lg-column(2); | |
} | |
} | |
bootstrap 2 | |
<div class="container"> | |
<div class="row"></div> | |
</div> | |
boostrap 3 | |
<div class="Dashboard"> | |
<div class="Digest"></div> | |
</div> | |
on Less | |
.Dashboard { | |
.container; | |
.Digest { | |
.make-row() | |
} | |
} | |
Icons | |
boostrap 2 | |
<i class="icon-ok"></i> | |
boostrap 3 | |
<span class="ok"> <span> # Note the space inside the tag | |
less | |
.ok { | |
.glyphicon; | |
.glyphicon-ok; | |
} | |
Tabs & Pills | |
boostrap 2 | |
<ul class="nav nav-tabs"> # for pills will use nav nav-pills | |
<li class="active"><a href="#">tab 1</a></li> | |
<li><a href="#">tab 2</a></li> | |
</ul> | |
bootstrap 3 | |
<ul class="Tabs"> | |
<li><a href="#">tab 1</a></li> | |
<li><a href="#">tab 2</a></li> | |
</ul> | |
less | |
.Tabs { | |
.nav; | |
.nav-tabs; | |
li:first-child { | |
.active; | |
} | |
} | |
and so on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment