From b76d98eee3fa4a1a8d7fb281a31a7d20982459d3 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 23 Jun 2013 15:05:50 -0700 Subject: [PATCH] Fixes #8211: restore proper table grid class behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Needs work though—we shouldn't be setting this stuff with the attribute selectors, but it's the easiest solution for now. --- less/grid.less | 46 ++++++++++++++++++++++++++++++++++++++++++---- less/tables.less | 8 +++++--- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/less/grid.less b/less/grid.less index b97d1d5c4a..e8082d3695 100644 --- a/less/grid.less +++ b/less/grid.less @@ -2,7 +2,6 @@ // Grid system // -------------------------------------------------- - // Set the container width, and override it for fixed navbars in media queries .container { .container-fixed(); @@ -51,9 +50,6 @@ .col-lg-11, .col-lg-12 { position: relative; - // Float and set width: 100%; for easy stacking on mobile devices - float: left; - width: 100%; // Prevent columns from collapsing when empty min-height: 1px; // Inner gutter via padding @@ -68,6 +64,20 @@ // // Tiny device columns (smartphones) +.col-1, +.col-2, +.col-3, +.col-4, +.col-5, +.col-6, +.col-7, +.col-8, +.col-9, +.col-10, +.col-11, +.col-12 { + float: left; +} .col-1 { width: percentage((1 / @grid-columns)); } .col-2 { width: percentage((2 / @grid-columns)); } .col-3 { width: percentage((3 / @grid-columns)); } @@ -87,6 +97,20 @@ max-width: @container-tablet; } + .col-sm-1, + .col-sm-2, + .col-sm-3, + .col-sm-4, + .col-sm-5, + .col-sm-6, + .col-sm-7, + .col-sm-8, + .col-sm-9, + .col-sm-10, + .col-sm-11, + .col-sm-12 { + float: left; + } .col-sm-1 { width: percentage((1 / @grid-columns)); } .col-sm-2 { width: percentage((2 / @grid-columns)); } .col-sm-3 { width: percentage((3 / @grid-columns)); } @@ -144,6 +168,20 @@ .container { max-width: @container-desktop; } + .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, + .col-lg-12 { + float: left; + } .col-lg-1 { width: percentage((1 / @grid-columns)); } .col-lg-2 { width: percentage((2 / @grid-columns)); } .col-lg-3 { width: percentage((3 / @grid-columns)); } diff --git a/less/tables.less b/less/tables.less index fa5fd554b2..88481a9444 100644 --- a/less/tables.less +++ b/less/tables.less @@ -184,16 +184,18 @@ th { // ----------------- // Reset default table behavior -table col[class*="col-span-"] { +table col[class^="col-"] { float: none; display: table-column; } -table td[class*="col-span-"], -table th[class*="col-span-"] { +table td[class^="col-"], +table th[class^="col-"] { float: none; display: table-cell; } + + // TABLE BACKGROUNDS // ----------------- // Exact selectors below required to override .table-striped