如何使用"fas"图标“远" "fal" “晶圆厂"从fontawesome中键入光泽? [英] How to use the icons of the "fas" "far" "fal" "fab" type from fontawesome in shiny?

查看:356
本文介绍了如何使用"fas"图标“远" "fal" “晶圆厂"从fontawesome中键入光泽?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只能使用"fa"样式前缀um shiny::icon(),它会创建类似<i class="fa fa-angle-left pull-right"></i>的代码.

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>.

如何使用 fontawesome 的其他样式前缀?

How to user the others Style Prefix of fontawesome?

推荐答案

如果您想要的图标在此处的列表中:

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

然后它将自动更改为使用"fab"作为前缀-否则,我认为它将始终使用"fa". shiny::icon内部的相关代码为:

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)
    }

这篇关于如何使用"fas"图标“远" "fal" “晶圆厂"从fontawesome中键入光泽?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆