Font-awesome: Transforms ignored on .fa-layers-text when using nest mutator

Created on 8 Jul 2018  路  9Comments  路  Source: FortAwesome/Font-Awesome

The nest mutator, used when the autoReplaceSvg option is set to "nest", causes power transforms to be ignored on .fa-layers-text. The mutator ignores all attributes including the style attribute generated by makeLayersTextAbstract().

This fiddle shows the calendar example from the Font Awesome documentation. While this works properly with autoReplaceSvg: true (which uses the replace mutator), no transform is applied with autoReplaceSvg: "nest" and the numbers overlap the entire calendar icon.

<span class="fa-layers fa-3x">
  <i class="fas fa-calendar"></i>
  <span class="fa-layers-text fa-inverse" data-fa-transform="shrink-8 down-3">27</span>
</span>

| Expected | replace | nest |
| --- | --- | --- |
| correct calendar | correct calendar | non-transformed calendar |

I have found the nest mutator very useful in upgrading an open source project from Font Awesome 4 to 5 Pro. This is certainly something that could be worked around by using the default replace mode instead, but since that would require much refactoring of old markup and CSS I am hopeful for a fix to make replace and nest mode produce the same result.

bug svg

Most helpful comment

@idpaterson thanks for the great bug report. I can confirm this is broken. We'll get it on the list to get fixed!

All 9 comments

@idpaterson thanks for the great bug report. I can confirm this is broken. We'll get it on the list to get fixed!

Just bumping this since it's affecting me and not fixed yet. It's not affecting layering icons or the counter, just the text transform.

Bump, looking forward to seeing this resolved, or at a minimum mentioned in the documentation if it is going to be an ongoing issue.

Another bump! Also, the same issue applied to counters (fa-layers-counter) as well as text (fa-layers-text).

Bump

Do you know when this is going to be fixed?

We don't have a timeline for this yet. But it's still on the list.

For me, a work around fix would be icons for numbers between 1 and 31, but would really love for this to be fixed for good.

Bump!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omnimint picture omnimint  路  3Comments

daneren2005 picture daneren2005  路  3Comments

jakuuub picture jakuuub  路  3Comments

petermolnar picture petermolnar  路  3Comments

ojvribeiro picture ojvribeiro  路  3Comments