0

Trying to use new Font Awesome 5 in SVG&JS combination in ::before element

Already tried to find solutions but it still not work correctly.

In head i got script activating the function and script.

<script>FontAwesomeConfig = { searchPseudoElements: true };</script>
<script src="fontawesome/js/all.js"></script>

CSS looks like this (also tried with or without font-weight 400/900, other font families and still found solution)

<style>
    .regular {
        padding: 20px;
    }

    .regular:before {
        content:'\f2bb';
        font-family: 'Font Awesome 5 Regular';
        width: 10px;
        height: 10px;
        font-weight: 900;
    }
</style>

After loading the page JS create SVG icon, but not delete the ::before element so i got black square and correct icon after it.

Someone find solution (except CDNs) how to use it corecctly?

0 Answers0