Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Which icon or FontAwesome icon isn't loading?

Solved by pamtbaau View solution

Started by Sarah L 6 years ago · 5 replies · 977 views
6 years ago

So I have started using child menus on a site I manage - www.gaug.co.uk and I am getting a square box next to it, but can't for the life of me find which FontAwesome pack or icon is missing.

Can anyone help? :)

6 years ago

@techielass, Comparing your site and the demo site of Antimatter, you seem to be missing 'line-awesome.min.css'.

That file loads font-family: FontAwesome.

6 years ago

Not sure that's it to be honest, the line-awesome.min.css does exist in my code repo and other FontAwesome files load as you can see from the footer bar...

6 years ago Solution

@techielass, The icons in your page are defined in two different ways:

  • In the footer by inserting <i class="fab fa-1x fa-facebook"></i>
    This definition comes from file 'all.min.css'
  • In the navbar by using css:
    CSS
    #header #navbar .has-children>a>span:after {
      font-family: FontAwesome;  /* FontAwesome 4.7 */
      content: '\f107';
      position: absolute;
      display: inline-block;
      right: 8px;
      top: 4px;
    }
    

    Only this one is broken.

On August 6, 2018, your have created a pull request on the repo of Antimatter to replace font-awesome 4.7 with 5.2. You replaced file css/font-awesome.min.css with css/all.min.css.

It is in css/font-awesome.min.css where the font-family FontAwesome is defined. The new font awesome 5.2 uses font-family: "Font Awesome 5 Free", but parts of Antimatter still refers to the old font-family

Could it be this caused the issue, but you didn't notice it before?

Two alternative fixes:

Fix 1:

  • Replace the css in your /css-compiled/template.css:
    From:
    CSS
    #header #navbar .has-children>a>span:after {
      font-family: FontAwesome;                /* FontAwesome 4.7 */
      content: '\f107';
      position: absolute;
      display: inline-block;
      right: 8px;
      top: 4px;
    }
    

    into:

    TXT
    #header #navbar .has-children>a>span:after {
      font-family: "Font Awesome 5 Free";      /* FontAwesome 5+ */
      font-style: normal;                      /* required */
      font-weight: 900;                        /* required */
      content: '\f107';
      position: absolute;
      display: inline-block;
      right: 8px;
      top: 4px;
    

Fix 2:

  • In file `/templates/partials/navigation.html.twig' replace line 9:
    HTML
    <span></span>
    

    with:

    TXT
    <i class="fa fa-angle-down" aria-hidden="true"></i>
    
last edited 06/27/20 by pamtbaau
6 years ago

@techielass, Any progress?

👍 1
6 years ago

Thanks fix 2 worked for me. :)

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 95 14 hours ago
General · by pamtbaau, 20 hours ago
1 61 19 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 356 5 days ago
General · by Duc , 6 days ago
3 44 6 days ago