Skip to content

crosstalk messes up ioslides_presentation #50

@dmurdoch

Description

@dmurdoch

If I put a crosstalk control in an ioslides_presentation, the styles get all messed up. For example:

---
output: ioslides_presentation
---


## CSS messed up

```{r eval = TRUE}
library(crosstalk)
sd <- SharedData$new(mtcars)
filter_checkbox("cylinderselector", 
                        "Cylinders", sd, ~ cyl, inline = TRUE)

has the style messed up on the second slide: fonts too small, background white instead of black, etc. If eval = FALSE is used instead, it looks fine (but doesn't include the control).

The cause of this is that ioslides_presentattion sets a style on pre, for example, and so does some other CSS that crosstalk pulls in. If I include my own CSS code and prefix the selectors to make them more specific, I can fix most of the problems, e.g. instead of

pre {
  font-family: 'Source Code Pro', 'Courier New', monospace;
  ...

I can use

slide.current pre {
  font-family: 'Source Code Pro', 'Courier New', monospace;
  ...

but I'd like to know if there's some way to turn off (some of?) the crosstalk includes, or to automatically give precedence to the ioslides_presentation includes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions