Browse code

Use a more modular structure for better extensibility

Benjamin Roth authored on28/08/2015 08:55:03
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,51 @@
1
+$col_margin: 2%;
2
+
3
+.ce_gallery > ul {
4
+  &:before,
5
+  &:after {
6
+    content: " "; /* 1 */
7
+    display: table; /* 2 */
8
+  }
9
+
10
+  &:after {
11
+    clear: both;
12
+  }
13
+
14
+  /**
15
+   * For IE 6/7 only
16
+   * Include this rule to trigger hasLayout and contain floats.
17
+   */
18
+  & {
19
+    *zoom: 1;
20
+  }
21
+
22
+  & > li {
23
+    margin: 0 $col_margin $col_margin;
24
+    float: left;
25
+
26
+    &.col_first {
27
+      clear: none;
28
+    }
29
+
30
+  }
31
+
32
+  &.cols_1 > li {
33
+    float: none;
34
+  }
35
+
36
+  @for $i from 1 through 12 {
37
+    &.cols_#{$i} > li:nth-child(1n) {
38
+      width: (100-($i * (2 * $col_margin) - (2 * $col_margin))) / $i;
39
+    }
40
+    &.cols_#{$i} > li:nth-child(#{$i}n+1) {
41
+      margin-left: 0;
42
+      clear: left;
43
+    }
44
+    &.cols_#{$i} > li:nth-child(#{$i}n) {
45
+      margin-right: 0;
46
+    }
47
+  }
48
+}
49
+
50
+
51
+