remi-css3-now 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -0
- data/VERSION +1 -1
- data/lib/css3-now.rb +1 -1
- data/spec/css3-now_spec.rb +17 -1
- metadata +1 -1
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/css3-now.rb
CHANGED
@@ -28,7 +28,7 @@ private
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def self.replace_browser_specific css, attribute, browsers = nil
|
31
|
-
css.gsub /#{ attribute }: ([
|
31
|
+
css.gsub /#{ attribute }: ([-\.#\w ]+);/, browser_specific(attribute, '\1', browsers)
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|
data/spec/css3-now_spec.rb
CHANGED
@@ -14,7 +14,23 @@ describe CSS3Now do
|
|
14
14
|
"-khtml-border-radius: 5em 10px -3.4em; border-radius: 5em 10px -3.4em;\n }"
|
15
15
|
end
|
16
16
|
|
17
|
-
it 'should work with
|
17
|
+
it 'should work with additional characters: -, ., #' do
|
18
|
+
css = CSS3Now.new("#header {\n border-radius: 5em 10px -3.4em #fff;\n }").to_css
|
19
|
+
css.should == "#header {\n -moz-border-radius: 5em 10px -3.4em #fff; -webkit-border-radius: 5em 10px -3.4em #fff; " +
|
20
|
+
"-khtml-border-radius: 5em 10px -3.4em #fff; border-radius: 5em 10px -3.4em #fff;\n }"
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should work with multiple instances of an attibute' do
|
24
|
+
CSS3Now.new("#x {\n opacity: 0.5;\n } #y {\n opacity: 0.4;\n }").to_css.should ==
|
25
|
+
"#x {\n filter:alpha(opacity=50); opacity: 0.5;\n }" +
|
26
|
+
" #y {\n filter:alpha(opacity=40); opacity: 0.4;\n }"
|
27
|
+
|
28
|
+
css = CSS3Now.new("#header1 {\n border-radius: 1px;\n } " +
|
29
|
+
"#header2 {\n border-radius: 5em;\n }" ).to_css
|
30
|
+
css.should ==
|
31
|
+
"#header1 {\n -moz-border-radius: 1px; -webkit-border-radius: 1px; -khtml-border-radius: 1px; border-radius: 1px;\n } " +
|
32
|
+
"#header2 {\n -moz-border-radius: 5em; -webkit-border-radius: 5em; -khtml-border-radius: 5em; border-radius: 5em;\n }"
|
33
|
+
end
|
18
34
|
|
19
35
|
it 'should replace box-shadow' do
|
20
36
|
css = CSS3Now.new("#header {\n box-shadow: 5em;\n }").to_css
|