rmarkdown icon indicating copy to clipboard operation
rmarkdown copied to clipboard

Can CSS be applied while page renders?

Open rjake opened this issue 9 months ago • 1 comments

The function shiny::showNotification() will appear while the "Please wait..." message is running and doesn't apply the CSS until after the page fully renders. I've tried using css: style.css in the YAML and I've asked on SO here. I later realized it wasn't a flexdashboard question but one for rmarkdown instead. Perhaps this is expected behavior, I just couldn't find info on it.

My use case is I have notifications for bringing in data, cleaning data, then rendering the results and I want to let the users know what's going on at each step while they wait. The notifications are showing in Time New Roman for all steps until the page fully renders. You can see the same behavior below.

---
title: "Test"
output: html_document
runtime: shiny
---

```{css}
.shiny-notification-content-text {
  font-family:fantasy;
}
```

```{r}
library(shiny)

showNotification(ui = "Bring in data", duration = NULL)
```
session info
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045), RStudio 2023.6.0.421


Locale:
  LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
  LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
  LC_TIME=English_United States.utf8    

time zone: America/New_York
tzcode source: internal

Package version:
  compiler_4.3.1    curl_5.0.2        graphics_4.3.1    grDevices_4.3.1   methods_4.3.1     remotes_2.4.2.1  
  rstudioapi_0.15.0 stats_4.3.1       tools_4.3.1       utils_4.3.1       xfun_0.40 

I'm not able to use the dev version of knitr due to my company's security policies.

image

Checklist

When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:

  • [x] formatted your issue so it is easier for us to read?

  • [x] included a minimal, self-contained, and reproducible example?

  • [x] pasted the output from xfun::session_info('rmarkdown') in your issue?

  • [x] upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

  • [ ] installed and tested your bug with the development version of the rmarkdown package using remotes::install_github("rstudio/rmarkdown")?

rjake avatar Sep 14 '23 19:09 rjake