Commit c814ad18 authored by Mark Otto's avatar Mark Otto

Combine separate efforts for grid mixins into one, cleanup and reorganize

parent 969cb04a
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</title> </title>
<!-- Bootstrap core CSS --> <!-- Bootstrap core CSS -->
<link href="{{ page.base_url }}dist/css/bootstrap.css" rel="stylesheet"> <link href="{{ page.base_url }}dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Documentation extras --> <!-- Documentation extras -->
<link href="{{ page.base_url }}docs-assets/css/docs.css" rel="stylesheet"> <link href="{{ page.base_url }}docs-assets/css/docs.css" rel="stylesheet">
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -400,6 +400,12 @@ body { ...@@ -400,6 +400,12 @@ body {
.bs-docs-home .bs-masthead-links { .bs-docs-home .bs-masthead-links {
margin-left: 350px; margin-left: 350px;
} }
.bs-docs-home .bs-social {
margin-bottom: 10px;
}
.bs-docs-home .bs-masthead-links {
margin-top: 10px;
}
} }
@media screen and (min-width: 992px) { @media screen and (min-width: 992px) {
.bs-docs-home .carbonad { .bs-docs-home .carbonad {
......
This diff is collapsed.
...@@ -565,6 +565,7 @@ ...@@ -565,6 +565,7 @@
td& { display: none !important; } td& { display: none !important; }
} }
// Grid System // Grid System
// ----------- // -----------
...@@ -696,6 +697,80 @@ ...@@ -696,6 +697,80 @@
} }
// Framework grid generation
//
// Used only by Bootstrap to generate the correct number of grid classes given
// any value of `@grid-columns`.
.make-grid-columns() {
// Common styles for all sizes of grid columns, widths 1-12
.col(@index) when (@index = 1) { // initial
@item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
.col(@index + 1, @item);
}
.col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo
@item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
.col(@index + 1, ~"@{list}, @{item}");
}
.col(@index, @list) when (@index > @grid-columns) { // terminal
@{list} {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
}
}
.col(1); // kickstart it
}
.make-grid-columns-float(@class) {
.col(@index) when (@index = 1) { // initial
@item: ~".col-@{class}-@{index}";
.col(@index + 1, @item);
}
.col(@index, @list) when (@index < @grid-columns) { // general
@item: ~".col-@{class}-@{index}";
.col(@index + 1, ~"@{list}, @{item}");
}
.col(@index, @list) when (@index = @grid-columns) { // terminal
@{list} {
float: left;
}
}
.col(1); // kickstart it
}
.calc-grid(@index, @class, @type) when (@type = width) {
.col-@{class}-@{index} {
width: percentage((@index / @grid-columns));
}
}
.calc-grid(@index, @class, @type) when (@type = push) {
.col-@{class}-push-@{index} {
left: percentage((@index / @grid-columns));
}
}
.calc-grid(@index, @class, @type) when (@type = pull) {
.col-@{class}-pull-@{index} {
right: percentage((@index / @grid-columns));
}
}
.calc-grid(@index, @class, @type) when (@type = offset) {
.col-@{class}-offset-@{index} {
margin-left: percentage((@index / @grid-columns));
}
}
// Basic looping in LESS
.make-grid(@index, @class, @type) when (@index > 0) {
.calc-grid(@index, @class, @type);
// next iteration
.make-grid(@index - 1, @class, @type);
}
// Form validation states // Form validation states
// //
// Used in forms.less to generate the form validation CSS for warnings, errors, // Used in forms.less to generate the form validation CSS for warnings, errors,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment