Open AshesITR opened 5 years ago
I actually wouldn't mind 3. We're trying not to bend the icon
API too strongly in the direction of any particular version of FontAwesome, since they changed so drastically between 4 and 5 and might do so again the next time they do a major release. Actually I'm arguing for freezing the FontAwesome support in Shiny, and delegating the responsibility to a package like https://github.com/ropenscilabs/icon.
@jcheng5 Did you have time to review the PR yet?
https://github.com/rstudio/shiny/blob/5e2b40d3a92ea602d7187dafe49eba0d1e220cde/R/bootstrap.R#L1520-L1560
The new FontAwesome version has font classes
far
andfal
(Most of them are pro-only, but some are free, such ascheck-circle
oraddress-book
in regular styling)Using them requires a different
prefix_class
, but this can't be changed at the moment. Addingfar
orfal
toclass
(icon("check-circle", class = "far")
) doesn't work either becausefa
comes first.I would code a PR for this but I wand to know what solution you prefer?
icon <- function(name, class = NULL, lib = "font-awesome", style = c("normal", "regular", "light"))
wich is ignored for glyphiconlib
("font-awesome-regular" and "font-awesome-light", maybe?)class
containing these special classesI kind of prefer the first option because of code clarity, but the third has the advantage of not adding a lib-specific argument to
icon()
.