Hi,
Trying to move my presentations from xaringan to quarto+reveal.js and I must say I'm struggling.
But first thing's first: how do you create a custom slide class in quarto+revealjs?
In xaringan:
Just put this in mystyle.css
:
.title-slide h2{
text-align: center;
color: #f5bd30;
}
.title-slide {
background-color: #05263b;
}
Then in the .Rmd file you reference mystyle.css
in the header, input class: title-slide
in each slide you want to use that class.
In quarto this does not work exactly as required. Have tried all kinds of things:
- If I simply repeat the above in the CSS and in the .qmd file open two new slides with:
## Introduction {.title-slide}
## Regular Slide
Then the background color of the box surrounding the text indeed changes in the Introduction slide, but not the entire slide and not the h2 text color (should be golden-ish).
- If I add a ".reveal" class up there like this:
.reveal .title-slide h2{
text-align: center;
color: #f5bd30;
}
.reveal .title-slide {
background-color: #05263b;
}
Now the entire slide gets the required background color, but not the h2 golden text color. Now the h2 text color is white for some reason!
- Finally if I add "!important" next to the color statement (as in
color: #f5bd30 !important;
), the h2 text color is finally golden but so is the h2 text color in Regular Slide and every other slide..
Is there a simple way to define a custom slide class and apply it for a set of slides, as in xaringan, with the most simple css requirements as above?
Thanks!