Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Refactor grid pseudo-selectors to use "of-type"

  • Loading branch information...
commit 4b2deaa1dba51afe5715ee992c0b15fb1397d603 1 parent 01d1450
Patrick Fulton authored December 18, 2012

Showing 1 changed file with 35 additions and 18 deletions. Show diff stats Hide diff stats

  1. 53  app/scss/lib/_grid.scss
53  app/scss/lib/_grid.scss
@@ -15,7 +15,7 @@ $grid_width: ((($column_width+($gutter_width))*$columns)-$gutter_width);
15 15
 @mixin container {
16 16
   width: $grid_width;
17 17
   margin: auto;
18  
-  max-width: 1250px;
  18
+  max-width: 1300px;
19 19
   *zoom: 1;
20 20
 }
21 21
 
@@ -32,11 +32,11 @@ $grid_width: ((($column_width+($gutter_width))*$columns)-$gutter_width);
32 32
 }
33 33
 
34 34
 @mixin prepend($num) {
35  
-  margin-left: column_width($num) + ($gutter_width);
  35
+  margin-left: column_width($num) + ($gutter_width * 2);
36 36
 }
37 37
 
38 38
 @mixin append($num) {
39  
-  margin-right: column_width($num) + ($gutter_width);
  39
+  margin-right: column_width($num) + ($gutter_width * 2);
40 40
 }
41 41
 
42 42
 @mixin last {
@@ -44,61 +44,78 @@ $grid_width: ((($column_width+($gutter_width))*$columns)-$gutter_width);
44 44
 }
45 45
 
46 46
 @mixin last-col2 {
47  
-  &:nth-child(n) {
  47
+  &:nth-of-type(n) {
48 48
     margin-right: $gutter-width;
49  
-    .lt-ie8 &{
  49
+    .lt-ie8 & {
50 50
       margin-right: $gutter_width - 0.25%;
51 51
     }
52 52
     float: left;
53 53
     clear: none;
54 54
   }
55  
-  &:nth-child(2n+2) {
  55
+  &:nth-of-type(2n+2) {
56 56
     @include last;
57 57
     float: right;
58 58
   }
59  
-  &:nth-child(2n+3) {
  59
+  &:nth-of-type(2n+3) {
60 60
     clear: both;
61 61
   }
62 62
 }
63 63
 
64 64
 @mixin last-col3 {
65  
-  &:nth-child(n) {
  65
+  &:nth-of-type(n) {
66 66
     margin-right: $gutter-width;
67  
-    .lt-ie8 &{
  67
+    .lt-ie8 & {
68 68
       margin-right: $gutter_width - 0.25%;
69 69
     }
70 70
     float: left;
71 71
     clear: none;
72 72
   }
73  
-  &:nth-child(3n+3) {
  73
+  &:nth-of-type(3n+3) {
74 74
     @include last;
75 75
     float: right;
76 76
   }
77  
-  &:nth-child(3n+4) {
  77
+  &:nth-of-type(3n+4) {
78 78
     clear: both;
79 79
   }
80 80
 }
81 81
 
82 82
 @mixin last-col4 {
83  
-  &:nth-child(n) {
  83
+  &:nth-of-type(n) {
84 84
     margin-right: $gutter-width;
85  
-    .lt-ie8 &{
  85
+    .lt-ie8 & {
86 86
       margin-right: $gutter_width - 0.25%;
87 87
     }
88 88
     float: left;
89 89
     clear: none;
90 90
   }
91  
-  &:nth-child(4n+4) {
  91
+  &:nth-of-type(4n+4) {
92 92
     @include last;
93 93
     float: right;
94 94
   }
95  
-  &:nth-child(4n+5) {
  95
+  &:nth-of-type(4n+5) {
  96
+    clear: both;
  97
+  }
  98
+}
  99
+
  100
+@mixin last-col6 {
  101
+  &:nth-of-type(n) {
  102
+    margin-right: $gutter-width;
  103
+    .lt-ie8 & {
  104
+      margin-right: $gutter_width - 0.25%;
  105
+    }
  106
+    float: left;
  107
+    clear: none;
  108
+  }
  109
+  &:nth-of-type(6n+6) {
  110
+    @include last;
  111
+    float: right;
  112
+  }
  113
+  &:nth-of-type(6n+7) {
96 114
     clear: both;
97 115
   }
98 116
 }
99 117
 
100 118
 @mixin mobile-grid {
101  
-  width: 95%;
102  
-  margin-left:2.5%;
103  
-  margin-right: 2.5%;
  119
+  padding-left: 2.5%;
  120
+  padding-right: 2.5%;
104 121
 }

0 notes on commit 4b2deaa

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