Search code examples
reactjsfontello

How import fontello in react


I'm following this tutorial to import fontello in my project.

But in step 5 I dont have fontello.css file.

So, in your App.js import fontello

import "./fontello/css/fontello.css"

As you can see in my project I dont have that file. So How Can I Import Fontello to my project??

enter image description here


Solution

  • Well it seems like the cli actually set all your file names in css starting with my-icon instead of fontello

    To make you code work, you can import the css like

    import "./fontello/css/my-icons.css"
    

    and it should work the same

    EDIT:

    Another solution if for you to set the name field in config.json to fontello and then run fontello-cli install, this will lead to the css file names to be prefixed with the name fontello and you can import it like it is mentioned in the medium article