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

Update learnr components to support bslib #468

Open
gadenbuie opened this issue Jan 8, 2021 · 2 comments
Open

Update learnr components to support bslib #468

gadenbuie opened this issue Jan 8, 2021 · 2 comments
Projects

Comments

@gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Jan 8, 2021

bslib is close to being supported in learnr, but learnr's custom components need to be updated.

@schloerke
Copy link
Collaborator

@schloerke schloerke commented Jul 21, 2021

Some sass that I've used in the bslib Rmd chunk... (similar to last example in https://rstudio.github.io/bslib/articles/bslib.html#add-rules)

.topicsList .topic {
  border-bottom: 1px solid $primary
}

.topicsList .topic.current, 
.topicsList .topic.current:hover,
.topicsList .topic:hover
{
  background-color: $primary
}
.panel-heading.tutorial-panel-heading {
  background-color: $primary
}

.btn-tutorial-start-over:hover {
  background-color: $warning
}

@schloerke
Copy link
Collaborator

@schloerke schloerke commented Jul 27, 2021

With the default tutorial, change the header to

---
title: "Tutorial"
output:
  learnr::tutorial:
    theme:
      bootswatch: cerulean
runtime: shiny_prerendered
---

When running the tutorial, you'll get an error:
Screen Shot 2021-07-27 at 11 33 57 AM

Caused by popover js within bootstrap moving from destroy method to dispose method.

Called here:

exercise.find('.btn-tutorial-solution').popover('destroy');

bs3 docs (destroy): https://www.w3schools.com/bootstrap/bootstrap_ref_js_popover.asp
bs4 docs (dispose): https://getbootstrap.com/docs/4.0/components/popovers/#popoverdispose
bs5 docs (dispose): https://getbootstrap.com/docs/5.0/components/popovers/#dispose

How shiny currently detects if bs3 exists: https://github.com/rstudio/shiny/blob/244fdc72bc7334d182113b5e0494f1a16f04d9c1/srcts/src/utils/index.ts#L373 . Could be used to toggle the method name.

cc @rjknell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
v0.11.0
Backlog
Development

No branches or pull requests

2 participants