It would be awesome if we could easily use FA layering and masking. https://fontawesome.com/how-to-use/svg-with-js#masking and https://fontawesome.com/how-to-use/svg-with-js#layering

For masking, maybe add a checkbox to the field settings which adds a secondary autocomplete field to use as the mask?

For layers, maybe an option is to make the fontawesome field multi-value ( field storage -> Allowed number of values > 1 ), and if there is more than one field present, change the template to have the .fa-layers class on the wrapper?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scottsawyer created an issue. See original summary.

Daniel.Moberly’s picture

I think this is definitely doable. Masking for sure is simple as it follows the same sort of rules as Power Transforms, which are already included. I think we can handle layers the way you suggest by adding an option to the widget to optionally display multi-value icons as layers. I'll update here shortly.

Daniel.Moberly’s picture

Title: Add support for layers and masking » Add support for masking

Let's change this issue to support masking only and open a child issue for layer support.

Daniel.Moberly’s picture

Title: Add support for masking » Add support for masking to the Icon field

Updating title again

Daniel.Moberly’s picture

Status: Active » Needs review
FileSize
6.19 KB

Attaching a patch which adds masking support to the icon field.

scottsawyer’s picture

Thank you, will try the patch in a couple of hours.

  • Daniel.Moberly committed 467368f on 8.x-2.x
    Issue #2933851 by Daniel.Moberly: Add support for masking to the Icon...
scottsawyer’s picture

Wow, this works so good!! Love it!

I will test the patch on: https://www.drupal.org/project/fontawesome/issues/2934509

Daniel.Moberly’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.