Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Within fontawsome.module - "hook_icon_bundles", I noticed an "@todo" which read "Extract icons from CSS or JSON file (currently not possible)". I thought I would propose a patch, since I need some icons that aren't included in the hard-coded list.
Proposed resolution
Implement simple parsing logic that gets "_variables.scss" file (which is provided by the font awesome library) to provide a list of icons relative to the library version. Additionally I have remove the large array of font styles into a separate "inc", in-case the library doesn't exists.
Remaining tasks
Create a patch
See patch below.
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#9 | icon-list.txt | 25.19 KB | stefan.r |
#6 | fontawesome-extract-icon-from-scss-file-2691605-6-7.patch | 38.1 KB | j1mb0b |
#3 | fontawesome-extract-icon-from-scss-file-2691605-7.patch | 38.17 KB | j1mb0b |
Comments
Comment #2
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedComment #3
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedComment #4
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedComment #5
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedComment #6
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedFixed file_get_contents notice / spelling mistake.
Comment #7
j1mb0b CreditAttribution: j1mb0b as a volunteer commentedComment #8
stefan.r CreditAttribution: stefan.r commented#6 looks fine! It allows us to use the newly defined icons in 4.5.0, asthe hardcoded list in DEV is still based on 4.2.0.
Maybe just in case we use a different version locally than on the CDN,
Comment #9
stefan.r CreditAttribution: stefan.r commentedAttaching the list generated by the parser for 4.5.0.
Comment #10
bahuma20The newer versions of fontawesome (v3.2.0 and above) have a icons.yml included which could be used, too. (Maybe easier)
Comment #11
akalata CreditAttribution: akalata commentedHow is this issue different from what's been going on at #2427005: Extract icons automatically ?
Comment #12
inders CreditAttribution: inders as a volunteer and at Faichi Solutions Pvt Ltd commentedComment #13
bahuma20Added related issue