1

I'm trying to back into how to hand craft a CSS file to override some settings in my *.rpres in order to change the font in the resulting HTML. I can change some bits, but I can't grok how to change the R Code blocks.

Using the inspector on in Chrome, I see the following:

enter image description here

So after significant futzing around it seems like I should be able to override this with the following CSS entry:

.reveal code .r {
  font-size: 180%;
  font-weight: bold;
   color: green;
}

Only that doesn't seem to change a thing.

Any tips on how I can change the font for <code class="r"> with my CSS file?

JD Long
  • 59,675
  • 58
  • 202
  • 294
  • 1
    it should be `code.r` without space – Temani Afif May 06 '18 at 23:27
  • oh... yup, that's the problem. Jesus. Can you make this an answer so I can accept it? – JD Long May 06 '18 at 23:34
  • well, i guess it's better to close the question as *a simple typographical error.* or the duplicate of this one https://stackoverflow.com/questions/1126338/what-does-a-space-mean-in-a-css-selector-i-e-what-is-the-difference-between-c – Temani Afif May 06 '18 at 23:42
  • it's the conceptual duplicate of that issue, but it's not the literal duplicate. No single person looking to change the R Code font block in an RMarkdown file will ever find that other question and realize that it applies to them. – JD Long May 06 '18 at 23:45
  • I know, but your issue is not related to R Code, it's a CSS selector issue ... I have no idea what is a R code, I simply notice a wrong syntax in the CSS selector. So you have found a solution to solve the issue related to the R code but in this solution there is a small CSS mistake explained in the duplicate question or it can be considered as *a simple typographical error* – Temani Afif May 06 '18 at 23:47
  • how about this, how about I remove the CSS tag and we just all get on with our lives leaving this here for future travelers. Nothing damaged, but some breadcrumbs for future ppl like me who run into having to touch CSS (god save their souls) – JD Long May 06 '18 at 23:52
  • 1
    I simply said that [for me] I better close than adding an answer :). You may have issues and it's legit to ask and I helped you to fix it. There is no problem with your question and am not complaining about it as it's well asked. You may wait and someone else will pick my comment and add it as answer if you want or you can simply answer your own question and accept it, you know the rules of this site and you are free ;) – Temani Afif May 07 '18 at 00:00
  • That's reasonable. And, BTW, thank you. I really do appreciate your help. – JD Long May 07 '18 at 00:06

0 Answers0