mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-19 16:54:24 +01:00
Grid updates
- Removed mixins for generating grid classes - Thus, we manually declare every grid class, from 1-11 (12th unit is excluded as that's the same as no grid columns) - No more need for `.col` base class (yay!) - Negative indent the rows at tablets and above once again (ugh, still working through this part) - Add support for `.col-md` for tablet-specific grid columns - Still need to figure out offsets, pushes, and pulls on other devices—right now only available on desktop
This commit is contained in:
parent
b62fa23d9a
commit
19d0726609
292
docs/assets/css/bootstrap.css
vendored
292
docs/assets/css/bootstrap.css
vendored
@ -763,12 +763,40 @@ pre code {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.row {
|
||||
margin-right: -15px;
|
||||
margin-left: -15px;
|
||||
}
|
||||
}
|
||||
|
||||
.row .row {
|
||||
margin-right: -15px;
|
||||
margin-left: -15px;
|
||||
}
|
||||
|
||||
.col {
|
||||
.col-1,
|
||||
.col-2,
|
||||
.col-3,
|
||||
.col-4,
|
||||
.col-5,
|
||||
.col-6,
|
||||
.col-7,
|
||||
.col-8,
|
||||
.col-9,
|
||||
.col-10,
|
||||
.col-11,
|
||||
.col-lg-1,
|
||||
.col-lg-2,
|
||||
.col-lg-3,
|
||||
.col-lg-4,
|
||||
.col-lg-5,
|
||||
.col-lg-6,
|
||||
.col-lg-7,
|
||||
.col-lg-8,
|
||||
.col-lg-9,
|
||||
.col-lg-10,
|
||||
.col-lg-11 {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 100%;
|
||||
@ -777,198 +805,218 @@ pre code {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.col-sm-12 {
|
||||
width: 100%;
|
||||
.col-1 {
|
||||
width: 0.08333333333333333;
|
||||
}
|
||||
|
||||
.col-sm-11 {
|
||||
width: 91.66666666666666%;
|
||||
.col-2 {
|
||||
width: 0.16666666666666666;
|
||||
}
|
||||
|
||||
.col-sm-10 {
|
||||
width: 83.33333333333334%;
|
||||
.col-3 {
|
||||
width: 0.25;
|
||||
}
|
||||
|
||||
.col-sm-9 {
|
||||
width: 75%;
|
||||
.col-4 {
|
||||
width: 0.3333333333333333;
|
||||
}
|
||||
|
||||
.col-sm-8 {
|
||||
width: 66.66666666666666%;
|
||||
.col-5 {
|
||||
width: 0.4166666666666667;
|
||||
}
|
||||
|
||||
.col-sm-7 {
|
||||
width: 58.333333333333336%;
|
||||
.col-6 {
|
||||
width: 0.5;
|
||||
}
|
||||
|
||||
.col-sm-6 {
|
||||
width: 50%;
|
||||
.col-7 {
|
||||
width: 0.5833333333333334;
|
||||
}
|
||||
|
||||
.col-sm-5 {
|
||||
width: 41.66666666666667%;
|
||||
.col-8 {
|
||||
width: 0.6666666666666666;
|
||||
}
|
||||
|
||||
.col-sm-4 {
|
||||
width: 33.33333333333333%;
|
||||
.col-9 {
|
||||
width: 0.75;
|
||||
}
|
||||
|
||||
.col-sm-3 {
|
||||
width: 25%;
|
||||
.col-10 {
|
||||
width: 0.8333333333333334;
|
||||
}
|
||||
|
||||
.col-sm-2 {
|
||||
width: 16.666666666666664%;
|
||||
.col-11 {
|
||||
width: 0.9166666666666666;
|
||||
}
|
||||
|
||||
.col-sm-1 {
|
||||
width: 8.333333333333332%;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.col-lg-12 {
|
||||
width: 100%;
|
||||
@media (min-width: 768px) {
|
||||
.col-md-1 {
|
||||
width: 0.08333333333333333;
|
||||
}
|
||||
.col-lg-11 {
|
||||
width: 91.66666666666666%;
|
||||
.col-md-2 {
|
||||
width: 0.16666666666666666;
|
||||
}
|
||||
.col-lg-10 {
|
||||
width: 83.33333333333334%;
|
||||
.col-md-3 {
|
||||
width: 0.25;
|
||||
}
|
||||
.col-lg-9 {
|
||||
width: 75%;
|
||||
.col-md-4 {
|
||||
width: 0.3333333333333333;
|
||||
}
|
||||
.col-lg-8 {
|
||||
width: 66.66666666666666%;
|
||||
.col-md-5 {
|
||||
width: 0.4166666666666667;
|
||||
}
|
||||
.col-lg-7 {
|
||||
width: 58.333333333333336%;
|
||||
.col-md-6 {
|
||||
width: 0.5;
|
||||
}
|
||||
.col-lg-6 {
|
||||
width: 50%;
|
||||
.col-md-7 {
|
||||
width: 0.5833333333333334;
|
||||
}
|
||||
.col-lg-5 {
|
||||
width: 41.66666666666667%;
|
||||
.col-md-8 {
|
||||
width: 0.6666666666666666;
|
||||
}
|
||||
.col-lg-4 {
|
||||
width: 33.33333333333333%;
|
||||
.col-md-9 {
|
||||
width: 0.75;
|
||||
}
|
||||
.col-lg-3 {
|
||||
width: 25%;
|
||||
.col-md-10 {
|
||||
width: 0.8333333333333334;
|
||||
}
|
||||
.col-md-11 {
|
||||
width: 0.9166666666666666;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.col-lg-1 {
|
||||
width: 8.333333333333332%;
|
||||
}
|
||||
.col-lg-2 {
|
||||
width: 16.666666666666664%;
|
||||
}
|
||||
.col-lg-1 {
|
||||
width: 8.333333333333332%;
|
||||
.col-lg-3 {
|
||||
width: 25%;
|
||||
}
|
||||
.col-offset-12 {
|
||||
margin-left: 100%;
|
||||
.col-lg-4 {
|
||||
width: 33.33333333333333%;
|
||||
}
|
||||
.col-offset-11 {
|
||||
margin-left: 91.66666666666666%;
|
||||
.col-lg-5 {
|
||||
width: 41.66666666666667%;
|
||||
}
|
||||
.col-offset-10 {
|
||||
margin-left: 83.33333333333334%;
|
||||
.col-lg-6 {
|
||||
width: 50%;
|
||||
}
|
||||
.col-offset-9 {
|
||||
margin-left: 75%;
|
||||
.col-lg-7 {
|
||||
width: 58.333333333333336%;
|
||||
}
|
||||
.col-offset-8 {
|
||||
margin-left: 66.66666666666666%;
|
||||
.col-lg-8 {
|
||||
width: 66.66666666666666%;
|
||||
}
|
||||
.col-offset-7 {
|
||||
margin-left: 58.333333333333336%;
|
||||
.col-lg-9 {
|
||||
width: 75%;
|
||||
}
|
||||
.col-offset-6 {
|
||||
margin-left: 50%;
|
||||
.col-lg-10 {
|
||||
width: 83.33333333333334%;
|
||||
}
|
||||
.col-offset-5 {
|
||||
margin-left: 41.66666666666667%;
|
||||
}
|
||||
.col-offset-4 {
|
||||
margin-left: 33.33333333333333%;
|
||||
}
|
||||
.col-offset-3 {
|
||||
margin-left: 25%;
|
||||
}
|
||||
.col-offset-2 {
|
||||
margin-left: 16.666666666666664%;
|
||||
.col-lg-11 {
|
||||
width: 91.66666666666666%;
|
||||
}
|
||||
.col-offset-1 {
|
||||
margin-left: 8.333333333333332%;
|
||||
}
|
||||
.col-push-12 {
|
||||
left: 100%;
|
||||
.col-offset-2 {
|
||||
margin-left: 16.666666666666664%;
|
||||
}
|
||||
.col-push-11 {
|
||||
left: 91.66666666666666%;
|
||||
.col-offset-3 {
|
||||
margin-left: 25%;
|
||||
}
|
||||
.col-push-10 {
|
||||
left: 83.33333333333334%;
|
||||
.col-offset-4 {
|
||||
margin-left: 33.33333333333333%;
|
||||
}
|
||||
.col-push-9 {
|
||||
left: 75%;
|
||||
.col-offset-5 {
|
||||
margin-left: 41.66666666666667%;
|
||||
}
|
||||
.col-push-8 {
|
||||
left: 66.66666666666666%;
|
||||
.col-offset-6 {
|
||||
margin-left: 50%;
|
||||
}
|
||||
.col-push-7 {
|
||||
left: 58.333333333333336%;
|
||||
.col-offset-7 {
|
||||
margin-left: 58.333333333333336%;
|
||||
}
|
||||
.col-push-6 {
|
||||
left: 50%;
|
||||
.col-offset-8 {
|
||||
margin-left: 66.66666666666666%;
|
||||
}
|
||||
.col-push-5 {
|
||||
left: 41.66666666666667%;
|
||||
.col-offset-9 {
|
||||
margin-left: 75%;
|
||||
}
|
||||
.col-push-4 {
|
||||
left: 33.33333333333333%;
|
||||
.col-offset-10 {
|
||||
margin-left: 83.33333333333334%;
|
||||
}
|
||||
.col-push-3 {
|
||||
left: 25%;
|
||||
}
|
||||
.col-push-2 {
|
||||
left: 16.666666666666664%;
|
||||
.col-offset-11 {
|
||||
margin-left: 91.66666666666666%;
|
||||
}
|
||||
.col-push-1 {
|
||||
left: 8.333333333333332%;
|
||||
}
|
||||
.col-pull-12 {
|
||||
right: 100%;
|
||||
.col-push-2 {
|
||||
left: 16.666666666666664%;
|
||||
}
|
||||
.col-pull-11 {
|
||||
right: 91.66666666666666%;
|
||||
.col-push-3 {
|
||||
left: 25%;
|
||||
}
|
||||
.col-pull-10 {
|
||||
right: 83.33333333333334%;
|
||||
.col-push-4 {
|
||||
left: 33.33333333333333%;
|
||||
}
|
||||
.col-pull-9 {
|
||||
right: 75%;
|
||||
.col-push-5 {
|
||||
left: 41.66666666666667%;
|
||||
}
|
||||
.col-pull-8 {
|
||||
right: 66.66666666666666%;
|
||||
.col-push-6 {
|
||||
left: 50%;
|
||||
}
|
||||
.col-pull-7 {
|
||||
right: 58.333333333333336%;
|
||||
.col-push-7 {
|
||||
left: 58.333333333333336%;
|
||||
}
|
||||
.col-pull-6 {
|
||||
right: 50%;
|
||||
.col-push-8 {
|
||||
left: 66.66666666666666%;
|
||||
}
|
||||
.col-pull-5 {
|
||||
right: 41.66666666666667%;
|
||||
.col-push-9 {
|
||||
left: 75%;
|
||||
}
|
||||
.col-pull-4 {
|
||||
right: 33.33333333333333%;
|
||||
.col-push-10 {
|
||||
left: 83.33333333333334%;
|
||||
}
|
||||
.col-pull-3 {
|
||||
right: 25%;
|
||||
.col-push-11 {
|
||||
left: 91.66666666666666%;
|
||||
}
|
||||
.col-pull-1 {
|
||||
right: 8.333333333333332%;
|
||||
}
|
||||
.col-pull-2 {
|
||||
right: 16.666666666666664%;
|
||||
}
|
||||
.col-pull-1 {
|
||||
right: 8.333333333333332%;
|
||||
.col-pull-3 {
|
||||
right: 25%;
|
||||
}
|
||||
.col-pull-4 {
|
||||
right: 33.33333333333333%;
|
||||
}
|
||||
.col-pull-5 {
|
||||
right: 41.66666666666667%;
|
||||
}
|
||||
.col-pull-6 {
|
||||
right: 50%;
|
||||
}
|
||||
.col-pull-7 {
|
||||
right: 58.333333333333336%;
|
||||
}
|
||||
.col-pull-8 {
|
||||
right: 66.66666666666666%;
|
||||
}
|
||||
.col-pull-9 {
|
||||
right: 75%;
|
||||
}
|
||||
.col-pull-10 {
|
||||
right: 83.33333333333334%;
|
||||
}
|
||||
.col-pull-11 {
|
||||
right: 91.66666666666666%;
|
||||
}
|
||||
}
|
||||
|
||||
@ -990,10 +1038,6 @@ pre code {
|
||||
}
|
||||
}
|
||||
|
||||
/*[class*="col-span-"].pull-right {
|
||||
float: right;
|
||||
}*/
|
||||
|
||||
table {
|
||||
max-width: 100%;
|
||||
background-color: transparent;
|
||||
|
113
less/grid.less
113
less/grid.less
@ -13,9 +13,29 @@
|
||||
.make-row();
|
||||
}
|
||||
|
||||
|
||||
// Common styles for small and large grid columns
|
||||
.col {
|
||||
.col-1,
|
||||
.col-2,
|
||||
.col-3,
|
||||
.col-4,
|
||||
.col-5,
|
||||
.col-6,
|
||||
.col-7,
|
||||
.col-8,
|
||||
.col-9,
|
||||
.col-10,
|
||||
.col-11,
|
||||
.col-lg-1,
|
||||
.col-lg-2,
|
||||
.col-lg-3,
|
||||
.col-lg-4,
|
||||
.col-lg-5,
|
||||
.col-lg-6,
|
||||
.col-lg-7,
|
||||
.col-lg-8,
|
||||
.col-lg-9,
|
||||
.col-lg-10,
|
||||
.col-lg-11 {
|
||||
position: relative;
|
||||
// Float and set width: 100%; for easy stacking on mobile devices
|
||||
float: left;
|
||||
@ -27,14 +47,88 @@
|
||||
padding-right: (@grid-gutter-width / 2);
|
||||
}
|
||||
|
||||
// Generate small grid classes first
|
||||
.generate-grid-columns(@grid-columns);
|
||||
// Grid column sizing
|
||||
|
||||
// Then generate the larger grid classes via media query
|
||||
@media screen and (min-width: @screen-small) {
|
||||
.generate-large-grid-columns(@grid-columns);
|
||||
// Small columns (phones and up)
|
||||
.col-1 { width: (1 / @grid-columns); }
|
||||
.col-2 { width: (2 / @grid-columns); }
|
||||
.col-3 { width: (3 / @grid-columns); }
|
||||
.col-4 { width: (4 / @grid-columns); }
|
||||
.col-5 { width: (5 / @grid-columns); }
|
||||
.col-6 { width: (6 / @grid-columns); }
|
||||
.col-7 { width: (7 / @grid-columns); }
|
||||
.col-8 { width: (8 / @grid-columns); }
|
||||
.col-9 { width: (9 / @grid-columns); }
|
||||
.col-10 { width: (10/ @grid-columns); }
|
||||
.col-11 { width: (11/ @grid-columns); }
|
||||
|
||||
// Medium columns (tablets and up)
|
||||
@media (min-width: @screen-tablet) {
|
||||
.col-md-1 { width: (1 / @grid-columns); }
|
||||
.col-md-2 { width: (2 / @grid-columns); }
|
||||
.col-md-3 { width: (3 / @grid-columns); }
|
||||
.col-md-4 { width: (4 / @grid-columns); }
|
||||
.col-md-5 { width: (5 / @grid-columns); }
|
||||
.col-md-6 { width: (6 / @grid-columns); }
|
||||
.col-md-7 { width: (7 / @grid-columns); }
|
||||
.col-md-8 { width: (8 / @grid-columns); }
|
||||
.col-md-9 { width: (9 / @grid-columns); }
|
||||
.col-md-10 { width: (10/ @grid-columns); }
|
||||
.col-md-11 { width: (11/ @grid-columns); }
|
||||
}
|
||||
|
||||
@media (min-width: @screen-desktop) {
|
||||
// Large columns (desktop and up)
|
||||
.col-lg-1 { width: percentage(1 / @grid-columns); }
|
||||
.col-lg-2 { width: percentage(2 / @grid-columns); }
|
||||
.col-lg-3 { width: percentage(3 / @grid-columns); }
|
||||
.col-lg-4 { width: percentage(4 / @grid-columns); }
|
||||
.col-lg-5 { width: percentage(5 / @grid-columns); }
|
||||
.col-lg-6 { width: percentage(6 / @grid-columns); }
|
||||
.col-lg-7 { width: percentage(7 / @grid-columns); }
|
||||
.col-lg-8 { width: percentage(8 / @grid-columns); }
|
||||
.col-lg-9 { width: percentage(9 / @grid-columns); }
|
||||
.col-lg-10 { width: percentage(10/ @grid-columns); }
|
||||
.col-lg-11 { width: percentage(11/ @grid-columns); }
|
||||
|
||||
// Offsets
|
||||
.col-offset-1 { margin-left: percentage(1 / @grid-columns); }
|
||||
.col-offset-2 { margin-left: percentage(2 / @grid-columns); }
|
||||
.col-offset-3 { margin-left: percentage(3 / @grid-columns); }
|
||||
.col-offset-4 { margin-left: percentage(4 / @grid-columns); }
|
||||
.col-offset-5 { margin-left: percentage(5 / @grid-columns); }
|
||||
.col-offset-6 { margin-left: percentage(6 / @grid-columns); }
|
||||
.col-offset-7 { margin-left: percentage(7 / @grid-columns); }
|
||||
.col-offset-8 { margin-left: percentage(8 / @grid-columns); }
|
||||
.col-offset-9 { margin-left: percentage(9 / @grid-columns); }
|
||||
.col-offset-10 { margin-left: percentage(10/ @grid-columns); }
|
||||
.col-offset-11 { margin-left: percentage(11/ @grid-columns); }
|
||||
|
||||
// Push and pull columns for source order changes
|
||||
.col-push-1 { left: percentage(1 / @grid-columns); }
|
||||
.col-push-2 { left: percentage(2 / @grid-columns); }
|
||||
.col-push-3 { left: percentage(3 / @grid-columns); }
|
||||
.col-push-4 { left: percentage(4 / @grid-columns); }
|
||||
.col-push-5 { left: percentage(5 / @grid-columns); }
|
||||
.col-push-6 { left: percentage(6 / @grid-columns); }
|
||||
.col-push-7 { left: percentage(7 / @grid-columns); }
|
||||
.col-push-8 { left: percentage(8 / @grid-columns); }
|
||||
.col-push-9 { left: percentage(9 / @grid-columns); }
|
||||
.col-push-10 { left: percentage(10/ @grid-columns); }
|
||||
.col-push-11 { left: percentage(11/ @grid-columns); }
|
||||
|
||||
.col-pull-1 { right: percentage(1 / @grid-columns); }
|
||||
.col-pull-2 { right: percentage(2 / @grid-columns); }
|
||||
.col-pull-3 { right: percentage(3 / @grid-columns); }
|
||||
.col-pull-4 { right: percentage(4 / @grid-columns); }
|
||||
.col-pull-5 { right: percentage(5 / @grid-columns); }
|
||||
.col-pull-6 { right: percentage(6 / @grid-columns); }
|
||||
.col-pull-7 { right: percentage(7 / @grid-columns); }
|
||||
.col-pull-8 { right: percentage(8 / @grid-columns); }
|
||||
.col-pull-9 { right: percentage(9 / @grid-columns); }
|
||||
.col-pull-10 { right: percentage(10/ @grid-columns); }
|
||||
.col-pull-11 { right: percentage(11/ @grid-columns); }
|
||||
}
|
||||
|
||||
// Responsive: Tablets and up
|
||||
@media screen and (min-width: @screen-tablet) {
|
||||
@ -56,8 +150,3 @@
|
||||
max-width: @container-large-desktop;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset utility classes due to specificity
|
||||
/*[class*="col-span-"].pull-right {
|
||||
float: right;
|
||||
}*/
|
||||
|
@ -419,6 +419,11 @@
|
||||
// Then clear the floated columns
|
||||
.clearfix();
|
||||
|
||||
@media (min-width: @screen-small) {
|
||||
margin-left: (@grid-gutter-width / -2);
|
||||
margin-right: (@grid-gutter-width / -2);
|
||||
}
|
||||
|
||||
// Negative margin nested rows out to align the content of columns
|
||||
.row {
|
||||
margin-left: (@grid-gutter-width / -2);
|
||||
@ -459,79 +464,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Small grid columns
|
||||
.generate-grid-columns(@grid-columns) {
|
||||
|
||||
.col-sm-X (@index) when (@index > 0) {
|
||||
.col-sm-@{index} { .col-sm-(@index); }
|
||||
.col-sm-X((@index - 1));
|
||||
}
|
||||
.col-sm-X (0) {}
|
||||
|
||||
// Generate columns
|
||||
.col-sm-X(@grid-columns);
|
||||
|
||||
// Apply the styles
|
||||
.col-sm-(@columns) {
|
||||
width: percentage((@columns / @grid-columns));
|
||||
}
|
||||
}
|
||||
|
||||
// Large grid columns
|
||||
.generate-large-grid-columns(@grid-columns) {
|
||||
|
||||
.col-lg-X (@index) when (@index > 0) {
|
||||
.col-lg-@{index} { .col-lg-(@index); }
|
||||
.col-lg-X((@index - 1));
|
||||
}
|
||||
.col-lg-X (0) {}
|
||||
|
||||
// Generate the columns
|
||||
.col-lg-X(@grid-columns);
|
||||
|
||||
// Apply the styles
|
||||
.col-lg-(@columns) {
|
||||
width: percentage((@columns / @grid-columns));
|
||||
}
|
||||
|
||||
// Offsets (gaps between columns)
|
||||
.col-offset-X (@index) when (@index > 0) {
|
||||
.col-offset-@{index} { .col-offset-(@index); }
|
||||
.col-offset-X((@index - 1));
|
||||
}
|
||||
.col-offset-X (0) {}
|
||||
|
||||
// Source ordering
|
||||
.col-push-X (@index) when (@index > 0) {
|
||||
.col-push-@{index} { .col-push-(@index); }
|
||||
.col-push-X((@index - 1));
|
||||
}
|
||||
.col-push-X (0) {}
|
||||
|
||||
// Source ordering
|
||||
.col-pull-X (@index) when (@index > 0) {
|
||||
.col-pull-@{index} { .col-pull-(@index); }
|
||||
.col-pull-X((@index - 1));
|
||||
}
|
||||
.col-pull-X (0) {}
|
||||
|
||||
// Apply the styles
|
||||
.col-offset-(@columns) {
|
||||
margin-left: percentage((@columns / @grid-columns));
|
||||
}
|
||||
.col-push-(@columns) {
|
||||
left: percentage((@columns / @grid-columns));
|
||||
}
|
||||
.col-pull-(@columns) {
|
||||
right: percentage((@columns / @grid-columns));
|
||||
}
|
||||
|
||||
// Generate .spanX and .offsetX
|
||||
.col-offset-X(@grid-columns);
|
||||
.col-push-X(@grid-columns);
|
||||
.col-pull-X(@grid-columns);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Framework mixins
|
||||
|
Loading…
x
Reference in New Issue
Block a user