If you like my work, please consider supporting its development.

If PygmentsUseClasses is set to true in the site’s configuration file, Midnight will detect how dark the alt_background color is and apply a default syntax theme as necessary.

PygmentsUseClasses = true
[params]
    title = "My Site"
PygmentsUseClasses: true
params:
    title: My Site
{
    "PygmentsUseClasses": true,
    "params": {
        "title": "My Site"
    }
}

If you want to override these defaults, you have two options:

  1. Disable PygmentsUseClasses by commenting it out or setting it to false and set PygmentsStyle to the theme you want to use (Hugo documentation)
PygmentsUseClasses = false
PygmentsStyle = "colorful"
[params]
    title = "My Site"
PygmentsUseClasses: false
PygmentsStyle: colorful
params:
    title: My Site
{
    "PygmentsUseClasses": false,
    "PygmentsStyle": "colorful",
    "params": {
        "title": "My Site"
    }
}
  1. Create the files dark.css and dark.min.css (for dark backgrounds) and light.css light.min.css (for light backgrounds) under static/css/ in your site’s root directory by following the instructions here.