fa_rails 0.1.22 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +23 -7
- data/fa_rails.gemspec +2 -2
- data/lib/fa/base.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0c5ec0ed2af445a927bc74382f2c7f3b058fa14e547972ec70ce36f24ab263b
|
4
|
+
data.tar.gz: b7361b459aaee1fcc70b068048bbbc37cb4f857b1f7ca682f8dc05b262213435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5885e9e3df860401c03b9869cd50170682092a1dcbd88d8a74d09015bc860f4f115b52d7489a6e5c699b6e48c027d4ea6be63cfbccc14aa8f14f5c2554b54353
|
7
|
+
data.tar.gz: 6cd3fdae68d50111ffa742f78048d3999db816b2fd1d70f04c06b971c64035cddf07168a11a794c1dfc27fca7f3aa8db3e00a0eb6da0e7b951beb8f603fa2272
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fa_rails (0.1.
|
4
|
+
fa_rails (0.1.23)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -9,7 +9,7 @@ GEM
|
|
9
9
|
diff-lcs (1.3)
|
10
10
|
docile (1.3.1)
|
11
11
|
json (2.1.0)
|
12
|
-
rake (12.3.
|
12
|
+
rake (12.3.3)
|
13
13
|
rspec (3.7.0)
|
14
14
|
rspec-core (~> 3.7.0)
|
15
15
|
rspec-expectations (~> 3.7.0)
|
data/README.md
CHANGED
@@ -29,29 +29,41 @@ corresponding locations in your app, and ensure you correctly include all files.
|
|
29
29
|
|
30
30
|
### FontAwesome CDN
|
31
31
|
|
32
|
-
|
33
|
-
[How to Use](https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=web-fonts-with-css)
|
34
|
-
page and copy the appropriate CDN link tag.
|
32
|
+
You can also link into the FontAwesome CDN, in either of two ways:
|
35
33
|
|
36
|
-
|
34
|
+
#### Version-Specific Link
|
35
|
+
|
36
|
+
You can use this helper method in your layout:
|
37
37
|
|
38
38
|
```ruby
|
39
39
|
FA::Link.new(version: 'v5.3.1', integrity: 'sha384-some-key-here').safe
|
40
40
|
```
|
41
41
|
|
42
|
-
|
42
|
+
Or, go to the FontAwesome
|
43
|
+
[How to Use](https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=web-fonts-with-css)
|
44
|
+
page and copy the appropriate CDN link tag.
|
45
|
+
|
46
|
+
**Be sure to also register each domain that will use this CDN link.**
|
47
|
+
|
48
|
+
##### Free
|
43
49
|
|
44
50
|
```html
|
45
51
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-some-key-here" crossorigin="anonymous">
|
46
52
|
```
|
47
53
|
|
48
|
-
|
54
|
+
##### Pro
|
49
55
|
|
50
56
|
```html
|
51
57
|
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-some-key-here" crossorigin="anonymous">
|
52
58
|
```
|
53
59
|
|
54
|
-
|
60
|
+
#### Kit Link
|
61
|
+
|
62
|
+
Use this helper method in your layout:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
FA::Link.kit('kit-id')
|
66
|
+
```
|
55
67
|
|
56
68
|
## Usage
|
57
69
|
|
@@ -147,6 +159,10 @@ css #=> String – arbitrary CSS classes, space-delimited, applied to the layer
|
|
147
159
|
FA::Icon.p('lock', fa: 'fw')
|
148
160
|
#=> "<i class='fas fa-fw fa-lock fa-1x' style='' data-fa-transform='' title=''></i>"
|
149
161
|
|
162
|
+
# Duotone fire-alt icon with swapped opacity
|
163
|
+
FA::Icon.p('fire-alt', fa: 'swap-opacity')
|
164
|
+
#=> "<i class='fas fa-swap-opacity fa-fire-alt fa-1x' style='' data-fa-transform='' title=''></i>"
|
165
|
+
|
150
166
|
# Duotone fire-alt icon with specified opacities
|
151
167
|
FA::Icon.p('fire-alt', style: :duotone, raw_css: { '--fa-primary-opacity' => '0.6', '--fa-secondary-opacity' => '0.4' })
|
152
168
|
#=> "<i class='fad fa-fire-alt fa-1x' style='--fa-primary-opacity: 0.4; --fa-secondary-opacity: 0.6;' data-fa-transform='' title=''></i>"
|
data/fa_rails.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'fa_rails'
|
3
|
-
s.version = '0.1.
|
4
|
-
s.date = '
|
3
|
+
s.version = '0.1.23'
|
4
|
+
s.date = '2020-06-18'
|
5
5
|
s.summary = 'FontAwesome helper for Rails'
|
6
6
|
s.description = 'A helper module for using FontAwesome icons in Rails.'
|
7
7
|
s.homepage = 'http://rubygems.org/gems/fa_rails'
|
data/lib/fa/base.rb
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
module FA
|
4
4
|
# FontAwesome 5 (Pro) Helper core class for inheritance
|
5
5
|
class Base
|
6
|
+
STYLES = {
|
7
|
+
solid: 's', regular: 'r', light: 'l', thin: 't', duotone: 'd', brands: 'b'
|
8
|
+
}.freeze
|
9
|
+
|
6
10
|
# Outputs the formatted string directly.
|
7
11
|
def raw
|
8
12
|
#
|
@@ -131,9 +135,9 @@ module FA
|
|
131
135
|
|
132
136
|
def parse_style(options)
|
133
137
|
return if options[:css].to_s.match?(/fa[srldb]/)
|
134
|
-
return 'fas' unless
|
138
|
+
return 'fas' unless STYLES.keys.include?(options[:style])
|
135
139
|
|
136
|
-
'fa' +
|
140
|
+
'fa' + STYLES[options[:style]]
|
137
141
|
end
|
138
142
|
end
|
139
143
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fa_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Fiander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|