I need list of all class name of Font-Awesome

前端 未结 18 3023
傲寒
傲寒 2020-12-12 13:44

I build app that will present a lot of icons so I need list of all Font-Awesome class name like [\"fa-dropbox\",\"fa-rocket\",\"fa-globe\", ....] so on is ther

18条回答
  •  执笔经年
    2020-12-12 14:42

    This one is more like floribon's answer but in vanilla JS.

    Head over to Font Awesome Cheatsheet, fire up the console and write.

    var q=document.querySelectorAll('.row .col-md-4')
    var names = []
    for (var i=0;i name.length)
    console.log(names)
    

    PS: This is subject to change when there's a change in DOM structure of the cheatsheet (unlikely) but you get the idea.

    PPS: If the output is too large you can create a function to append a textarea at the bottom of the page so that you can easily copy.

    append = function(names){
    ns = names.join('\n')
    txtarea=document.createElement("textarea")
    txtarea.innerHTML=ns
    document.body.appendChild(txtarea)
    }
    

    and replace the last line in the first code with

    append(names)
    

提交回复
热议问题