mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-30 15:24:08 +03:00
New grid classes
This commit is contained in:
+3
-3
@@ -12,7 +12,7 @@
|
||||
.row {
|
||||
.make-row();
|
||||
}
|
||||
[class^="span"] {
|
||||
[class*="col-span-"] {
|
||||
position: relative;
|
||||
min-height: 1px;
|
||||
padding-left: (@grid-gutter-width / 2);
|
||||
@@ -25,7 +25,7 @@
|
||||
max-width: 728px;
|
||||
}
|
||||
// Generate the grid columns and offsets
|
||||
[class^="span"] { float: left; }
|
||||
[class*="col-span-"] { float: left; }
|
||||
.generate-grid-columns(@grid-columns);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@
|
||||
}
|
||||
|
||||
// Reset utility classes due to specificity
|
||||
[class*="span"].pull-right {
|
||||
[class*="col-span-"].pull-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
+24
-24
@@ -449,52 +449,52 @@
|
||||
.generate-grid-columns(@grid-columns) {
|
||||
|
||||
// Default columns
|
||||
.spanX (@index) when (@index > 0) {
|
||||
.span@{index} { .span(@index); }
|
||||
.spanX((@index - 1));
|
||||
.col-span-X (@index) when (@index > 0) {
|
||||
.col-span-@{index} { .col-span-(@index); }
|
||||
.col-span-X((@index - 1));
|
||||
}
|
||||
.spanX(0) {}
|
||||
.col-span-X(0) {}
|
||||
|
||||
// Offsets (gaps between columns)
|
||||
.offsetX (@index) when (@index > 0) {
|
||||
.offset@{index} { .offset(@index); }
|
||||
.offsetX((@index - 1));
|
||||
.col-offset-X (@index) when (@index > 0) {
|
||||
.col-offset-@{index} { .col-offset-(@index); }
|
||||
.col-offset-X((@index - 1));
|
||||
}
|
||||
.offsetX (0) {}
|
||||
.col-offset-X (0) {}
|
||||
|
||||
// Source ordering
|
||||
.pushX (@index) when (@index > 0) {
|
||||
.push@{index} { .push(@index); }
|
||||
.pushX((@index - 1));
|
||||
.col-push-X (@index) when (@index > 0) {
|
||||
.col-push-@{index} { .col-push-(@index); }
|
||||
.col-push-X((@index - 1));
|
||||
}
|
||||
.pushX (0) {}
|
||||
.col-push-X (0) {}
|
||||
|
||||
// Source ordering
|
||||
.pullX (@index) when (@index > 0) {
|
||||
.pull@{index} { .pull(@index); }
|
||||
.pullX((@index - 1));
|
||||
.col-pull-X (@index) when (@index > 0) {
|
||||
.col-pull-@{index} { .col-pull-(@index); }
|
||||
.col-pull-X((@index - 1));
|
||||
}
|
||||
.pullX (0) {}
|
||||
.col-pull-X (0) {}
|
||||
|
||||
// Apply the styles
|
||||
.span(@columns) {
|
||||
.col-span-(@columns) {
|
||||
width: percentage((@columns / @grid-columns));
|
||||
}
|
||||
.offset(@columns) {
|
||||
.col-offset-(@columns) {
|
||||
margin-left: percentage((@columns / @grid-columns));
|
||||
}
|
||||
.push(@columns) {
|
||||
.col-push-(@columns) {
|
||||
left: percentage((@columns / @grid-columns));
|
||||
}
|
||||
.pull(@columns) {
|
||||
.col-pull-(@columns) {
|
||||
right: percentage((@columns / @grid-columns));
|
||||
}
|
||||
|
||||
// Generate .spanX and .offsetX
|
||||
.spanX(@grid-columns);
|
||||
.offsetX(@grid-columns);
|
||||
.pushX(@grid-columns);
|
||||
.pullX(@grid-columns);
|
||||
.col-span-X(@grid-columns);
|
||||
.col-offset-X(@grid-columns);
|
||||
.col-push-X(@grid-columns);
|
||||
.col-pull-X(@grid-columns);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,19 +30,21 @@ html {
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: @font-family-base;
|
||||
.font-size();
|
||||
line-height: @line-height-base;
|
||||
color: @text-color;
|
||||
background-color: @body-background;
|
||||
}
|
||||
|
||||
// Reset fonts for revelant elements
|
||||
body,
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
textarea {
|
||||
font-family: @font-family-base;
|
||||
.font-size();
|
||||
line-height: @line-height-base;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -179,12 +179,12 @@ th {
|
||||
// -----------------
|
||||
|
||||
// Reset default table behavior
|
||||
table col[class^="span"] {
|
||||
table col[class*="col-span-"] {
|
||||
float: none;
|
||||
display: table-column;
|
||||
}
|
||||
table td[class^="span"],
|
||||
table th[class^="span"] {
|
||||
table td[class*="col-span-"],
|
||||
table th[class*="col-span-"] {
|
||||
float: none;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ p {
|
||||
margin-bottom: @line-height-base;
|
||||
.font-size((@font-size-base * 1.5));
|
||||
font-weight: 200;
|
||||
line-height: 1.25;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user