Skip to content
Browse files

Merge pull request #3 from pfulton/master

Refactor grid pseudo-selectors to use "...-of-type"
  • Loading branch information...
2 parents ebd7489 + 4b2deaa commit e2f1659e6936d8831a9808848a9bc3f41f093784 @elefontpress committed Dec 18, 2012
Showing with 35 additions and 18 deletions.
  1. +35 −18 app/scss/lib/_grid.scss
View
53 app/scss/lib/_grid.scss
@@ -15,7 +15,7 @@ $grid_width: ((($column_width+($gutter_width))*$columns)-$gutter_width);
@mixin container {
width: $grid_width;
margin: auto;
- max-width: 1250px;
+ max-width: 1300px;
*zoom: 1;
}
@@ -32,73 +32,90 @@ $grid_width: ((($column_width+($gutter_width))*$columns)-$gutter_width);
}
@mixin prepend($num) {
- margin-left: column_width($num) + ($gutter_width);
+ margin-left: column_width($num) + ($gutter_width * 2);
}
@mixin append($num) {
- margin-right: column_width($num) + ($gutter_width);
+ margin-right: column_width($num) + ($gutter_width * 2);
}
@mixin last {
margin-right: 0;
}
@mixin last-col2 {
- &:nth-child(n) {
+ &:nth-of-type(n) {
margin-right: $gutter-width;
- .lt-ie8 &{
+ .lt-ie8 & {
margin-right: $gutter_width - 0.25%;
}
float: left;
clear: none;
}
- &:nth-child(2n+2) {
+ &:nth-of-type(2n+2) {
@include last;
float: right;
}
- &:nth-child(2n+3) {
+ &:nth-of-type(2n+3) {
clear: both;
}
}
@mixin last-col3 {
- &:nth-child(n) {
+ &:nth-of-type(n) {
margin-right: $gutter-width;
- .lt-ie8 &{
+ .lt-ie8 & {
margin-right: $gutter_width - 0.25%;
}
float: left;
clear: none;
}
- &:nth-child(3n+3) {
+ &:nth-of-type(3n+3) {
@include last;
float: right;
}
- &:nth-child(3n+4) {
+ &:nth-of-type(3n+4) {
clear: both;
}
}
@mixin last-col4 {
- &:nth-child(n) {
+ &:nth-of-type(n) {
margin-right: $gutter-width;
- .lt-ie8 &{
+ .lt-ie8 & {
margin-right: $gutter_width - 0.25%;
}
float: left;
clear: none;
}
- &:nth-child(4n+4) {
+ &:nth-of-type(4n+4) {
@include last;
float: right;
}
- &:nth-child(4n+5) {
+ &:nth-of-type(4n+5) {
+ clear: both;
+ }
+}
+
+@mixin last-col6 {
+ &:nth-of-type(n) {
+ margin-right: $gutter-width;
+ .lt-ie8 & {
+ margin-right: $gutter_width - 0.25%;
+ }
+ float: left;
+ clear: none;
+ }
+ &:nth-of-type(6n+6) {
+ @include last;
+ float: right;
+ }
+ &:nth-of-type(6n+7) {
clear: both;
}
}
@mixin mobile-grid {
- width: 95%;
- margin-left:2.5%;
- margin-right: 2.5%;
+ padding-left: 2.5%;
+ padding-right: 2.5%;
}

0 comments on commit e2f1659

Please sign in to comment.
Something went wrong with that request. Please try again.