drg_material_icons 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +22 -0
- data/README.md +113 -0
- data/Rakefile +12 -0
- data/app/assets/fonts/material-icons-outline.woff2 +0 -0
- data/app/assets/fonts/material-icons-regular.woff2 +0 -0
- data/app/assets/stylesheets/drg_material_icons.css +2430 -0
- data/app/helpers/drg_material_icons/rails/icon_helper.rb +112 -0
- data/lib/drg_material_icons/engine.rb +6 -0
- data/lib/drg_material_icons/version.rb +6 -0
- data/lib/drg_material_icons.rb +2 -0
- data/lib/generators/drg_material_icons_update/USAGE +8 -0
- data/lib/generators/drg_material_icons_update/common.css +284 -0
- data/lib/generators/drg_material_icons_update/drg_material_icons_update_generator.rb +41 -0
- data/lib/generators/drg_material_icons_update/material-icons-outline.codepoints +2117 -0
- data/lib/generators/drg_material_icons_update/material-icons-regular.codepoints +2142 -0
- data/test/dummy/app/assets/config/manifest.js +3 -0
- data/test/dummy/app/assets/stylesheets/sass-import.css.sass +1 -0
- data/test/dummy/app/assets/stylesheets/scss-import.css.scss +1 -0
- data/test/dummy/app/assets/stylesheets/sprockets-require.css +3 -0
- data/test/dummy/app/controllers/pages_controller.rb +2 -0
- data/test/dummy/app/views/pages/icons.html.erb +3 -0
- data/test/dummy/config/application.rb +19 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +22 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config.ru +4 -0
- data/test/font_awesome_rails_test.rb +70 -0
- data/test/icon_helper_test.rb +138 -0
- data/test/test_helper.rb +7 -0
- metadata +123 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 731645fc92805f885633dca40a7f54614684ac5af2b9bdb60b3c25cf239d6ce7
|
4
|
+
data.tar.gz: 4fbda12624d094b0240d849d698b0b2e92884479f85272317b07e870a947a605
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 14379303dfaac47dd523e896a75a06609e126e4fbb57084ae55a2f2f86623e9edef0e7d663357cd0630e136e5f24f1c26577028a37242d8a961443ecd1b91da1
|
7
|
+
data.tar.gz: eda291498d65f9f271c8a47bbce4dfe0d0d0a866c3b8fe5d4fa08e9dde7d287a8472f25e39a74da34f8ae9d3ccd2efb3d3b1c4006844266c95f0df18ebcda93f
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012-2022 Damjan Rems
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
# drg-material-icons
|
2
|
+
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/drg_material_icons.svg)](https://rubygems.org/gems/drg_material_icons)
|
4
|
+
[![Gem Downloads](https://img.shields.io/gem/dt/drg_material_icons.svg)](https://rubygems.org/gems/drg_material_icons)
|
5
|
+
|
6
|
+
drg_material_icons provides the
|
7
|
+
[Material-icons](https://fonts.google.com/icons) web fonts and
|
8
|
+
stylesheets as a Rails engine for use with the asset pipeline.<br>
|
9
|
+
|
10
|
+
drg_material_icons gem also provides compatibility with the old font-awesome-rails gem.
|
11
|
+
If you are still using old Font awesome v4.7 icons and want to upgrade to
|
12
|
+
more rich Google material icons you simply replace font-awesome-rails gem
|
13
|
+
with drg_material_icons gem.
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Add this to your Gemfile:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem "drg_material_fonts"
|
21
|
+
```
|
22
|
+
|
23
|
+
and run `bundle install`.
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
In your `application.css`, include the css file:
|
28
|
+
|
29
|
+
```css
|
30
|
+
/*
|
31
|
+
*= require drg_material_fonts
|
32
|
+
*/
|
33
|
+
```
|
34
|
+
Then restart your webserver if it was previously running.
|
35
|
+
|
36
|
+
### Sass Support
|
37
|
+
|
38
|
+
If you prefer [SCSS](http://sass-lang.com/documentation/file.SASS_REFERENCE.html), add this to your
|
39
|
+
`application.css.scss` file:
|
40
|
+
|
41
|
+
```scss
|
42
|
+
@import "drg_material_icons";
|
43
|
+
```
|
44
|
+
|
45
|
+
If you use the
|
46
|
+
[Sass indented syntax](http://sass-lang.com/docs/yardoc/file.INDENTED_SYNTAX.html),
|
47
|
+
add this to your `application.css.sass` file:
|
48
|
+
|
49
|
+
```sass
|
50
|
+
@import drg_material_icons
|
51
|
+
```
|
52
|
+
|
53
|
+
### Helpers
|
54
|
+
|
55
|
+
You also get some helpers (`mi_icon` and `mi_stacked_icon`) that make your
|
56
|
+
views look great with new icons.
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
mi_icon "photo_camera"
|
60
|
+
# => <i class="mi mi-camera_retro"></i>
|
61
|
+
|
62
|
+
mi_icon "photo_camera", text: "Take a photo"
|
63
|
+
# => <i class="mi mi-photo_camera"></i> Take a photo
|
64
|
+
|
65
|
+
mi_icon "chevron_right", text: "Get started", right: true
|
66
|
+
# => Get started <i class="mi mi-chevron_right mi-poll-right"></i>
|
67
|
+
|
68
|
+
content_tag(:li, mi_icon("check li", text: "Bulleted list item"))
|
69
|
+
# => <li><i class="mi mi-check mi-li"></i> Bulleted list item</li>
|
70
|
+
```
|
71
|
+
|
72
|
+
drg_material_icons includes two material icon font types. Regular and outline.
|
73
|
+
To get outline type of icons simply add -o suffix to icon name.
|
74
|
+
```ruby
|
75
|
+
mi_icon "photo_camera-o"
|
76
|
+
# => <i class="mi-o mi-camera-retro"></i>
|
77
|
+
|
78
|
+
mi_icon "chevron_right-o", text: "Get started", right: true
|
79
|
+
# => Get started <i class="mi-o mi-chevron_right mi-poll-right">Get started</i>
|
80
|
+
```
|
81
|
+
|
82
|
+
## Compatibility with font-awesome-rails gem
|
83
|
+
|
84
|
+
drg_material_icons gem is a fork of font-awesome-rails
|
85
|
+
gem https://github.com/bokmann/font-awesome-rails and is
|
86
|
+
its 100% replacement. It includes fa_icon method as an alias to mi_icon method, which is just
|
87
|
+
renamed from original font-awesome-rails project. Therefore, you can mix
|
88
|
+
use of old and new variant of method call.
|
89
|
+
```ruby
|
90
|
+
mi_icon "photo_camera"
|
91
|
+
# => <i class="mi mi-camera"></i>
|
92
|
+
|
93
|
+
# or
|
94
|
+
|
95
|
+
fa_icon "photo-camera"
|
96
|
+
# => <i class="mi mi-camera"></i>
|
97
|
+
```
|
98
|
+
|
99
|
+
There are examples where FontAwesome icons names are different as
|
100
|
+
Material icons names. You have two solutions to this problem. You can
|
101
|
+
find font icon replacement on https://fonts.google.com/icon and update icon name in
|
102
|
+
your source code or, define content code for the icon name in your application
|
103
|
+
CSS file.
|
104
|
+
```css
|
105
|
+
.mi-times:before {content: '\e5cd'}
|
106
|
+
```
|
107
|
+
|
108
|
+
## License
|
109
|
+
|
110
|
+
* The Material design icons project is licensed under the [Apache License 2.0](
|
111
|
+
https://github.com/google/material-design-icons/blob/master/LICENSE)
|
112
|
+
* The drg-material-icons project is licensed under the
|
113
|
+
[MIT License](http://opensource.org/licenses/mit-license.html).
|
data/Rakefile
ADDED
Binary file
|
Binary file
|