# PygmentsCodeFences—how to choose themes?

**URL:** <https://discourse.gohugo.io/t/pygmentscodefences-how-to-choose-themes/3842>\
**Category:** support\
**Created:** [August 8, 2016, 4:06am UTC](https://discourse.gohugo.io/t/pygmentscodefences-how-to-choose-themes/3842 "2016-08-08T04:06:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![regasaur](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regasaur/32/1931_2.png) [@regasaur](https://discourse.gohugo.io/u/regasaur)\
**Post date:** [August 8, 2016, 4:06am UTC](https://discourse.gohugo.io/t/pygmentscodefences-how-to-choose-themes/3842/1 "2016-08-08T04:06:44Z")

</div>

Hi guys,

I’m trying to make a coding tricks blog with Hugo, and I got Pygments so I can do syntax highlighting with blocks like this:

````
```ruby
def hello object
  puts "Hello, #{object}"
end
```

````

This “works” in that the code is colored, but the colors aren’t good (white text on white background). Is there a way to change the theme of the highlighting?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 8, 2016, 6:09am UTC](https://discourse.gohugo.io/t/pygmentscodefences-how-to-choose-themes/3842/2 "2016-08-08T06:09:23Z")

</div>

In config:

```auto
pygmentsstyle: "trac"

```

See pygments doc for available themes.

---

<div class="post-metadata">

**Author:** ![regasaur](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regasaur/32/1931_2.png) [@regasaur](https://discourse.gohugo.io/u/regasaur)\
**Post date:** [August 8, 2016, 9:44pm UTC](https://discourse.gohugo.io/t/pygmentscodefences-how-to-choose-themes/3842/3 "2016-08-08T21:44:23Z")

</div>

Thanks! Eventually I got it to work with this:

`config.toml`

```
PygmentsCodeFences = true
PygmentsStyle = "monokai"

```

For a list of styles and what they look like, [https://help.farbox.com/pygments.html](https://help.farbox.com/pygments.html) is the best link I’ve found.

For the background of code blocks, actually this is set by the Hugo theme, for the Hyde theme I was using I needed to override the css like this:

`/themes/hyde/static/css/override.css`

```
pre {
  background-color: #333;
}
code {
  background-color: #EEE
}

```

And add the link to `override.css` to `/themes/hyde/layouts/partials/head.html`

Hope this helps others!
