compass-string2base64 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{README.md → README.rdoc} +16 -19
- data/lib/compass/string2base64/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 538686826a1727a6616b53b7ab7ce9aa19ff8675
|
4
|
+
data.tar.gz: d5555790bfaa06296a88282af8040a368cc2ec13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eed5d0eec8bf52bc02c008269505a81bb70166e33569430c0456dcf952fb178c63a363cb23065af10ab86fccac775602fa020a871f3813a4868c53c3fddb901
|
7
|
+
data.tar.gz: 1de08df0546075ee08a674c3ca52a8240c50981dc2ae668a5c5ca098ec74d076736fb6fd93b8682f0b0ad612f95e81d60c70844778b06788fafb00933f470182
|
data/{README.md → README.rdoc}
RENAMED
@@ -1,25 +1,23 @@
|
|
1
|
-
|
1
|
+
= Compass::String2base64
|
2
2
|
|
3
3
|
Sass/Compass extension to convert string (for example SVG) to base64, use via background or background-images with MIME-type image/svg+xml.
|
4
4
|
|
5
5
|
Data URI via base64 hash in css usage:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
```
|
6
|
+
some-css-selector {
|
7
|
+
background-image: url(data:[MIME-type][; charset];base64,_base64_hash_string_goes_here_)
|
8
|
+
}
|
9
|
+
|
11
10
|
As you can see, you can not specify the encoding.
|
12
11
|
|
13
12
|
SVG in background in css usage:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
Support of SVG via backgrounds http://caniuse.com/#feat=svg-css
|
13
|
+
some-css-selector {
|
14
|
+
background-image: url(data:image/svg+xml;charset=utf-8;base64,_SVG_base64_hash_string_goes_here_)
|
15
|
+
}
|
16
|
+
|
17
|
+
Support of SVG via backgrounds http://caniuse.com/=feat=svg-css
|
20
18
|
|
21
19
|
|
22
|
-
|
20
|
+
== Installation
|
23
21
|
|
24
22
|
Add this line to your application's Gemfile:
|
25
23
|
|
@@ -33,15 +31,14 @@ Or install it yourself as:
|
|
33
31
|
|
34
32
|
$ gem install compass-string2base64
|
35
33
|
|
36
|
-
|
34
|
+
== Usage
|
35
|
+
|
36
|
+
background-image: url('data:image/svg+xml;charset=utf-8;base64,'
|
37
|
+
+ string2base64('<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"></svg>'));
|
37
38
|
|
38
|
-
```
|
39
|
-
background-image: url('data:image/svg+xml;charset=utf-8;base64,'
|
40
|
-
+ string2base64('<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"></svg>'));
|
41
|
-
```
|
42
39
|
See example folder and run `compass compile --force` in this folder to see the result
|
43
40
|
|
44
|
-
|
41
|
+
== Contributing
|
45
42
|
|
46
43
|
1. Fork it
|
47
44
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-string2base64
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Pinchuk
|
@@ -63,7 +63,7 @@ files:
|
|
63
63
|
- .gitignore
|
64
64
|
- Gemfile
|
65
65
|
- LICENSE.txt
|
66
|
-
- README.
|
66
|
+
- README.rdoc
|
67
67
|
- Rakefile
|
68
68
|
- compass-string2base64.gemspec
|
69
69
|
- example/config.rb
|