Closed Btibert3 closed 4 years ago
Thanks for the suggestion! This is a great idea and would be a great addition to this package. Will definitely add, hopefully I'll get some time soon.
Hi @Btibert3, sorry it took so long, but I think I have a solution for you -- or at least one that's ready for some testing.
I've added an option header_background_enable
to the theme functions that, when set to TRUE
, enables a background under h1
headers (first level, or single #
). The color is automatically decided by the theme, but can be customized using header_background_color
for the background bar and header_background_text_color
for the header text color.
Here's an example using duo_accent()
:
```{r xaringanthemer, include=FALSE}
duo_accent(header_background_enable = TRUE)
Install the xaringan package from Github:
![Screenshot_2019-03-09 Presentation Ninja](https://user-images.githubusercontent.com/5420529/54075767-173b2300-4271-11e9-8131-f59f8a23b8b7.png)
The bar is only created for level 1 headers (like above) and only when the slide classes _do not include_ `normal`, `inverse`, `title`, `middle` or `bottom`. Note that `normal` isn't a defined class in remark/xaringan, but I added it so that you can suppress the header bar if needed.
To test it out, install the `dev` branch of xaringanthemer and please let me know how it works for you!
```r
# install.packages("remotes")
remotes::install_github("gadenbuie/xaringanthemer@dev")
Awesome, let me check this out!
I just changed the key argument to header_background_auto
instead of header_background_enable
. With the new behavior, you can still add a background to the h1
header elements if header_background_auto = FALSE
by using
class: header_background
to manually enable the background title bar on a slide-by-slide basis. Setting header_background_auto = TRUE
will automatically add the title bar to slides as previously described.
I finally merged this into master, sorry that it took me so long!
I want to qualify that I am very new and am only now finding the time to start to wrap my head around xaringan and the ability to write my lecture slide decks in R Markdown. Also, I have very little experience editing CSS. 😄
That said, I love where you are going with this package and have more of a feature request really. One of the things that I like about the metropolis theme is the shaded title area. This would let me stay on brand for my institution.
Is it possible to add that as a modifiable attribute in your theme functions and customization? From the theme (and color modified by me), it appears that this is the area of the CSS that drives that.
I dont know if it would be possible to have two additional arguments for the theme;
border-top
andborder-color
, something like that?Thanks again for this awesome package. It appears that there is much to be excited about in future releases!