Helper#icon prepends fa- to given fa class string#106
Helper#icon prepends fa- to given fa class string#106nnattawat wants to merge 2 commits intoFortAwesome:mainfrom
Conversation
ex: icon('flag 2x') rather than icon('flag', class: 'fa-2x')
There was a problem hiding this comment.
Shadowing outer local variable - icon.
f5ea06f to
09d0c7d
Compare
There was a problem hiding this comment.
Shadowing outer local variable - icon.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
c15208c to
18dec73
Compare
There was a problem hiding this comment.
I think it's not that long haha :)
|
You should probably call |
|
How about optional array instead? |
18dec73 to
6acfa88
Compare
There was a problem hiding this comment.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
|
@nickpearson and @andreykul good points guys. I have made it to support more formats. icon(:flag)
# => <i class="fa fa-flag">icon('flag')
# => <i class="fa fa-flag">icon([:flag, :fw, '2x'])
# => <i class="fa fa-flag fa-fw fa-2x">icon("flag fw 2x")
# => <i class="fa fa-flag fa-fw fa-2x"> |
…flag fa-2x'> now we can do:
- icon('flag 2x')
- icon([:flag, '2x'])
6acfa88 to
825bbac
Compare
I made the improvement on the helper method. Now it can handle multiple
fa-classes.For example, to add
fa-2xclass we need to useicon('flag', class='fa-2x')which make more sense to use it as the following.