|
|
|
|
|
|
|
|
#' |
|
|
#' |
|
|
#' Create the correct Font Awesome class. |
|
|
#' Create the correct Font Awesome class. |
|
|
#' @param name Name of the Font Awesome icon |
|
|
#' @param name Name of the Font Awesome icon |
|
|
#' @param solid Should the solid or the regular icon be used? |
|
|
|
|
|
#' @param as_html If `FALSE` (default), only the icon class is returned. |
|
|
#' @param as_html If `FALSE` (default), only the icon class is returned. |
|
|
|
|
|
#' @param solid Should the solid or the regular icon be used? |
|
|
#' @examples |
|
|
#' @examples |
|
|
#' fa_icon("github") |
|
|
#' fa_icon("github") |
|
|
#' fa_icon("star") |
|
|
#' fa_icon("star") |
|
|
|
|
|
|
|
|
#' |
|
|
#' |
|
|
#' @references <https://fontawesome.com/icons> |
|
|
#' @references <https://fontawesome.com/icons> |
|
|
#' @export |
|
|
#' @export |
|
|
fa_icon <- function(name, solid = TRUE, as_html = FALSE) { |
|
|
|
|
|
|
|
|
fa_icon <- function(name, as_html = FALSE, solid = TRUE) { |
|
|
iconClass <- if (name %in% font_awesome_brands) "fab" else { |
|
|
iconClass <- if (name %in% font_awesome_brands) "fab" else { |
|
|
if (solid) "fas" else "far" |
|
|
if (solid) "fas" else "far" |
|
|
} |
|
|
} |