csslite 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f83dfeb026a95df82916336fb65405c73b25361c
4
- data.tar.gz: c6e99e4a4f83a0aebc11de37333c1926f1ad6707
3
+ metadata.gz: 7fb82c1cfd6d8794f652310cfb81ab840e513644
4
+ data.tar.gz: 15ff90c9f4011b68b2b4051e5b12f05023d3aaa1
5
5
  SHA512:
6
- metadata.gz: 0be84331b8b21e029e33c5492cde7b21256213fa7fd4aeabdc133e66fb073cbd617808af4645182927036b209c91334df98fcbc2c4482d296fbb671947673b2c
7
- data.tar.gz: edc7cabcdcf6b90a9af542ed93c1a8c84608e648485e641f9363af1ee30f54a9ba434013f28b5adaf078019e5d80d1eeb9102a8e3e31fdc5612c01ac65bf6c83
6
+ metadata.gz: 3621c4f457fb16582d4b9556eea03d1a0009b86f6f407c4efe8769959093510d9b277890f91867d86b9b151679ee500fb66758f765ea9ef127019c3a43e2426b
7
+ data.tar.gz: e836886bb33ebd1ce7c2b12c42cce3e1e8801c92101d895e46faa297ef8f044b27517016fd0262c6d4a43814ebc38905e0d81ec9fd2c470678040f01d169e629
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -41,9 +41,10 @@ class CSSLite
41
41
 
42
42
  root_element.css(selector).each do |element|
43
43
 
44
- id = element.object_id
45
- @elements[id] = element.style.to_h unless @elements.has_key? id
46
- element.style[k] = v unless @elements[id].has_key? k
44
+ apply_style element, k, v
45
+
46
+ # apply the CSS to all its children
47
+ element.each_recursive {|x| apply_style x, k,v}
47
48
  end
48
49
  end
49
50
 
@@ -51,5 +52,16 @@ class CSSLite
51
52
  end
52
53
 
53
54
  end
55
+
56
+ private
57
+
58
+
59
+ def apply_style(e, k, v)
60
+
61
+ id = e.object_id
62
+ @elements[id] = e.style.to_h unless @elements.has_key? id
63
+ e.style[k] = v unless @elements[id].has_key? k
64
+
65
+ end
54
66
 
55
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csslite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  9gIs6nm8KnBHUmzrn9afy/5KR51QuJ9cQmRMA+Dwkp8jTv1PhX51X58V2yt4eEYg
32
32
  oKq4EGm16laTPw==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-09-08 00:00:00.000000000 Z
34
+ date: 2017-09-10 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
37
  email: james@jamesrobertson.eu
metadata.gz.sig CHANGED
Binary file