How to use the icons of the “fas” “far” “fal” “fab” type from fontawesome in shiny?

走远了吗. 提交于 2019-12-08 09:18:18

问题


I can only user "fa" Style Prefix um shiny::icon() and which creates the code like <i class="fa fa-angle-left pull-right"></i>.

How to user the others Style Prefix of fontawesome?


回答1:


If the icon you want is in the list here: https://github.com/rstudio/shiny/blob/master/R/font-awesome.R

then it will automatically change to use "fab" as the prefix - otherwise it will always use "fa" I think. The relevant code from inside shiny::icon is:

if (!is.null(name)) {
        prefix_class <- prefix
        if (prefix_class == "fa" && name %in% font_awesome_brands) {
            prefix_class <- "fab"
        }
        iconClass <- paste0(prefix_class, " ", prefix, "-", name)
    }


来源:https://stackoverflow.com/questions/56671233/how-to-use-the-icons-of-the-fas-far-fal-fab-type-from-fontawesome-in-shi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!