children-of-ie 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/children-of-ie.rb +2 -2
- data/stylesheets/_children-of-ie.scss +9 -5
- metadata +1 -1
data/lib/children-of-ie.rb
CHANGED
@@ -3,7 +3,7 @@ Compass::Frameworks.register("children-of-ie", :path => "#{File.dirname(__FILE__
|
|
3
3
|
|
4
4
|
# Sass script string parsing
|
5
5
|
module Sass::Script::Functions
|
6
|
-
def
|
6
|
+
def children_of_ie_nth(input)
|
7
7
|
n = "n"
|
8
8
|
b = ""
|
9
9
|
result = input.value.gsub(n, b)
|
@@ -13,7 +13,7 @@ end
|
|
13
13
|
|
14
14
|
module ChildrenOfIe
|
15
15
|
|
16
|
-
VERSION = "0.0.
|
16
|
+
VERSION = "0.0.2"
|
17
17
|
DATE = "2012-12-12"
|
18
18
|
|
19
19
|
end
|
@@ -1,22 +1,26 @@
|
|
1
|
+
////////////////////////
|
2
|
+
// nth-child() support for IE 7 and 8
|
3
|
+
////////////////////////
|
4
|
+
|
1
5
|
@function nth-child($n) {
|
2
6
|
|
3
7
|
// If a single number for nth.
|
4
8
|
@if type-of($n) == number {
|
5
9
|
$nth-child: first-child;
|
6
10
|
@for $i from 2 through $n {
|
7
|
-
$nth-child: append($nth-child, #{"
|
11
|
+
$nth-child: append($nth-child, #{"+*"});
|
8
12
|
}
|
9
13
|
@return #{":"}$nth-child;
|
10
14
|
}
|
11
15
|
|
12
16
|
// If a nth-child string, need to parse the string.
|
13
17
|
@else {
|
14
|
-
$n: nth(
|
15
|
-
$nth-child:
|
18
|
+
$n: nth(children-of-ie-nth($n), 1);
|
19
|
+
$nth-child: first-child;
|
16
20
|
@for $i from 2 through $n {
|
17
|
-
$nth-child: append($nth-child, #{"
|
21
|
+
$nth-child: append($nth-child, #{"~*"});
|
18
22
|
}
|
19
|
-
@return $nth-child;
|
23
|
+
@return #{":"}$nth-child;
|
20
24
|
}
|
21
25
|
}
|
22
26
|
|