gadenbuie / xaringanExtra

:ferris_wheel: A playground of enhancements and extensions for xaringan slides.
https://pkg.garrickadenbuie.com/xaringanExtra
Other
449 stars 36 forks source link

Hide Scribble pencil icon #173

Closed nggrimes closed 2 years ago

nggrimes commented 2 years ago

Thank you for the wonderful xaringan extensions Garrick!

Would it be possible to add an input in the use_scribble function to hide the pencil icon from showing up in the top right corner? For example xaringanExtra::use_scribble(icon=FALSE)

I appreciate the new no-scribble class feature for specific slides, but I've found in the hybrid video / in person presenting world I never know which slides need to be drawn before the start of the presentation. However, the icon can be somewhat distracting when not in use. Since we can use the S key to engage scribble mode it would be useful to not see extra things on the slide. Once in scribble mode, I'm happy with the icons and options to select new colors etc.

If you or anyone else has any thoughts to tackle this I'd be happy to hear any feedback. Thank you!

gadenbuie commented 2 years ago

It turns out this is possible with a tiny bit of CSS. Add this chunk to your slides, or put the CSS rule in a CSS file if you have one:

```{css echo = FALSE}
.xe-scribble__tools.minimized {
  display: none;
}


That will hide the icon when the tool menu is minimized, but it will re-appear when you summon it with <kbd>S</kbd>.

I don't think I want to add an argument to hide the icon, though, since it could make it harder to discover Scribble.

Thanks for raising the issue and I'm sure others will find your issue helpful!