-
Notifications
You must be signed in to change notification settings - Fork 58
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
Should fading work? #324
Comments
It seems there is something indeed with BS4. This does not work as it should I think in rmarkdown ---
title: "RMarkdown tabset fade"
output:
html_document:
self_contained: false
theme:
version: 4
---
## Quarterly Results {.tabset .tabset-fade}
### By Product
(tab content 1)
### By Region
(tab content 2) Try with
and without bslib , you'll see the fading. With BS4, the two divs for the tab content loose their class <div class="tab-content">
<div id="by-product" class="section level3 tab-pane tabbed-pane active" role="tabpanel">
<p>(tab content 1)</p>
</div>
<div id="by-region" class="section level3 tab-pane tabbed-pane" role="tabpanel">
<p>(tab content 2)</p>
</div>
</div> If I add it manually in the browser, it disappears on the next click on a tab. Something in the bs3compat layer ? |
This is a duplicate of #6 (currently, you'll have to use 'valid' BS4 markup to get fading to work). Can pkgdown emit BS4 markup or does it need to be compatible with BS3? If so, I'll try to fix this in bslib (otherwise, for rmarkdown, it might be easier to just fix this issue in rmarkdown itself) |
I thought the pkgdown markup was BS4, I'll have to re-check then! |
The markup in your comment is BS3, which is what you want to emit if you need to support Bootstrap 3 and up (we're pretty committed to supporting it in Shiny and R Markdown, which is why |
By the way, Bootstrap 5 support (#304) should land this week and this appears to no longer be an issue with BS5, so I might just let this be a known BS4 issue. (Once Bootstrap 5 support lands |
@cpsievert Thank you! How do you recognize it's BS3? Thanks for the information reg Bootstrap 5. Do you mean you won't support BS4 any more? |
(I'll fix my markup with https://getbootstrap.com/docs/4.6/components/navs/#javascript-behavior 😇 🙈 ) |
Good to know that R Markdown tabset fading won't work if you use BS4. I did not have that in mind. Thanks for asking @maelle ! |
The active class is on the
I think we'll consider |
Thank you for the information! 🙏 |
After looking into this more, I think it's going to make sense to fix this across all Bootstrap versions, see #325 for a tentative fix |
That works now in Rmd. Thanks! |
This issue has been automatically locked. If you believe you have found a related problem, please open a new issue (with a reproducible example or feature request) and link to this issue. |
In a PR to pkgdown where we now use bslib for BS4 dependencies, I'm adding the HTML structure for tabsets including support for fading as documented in an R Markdown book.
I'm following the Bootstrap docs.
Here's the HTML I've created: https://60b8c9c243e3b70d06c196c1--pkgdown-dev.netlify.app/dev/articles/test/rendering.html#results-in-tabset-fading-1 where the second tab-panel has the active and show classes, the other panel has the fade class.
Now if I click on the panels it removes their "fade" class so I see no fading.
I've tried removing the bslib dependencies in favor of CSS+JS for Bootstrap via CDN and I see the fading https://codepen.io/maellesalmon/pen/rNydawa (I've made it super obvious in the pen with a very slow transition).
I guess I am yet again missing something in bslib, and would appreciate any hint. Thanks for the great package in any case!
The text was updated successfully, but these errors were encountered: