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

[FR] Block Bootstrap CSS dependencies from HTML widgets #2142

Open
apreshill opened this issue May 20, 2021 · 0 comments
Open

[FR] Block Bootstrap CSS dependencies from HTML widgets #2142

apreshill opened this issue May 20, 2021 · 0 comments
Labels
feature a feature request or enhancement theme: bootstrap related to bootstrap theme: htmlwidgets

Comments

@apreshill
Copy link
Contributor

apreshill commented May 20, 2021

For discussion:

HTML widgets can inject Bootstrap as an unwanted CSS dependencies that can be difficult for users to troubleshoot. The way the DT and reactable packages work is more user-friendly, and allows for easy embedding of the widget in any webpage or site.

For users who don't want to use Bootstrap or for those using R Markdown HTML output formats that don't include Bootstrap already, it would be nice if the default behavior were to block the CSS dependency. This means that the default behavior would preserve the CSS of the webpage or site, but that the widget itself might lose some styling. The alternative, which is the current default behavior, is that Bootstrap can be loaded site-wide. The outcome with this default behavior is that at worst, the webpage or site CSS breaks; at best, the page will not look at all as the user expected it to.

Example with distill and crosstalk:

https://themockup.blog/posts/2020-05-29-client-side-interactivity-do-more-with-crosstalk/

If implemented, we should issue a warning for users who try to use an HTML widget with CSS dependencies like:

Warning: Bootstrap has been masked from crosstalk…[something actionable here]

Related issues:
https://ukgovdatascience.github.io/govdown/#crosstalk
rstudio/blogdown#44
rstudio/crosstalk#26
ukgovdatascience/govdown#57
rstudio/distill#275

@cderv cderv added the feature a feature request or enhancement label May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement theme: bootstrap related to bootstrap theme: htmlwidgets
Projects
None yet
Development

No branches or pull requests

2 participants