2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-17 19:21:23 +03:00

grid vars updated

This commit is contained in:
Mark Otto
2012-11-30 15:43:07 -08:00
parent b8b266ca7c
commit adc2c779a0
10 changed files with 52 additions and 52 deletions
+20 -20
View File
@@ -319,7 +319,7 @@
}
// CSS3 Content Columns
.content-columns(@columnCount, @columnGap: @gridGutterWidth) {
.content-columns(@columnCount, @columnGap: @grid-gutter-width) {
-webkit-column-count: @columnCount;
-moz-column-count: @columnCount;
column-count: @columnCount;
@@ -474,19 +474,19 @@
// Make a Grid
// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
.makeRow() {
margin-left: @gridGutterWidth * -1;
margin-left: @grid-gutter-width * -1;
.clearfix();
}
.makeColumn(@columns: 1, @offset: 0) {
float: left;
margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2);
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
margin-left: (@grid-column-width * @offset) + (@grid-gutter-width * (@offset - 1)) + (@grid-gutter-width * 2);
width: (@grid-column-width * @columns) + (@grid-gutter-width * (@columns - 1));
}
// The Grid
#grid {
.core(@gridColumnWidth, @gridGutterWidth, @gridRowWidth) {
.core(@grid-column-width, @grid-gutter-width, @grid-row-width) {
.spanX(@index) when (@index > 0) {
(~".span@{index}") { .span(@index); }
@@ -503,16 +503,16 @@
// Base styles
.offset(@columns) {
margin-left: percentage(@columns / @gridColumns);
margin-left: percentage(@columns / @grid-columns);
}
.span(@columns) {
width: percentage(@columns / @gridColumns);
width: percentage(@columns / @grid-columns);
}
.row {
// Negative indent the columns so text lines up
margin-left: @gridGutterWidth / -2;
margin-right: @gridGutterWidth / -2;
margin-left: @grid-gutter-width / -2;
margin-right: @grid-gutter-width / -2;
// Clear the floated columns
.clearfix();
}
@@ -520,8 +520,8 @@
[class*="span"] {
float: left; // Collapse whitespace
min-height: 1px; // Prevent empty columns from collapsing
padding-left: @gridGutterWidth / 2;
padding-right: @gridGutterWidth / 2;
padding-left: @grid-gutter-width / 2;
padding-right: @grid-gutter-width / 2;
// Proper box-model (padding doesnt' add to width)
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
@@ -529,13 +529,13 @@
}
// Generate .spanX and .offsetX
.spanX(@gridColumns);
.offsetX(@gridColumns);
.spanX(@grid-columns);
.offsetX(@grid-columns);
}
.input(@gridColumnWidth, @gridGutterWidth, @gridRowWidth) {
.input(@grid-column-width, @grid-gutter-width, @grid-row-width) {
.spanX(@index) when (@index > 0) {
(~"input.span@{index}, textarea.span@{index}, select.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
@@ -552,20 +552,20 @@
.span(@columns) {
// TODO: Figure out how to add this back behind a class
// Part 1: Since inputs require padding *and* margin, we subtract the grid gutter width, as a percent of the row, from the default column width.
//width: percentage(@columns / @gridColumns) - percentage(@gridGutterWidth / @gridRowWidth);
//width: percentage(@columns / @grid-columns) - percentage(@grid-gutter-width / @grid-row-width);
// Part 2: That subtracted width then gets split in half and added to the left and right margins.
// margin-left: percentage((@gridGutterWidth / 2) / @gridRowWidth);
// margin-right: percentage((@gridGutterWidth / 2) / @gridRowWidth);
// margin-left: percentage((@grid-gutter-width / 2) / @grid-row-width);
// margin-right: percentage((@grid-gutter-width / 2) / @grid-row-width);
}
.offset(@columns) {
// Take the normal offset margin and add an extra gutter's worth.
margin-left: percentage(@columns / @gridColumns) + percentage((@gridGutterWidth / 2) / @gridRowWidth);
margin-left: percentage(@columns / @grid-columns) + percentage((@grid-gutter-width / 2) / @grid-row-width);
}
// Generate .spanX and .offsetX
.spanX(@gridColumns);
.offsetX(@gridColumns);
.spanX(@grid-columns);
.offsetX(@grid-columns);
}