15

As a slidifiy newbee, I don't understand why the first slide has a pale green background and all the other slides have white backgrounds.

The example "Test for Slidify" at http://www.rpubs.com/ also shows this pale green first slide.

How can I control the background color of this first slidify slide?

Earl F Glynn
  • 375
  • 2
  • 7
  • 1
    Here's the pale green color on this example: http://bl.ocks.org/ramnathv/7155433 How is the color defined in the .cmd file? How can it be changed? – Earl F Glynn Jan 02 '14 at 04:24

1 Answers1

19

The css defining the title slide is contained in libraries/frameworks/io2012/slidify.css. Here is the part that controls the title slide. You can modify it and add it to your Rmd file directly to override default styles.

.title-slide {
  background-color: #CBE7A5; /* #EDE0CF; ; #CA9F9D*/
}

.title-slide hgroup > h1{
 font-family: 'Oswald', 'Helvetica', sanserif; 
}

.title-slide hgroup > h1, 
.title-slide hgroup > h2 {
  color: #535E43 ;  /* ; #EF5150*/
}

To do this from within an .Rmd file, one would add the following after the YAML front matter section of index.Rmd. This applies a white background to the title slide:

---
title       : title slide bg change example
author      : Ramnath
...
mode        : selfcontained # {standalone, draft}
knit        : slidify::knito2slides
---

<style>
.title-slide {
  background-color: #FFFFFF; /* #EDE0CF; ; #CA9F9D*/
}
</style>

Remember to re-run slidify("index.Rmd") to apply the change.

Hendy
  • 10,182
  • 15
  • 65
  • 71
Ramnath
  • 54,439
  • 16
  • 125
  • 152
  • 1
    Ramnath, could it be possible to implement changing first slide colour and whole presentation font in Rmarkdown? – Jot eN Feb 24 '14 at 18:13
  • 2
    Yes. You can add the css directly to your Rmarkdown between `` tags, and it would override the default css. – Ramnath Feb 24 '14 at 20:20
  • 1
    where does `` go in the `.Rmd` file – HattrickNZ Feb 18 '15 at 22:52
  • ^I have the same question. I've placed it in every spot in my .rmd file and nothing changes... – Cyrus Mohammadian Sep 19 '16 at 22:12
  • @Ramnath I tried what you said using ` – Hendy Sep 27 '16 at 19:50