New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade FontAwesome to 5.3.1 #2186
Conversation
R/bootstrap.R
Outdated
htmlDependencies(iconTag) <- htmlDependency( | ||
"font-awesome", "4.7.0", c(href="shared/font-awesome"), | ||
stylesheet = "css/font-awesome.min.css" | ||
if (lib %in% c("font-awesome", "fontawesome")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I'm not sure about this. Perhaps we should do this:
- If it's
font-awesome
, load the shim - If it's
fontawesome
, don't load the shim
Then in subsequent versions of Shiny that ship V5 w/out the shim, specifying font-awesome
is an error and fontawesome
is the new deault lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason for adding fontawesome
as a valid option in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A half-baked scheme for supporting 4 and 5 in a subsequent release, but there's no reason to do it now. Removed and simplified.
R/bootstrap.R
Outdated
htmlDependency( | ||
"fontawesome-v4-shims", "5.3.1", c(href="shared/fontawesome"), | ||
stylesheet = "css/v4-shims.min.css" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be a single htmlDependency
named font-awesome
, with both stylesheets included. This isn't aesthetic, it matters for dependency resolution that happens when the page is rendered; if the dependency name is different, the page could load both 4.7.0 and 5.3.1, and whichever one is loaded last would win (to the degree that there are collisions, that is).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I did it 👍
I'm really confused on what the current status of fontawesome in shiny is? I'm using shiny v 1.0.5 and have download the fontawesome 4.7 and placed in www/shared. I can not get most icons to work. I see the svg files for the icons I want, but they do not work. Any help appreciated |
@eawachtel Please file a separate issue if you're having trouble with icons in 4.7.0. It'd be great if you could include a minimal reproducible example. Thanks! |
I most certainly can provide an example of my code.
I use the below quite a bit just calling out different icon names in the
fontawesome library
actionButton("closelogin", label = NULL, icon = icon("times", lib=
"font-awesome"))
This works fine.
but if I reference a different icon "gas-pump"
actionButton("closelogin", label = NULL, icon = icon("gas-pump", lib=
"font-awesome"))
I get nothing
…On Tue, Sep 18, 2018 at 10:20 AM Joe Cheng ***@***.***> wrote:
@eawachtel <https://github.com/eawachtel> Please file a separate issue if
you're having trouble with icons in 4.7.0. It'd be great if you could
include a minimal reproducible example. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2186 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Ad8-1FnVkgKg5htLNvonLHbq5gy7lY9Vks5ucQFFgaJpZM4Ws3L2>
.
|
- Upgrades FontAwesome to a new major (breaking) version, but is backwards compatible because we include the v4-shims CSS that maps old names to new. - This is a step toward full V5 adoption that doesn't require us to come up with a plan for deprecating V4 icon names. - Details: https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4 - Related to #2156 and #1966
c6195d6
to
2396464
Compare
@eawachtel I think |
@alandipert Are we missing "CC BY 4.0 License" in the LICENSE file? It looks like it applies to the SVG data, which we appear to be bundling. |
- Clarify in docs that fontawesome V5 icons accessible with V4-style names - Make icons browseable: icon('address-book') will now open the Viewer pane of RStudio IDE so that icons can be experimented with more easily.
is backwards compatible because we include the v4-shims CSS that maps
old names to new.
icon
tags are now browsablecome up with a plan for deprecating V4 icon names.
(Related: #2156 and #1966)
Confirmed that the FontAwesome CSS and webfont licenses didn't change between 4 and 5, added CC license for .svgs we now also include.