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

Can CSS be applied while page renders? #2517

Open
4 of 5 tasks
rjake opened this issue Sep 14, 2023 · 1 comment
Open
4 of 5 tasks

Can CSS be applied while page renders? #2517

rjake opened this issue Sep 14, 2023 · 1 comment
Labels
reprex needs a minimal reproducible example

Comments

@rjake
Copy link

rjake commented Sep 14, 2023

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:

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

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

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

  • 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")?

@cderv
Copy link
Collaborator

cderv commented Oct 2, 2023

I can't reproduce using latest version of package. I believe the notification is the right font for me.

> packageVersion("shiny")
[1] ‘1.7.5> packageVersion("rmarkdown")
[1] ‘2.25

image

@cderv cderv added the reprex needs a minimal reproducible example label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants