aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2011-08-27 15:30:18 -0700
committerMark Otto <[email protected]>2011-08-27 15:30:18 -0700
commit650251228bfda8d57a09b4b350ce2b9f1e0efcc1 (patch)
tree8672baea7464277a7ef8d498a0b0bbe69f11306a /lib
parentb552281558be2ae54e71df064527af5239c494ab (diff)
downloadbootstrap-650251228bfda8d57a09b4b350ce2b9f1e0efcc1.tar.xz
bootstrap-650251228bfda8d57a09b4b350ce2b9f1e0efcc1.zip
redefine the grid to use attribute selectors with css regex, make previously fixed grid values use variables we use elsewhere
Diffstat (limited to 'lib')
-rw-r--r--lib/patterns.less2
-rw-r--r--lib/preboot.less2
-rw-r--r--lib/scaffolding.less30
3 files changed, 13 insertions, 21 deletions
diff --git a/lib/patterns.less b/lib/patterns.less
index cc25b120c..9dabd22c9 100644
--- a/lib/patterns.less
+++ b/lib/patterns.less
@@ -434,7 +434,7 @@ footer {
}
&:active {
- @shadow: inset 0 3px 7px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.05);
+ @shadow: inset 0 2px 4px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.05);
.box-shadow(@shadow);
}
diff --git a/lib/preboot.less b/lib/preboot.less
index 75e75020b..f5d5a48d1 100644
--- a/lib/preboot.less
+++ b/lib/preboot.less
@@ -36,7 +36,7 @@
@gridColumns: 16;
@gridColumnWidth: 40px;
@gridGutterWidth: 20px;
-@extraSpace: 40px;
+@extraSpace: (@gridGutterWidth * 2); // For our grid calculations
@siteWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
// Color Scheme
diff --git a/lib/scaffolding.less b/lib/scaffolding.less
index d1b621c13..0833e0c83 100644
--- a/lib/scaffolding.less
+++ b/lib/scaffolding.less
@@ -9,28 +9,14 @@
.row {
.clearfix();
- margin-left: -20px;
+ margin-left: -1 * @gridGutterWidth;
- // Default columns
- .span1,
- .span2,
- .span3,
- .span4,
- .span5,
- .span6,
- .span7,
- .span8,
- .span9,
- .span10,
- .span11,
- .span12,
- .span13,
- .span14,
- .span15,
- .span16 {
+ // Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7)
+ // Credit to @dhg for the idea
+ [class^="span"] {
display: inline;
float: left;
- margin-left: 20px;
+ margin-left: @gridGutterWidth;
}
// Default columns
@@ -64,6 +50,12 @@
.offset10 { .offset(10); }
.offset11 { .offset(11); }
.offset12 { .offset(12); }
+
+ // Unique column sizes for 16-column grid
+ .span-one-third { width: 300px; }
+ .span-two-thirds { width: 620px; }
+ .offset-one-third { margin-left: 320px; }
+ .offset-two-thirds { margin-left: 640px; }
}