问题
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