victor 0.1.3 → 0.2.0

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: 431ab32a3fa62036ae96a19407b9d094c341d528
4
- data.tar.gz: e89f0cd32f623efb913637ee3008138316c8cc07
3
+ metadata.gz: 3333d626e4dc11a717da2f915ead15331fae87c0
4
+ data.tar.gz: 562d059c2c3596c1f7f890554459f821b0714cdf
5
5
  SHA512:
6
- metadata.gz: 8af34c733b974281ea9391200043342c29f49435ab87b99500b53c0aee13636f2995bfd519dac077f9b00a77dfa5ccf1adc2a77de204b8369c73315cd4298b39
7
- data.tar.gz: 8bf0c2746c191ed22d70017bd37518edbd8a745de74707844d2bec215fd8b9cb5ad2d9634cd9636d1a495eba2428f8229aa5716c1a8f1f58abb3ba5d4c8fed01
6
+ metadata.gz: 5e1c3fc3bb74ffab341c3b572c286a15493a4a32136f1c9169b8c155cc0c2ef0218008fd3fdedf517d82d40123ae80fbff7f765a06f34734fce761b1c0ea0304
7
+ data.tar.gz: 9537eb2500737b43fa4cb6ea8192d9f67e5828045f184a7352f16da7fd8795d8a53823285ec4e16b4c53eb44592e882515c780b1252e2b18420b0dbb45a67243
data/README.md CHANGED
@@ -234,6 +234,23 @@ svg.css = {
234
234
  Underscore characters will be converted to dashes (`stroke_width` becomes
235
235
  `stroke-width`).
236
236
 
237
+
238
+ If you need to add CSS statements , like `@import`, use the following syntax:
239
+
240
+ ```ruby
241
+ css['@import'] = [
242
+ "url('https://fonts.googleapis.com/css?family=Audiowide')",
243
+ "url('https://fonts.googleapis.com/css?family=Pacifico')"
244
+ ]
245
+ ```
246
+
247
+ When the value of the CSS attribute is an array, Victor will simply use
248
+ the values of the array and prefix each of them with the key, so the above
249
+ will result in two `@import url(...)` rows.
250
+
251
+ See the [custom fonts example](https://github.com/DannyBen/victor/tree/master/examples#12-custom-fonts)
252
+
253
+
237
254
  ---
238
255
 
239
256
  [examples]: https://github.com/DannyBen/victor/tree/master/examples#examples
data/lib/victor/css.rb CHANGED
@@ -23,6 +23,10 @@ module Victor
23
23
  result.push " " * indent + "#{key} {"
24
24
  result.push convert_hash(value, indent+2)
25
25
  result.push " " * indent + "}"
26
+ elsif value.is_a? Array
27
+ value.each do |row|
28
+ result.push " " * indent + "#{key} #{row};"
29
+ end
26
30
  else
27
31
  result.push " " * indent + "#{key}: #{value};"
28
32
  end
@@ -1,3 +1,3 @@
1
1
  module Victor
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: victor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-11 00:00:00.000000000 Z
11
+ date: 2017-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runfile