Skip to content
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

Too small icon with valueBox and font awesome #189

Closed
pgramme opened this issue Jun 14, 2018 · 9 comments · Fixed by rstudio/rmarkdown#1388
Closed

Too small icon with valueBox and font awesome #189

pgramme opened this issue Jun 14, 2018 · 9 comments · Fixed by rstudio/rmarkdown#1388

Comments

@pgramme
Copy link

pgramme commented Jun 14, 2018

Hi!

It seems that an update to FontAwesome (or to shiny?) somehow broke valueBox. The icon is now represented too small, same size as the text, on a separate line below the text. This only concerns FontAwesome, I had no problem using other icons, e.g. ion-android-done-all.

The problem is reproducible, with the example from the documentation

My dashboard was unchanged since May 1st 2018 and looked OK then. Problem encountered now, with flexdashboard 0.5.1, shiny 1.1.0 (also tried shiny 1.0.5)

Is there any possible workaround?

@pgramme
Copy link
Author

pgramme commented Jun 14, 2018

Update: restoring rmarkdown to version 1.9 instead of 1.10 solves the problem. It is rather a workaround than a solution, however.

@beansrowning
Copy link

I have the same issue. All other icons seem to be functional other than font-awesome.

@jjallaire
Copy link
Member

@rich-iannone Could you take a look at this?

@rich-iannone
Copy link
Member

@jjallaire I will. Thanks!

@yihui
Copy link
Member

yihui commented Jun 25, 2018

It seems to be caused by rstudio/rmarkdown#1340. devtools::install_github('rstudio/rmarkdown@3953abd473e9230faca4dcad996d5d1b35c3b3a7') works, and devtools::install_github('rstudio/rmarkdown@92f628ff22b3a1c583274194be55b893c3229912') does not.

@jjallaire
Copy link
Member

@rich-iannone Have you discovered a change we can make here? As things currently stand I think that value boxes are broken (visually) by the font awesome update. My presumption is that the fix might just be a CSS tweak. Let me know and let's see if we can resolve this one soon.

@rich-iannone
Copy link
Member

@jjallaire I think that some CSS is indeed causing the problem. In my local version of rmarkdown I made the upgrade to the newest FontAwesome 5 release and added a different stylesheet. Here is the dependency:

html_dependency_font_awesome <- function() {
  htmlDependency(
    "font-awesome",
    "5.1.0",
    src = rmarkdown_system_file("rmd/h/fontawesome"),
    script = c(
      "js/all.js",
      "js/v4-shims.js"),
    stylesheet = c(
      "css/all.css",
      "css/v4-shims.css")
  )
}

But the problem persists afterward. On my system, I don't get three boxes in a row (and this is whether I use FA icons or not).

flexdashboard

flexdashboard_no_icons

Here is the document where I don't use the icons in the valueBoxs:

---
title: "Issue_189"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
```

Row
-----------------------------------------------------------------------

### Articles per Day

```{r}
articles <- 45
valueBox(articles)
```

### Comments per Day

```{r}
comments <- 126
valueBox(comments)
```

### Spam per Day

```{r}
spam <- 15
valueBox(spam,
         color = ifelse(spam > 10, "warning", "primary"))
```

I'm going to now have a closer look at the included stylesheets.

@rich-iannone
Copy link
Member

@jjallaire I arrived at a fix. The idea is to not use any JS dependencies (as before with version 4.5.0):

html_dependency_font_awesome <- function() {
  htmlDependency(
    "font-awesome",
    "5.1.0",
    src = rmarkdown_system_file("rmd/h/fontawesome"),
    stylesheet = c(
      "css/all.css",
      "css/v4-shims.css")
  )
}

I'll submit as a PR in rstudio/rmarkdown.

@jjallaire
Copy link
Member

This should now be fixed on master (via installation of the dev version of rmarkdown)

jimhester added a commit to tidyverse/tidyversedashboard that referenced this issue Sep 14, 2018
This avoids an issue with too small fontawesome icons

rstudio/flexdashboard#189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants