Iconpicker CSS using reset styling ahead of Font Awesome

Created on 8 February 2024, 10 months ago
Updated 5 June 2024, 6 months ago

Problem/Motivation

The iconpicker widget seems to be using the CSS from the reset file as priority over the font declaration for the fontawesome classes itself

Within the default library installation there is a class for .icons-selector * which includes values to use inherited font, with a fallback for generic apple system font kits, but this is taking precedence over the individually classed .fas, .far icons, and so it just renders them as unrecognised glyphs. If I disable this declaration in the stylesheet in the browser, it works.

It works when rendering it in the front end, the actual icons render on the page, but the picker doesn't show, so it's not really usable.

Going to test if I can replicate this purely on a vanilla install with my specific setup, but in terms of the configuration for the fontawesome module itself, I have

Tag:

πŸ› Bug report
Status

Active

Version

2.26

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom aps-Andrew

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @aps-Andrew
  • πŸ‡³πŸ‡±Netherlands tim_dj Netherlands

    I ran into this issue as well. Icon picker widget works when used directly on a content type. It does not work when used in an inline form like paragraphs.

    It has to do with order of loading CSS. When used directly on content first CSS of icon picker is loaded and then overwritten by font awesome. When using the icon picker in inline form like paragraphs the CSS of the iconpicker will be attached on opening edit mode which means it's loaded last.

  • πŸ‡³πŸ‡±Netherlands tim_dj Netherlands

    I currently have a workaround for this by making sure the css get's loaded before font awesome by using form alter and adding the library to edit form.

    /**
     * Work around for https://www.drupal.org/project/fontawesome/issues/3420074.
     */
    function ibcommon_form_commerce_product_form_alter(&$form, FormStateInterface $form_state, $form_id) {
      $form['#attached']['library'][] = 'fontawesome_iconpicker_widget/fontawesome-iconpicker';
    }
    
    /**
     * Work around for https://www.drupal.org/project/fontawesome/issues/3420074.
     */
    function ibcommon_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
      $form['#attached']['library'][] = 'fontawesome_iconpicker_widget/fontawesome-iconpicker';
    }
    
  • πŸ‡ͺπŸ‡ΈSpain idiaz.roncero Madrid

    I'm having the same issue.

  • πŸ‡§πŸ‡ͺBelgium Wouter Waeytens

    I can confirm the workaround is working.

  • πŸ‡ΊπŸ‡ΈUnited States cbwiedel

    I'm having the same issue on Drupal 10.3.1 + PHP 8.3.9

    Using Font Awesome Icon Picker 8.x-2.26

Production build 0.71.5 2024