Charles Lanfear
Charles Lanfear

Reputation: 13

Xaringan: How do you change code chunk background color?

Is it possible to change the background color--and other attributes--of code chunks? Is there a class associated with code chunks?

Modifying the background color for inline code is simple:

.remark-inline-code{
  background-color: #000000
}

But I am unable to find an equivalent specifically for code chunks.

Upvotes: 1

Views: 520

Answers (1)

pat-s
pat-s

Reputation: 6302

Inspecting the div using Chrome developer tools, you see that the color is set by class .hljs-github .hljs.

Setting

.hljs-github .hljs {
    background: red;
}

should do what you want :)

Upvotes: 1

Related Questions