I'm trying to set the default background color to black in spacemacs. I'm setting the following theme in my init.el file:

dotspacemacs-themes '(afternoon molokai)

In my user-config.el file I've tried setting the background color as follows:

(set-background-color "black")

I've also tried setting the default font's background color:

 '(default ((t (:background "black")))))

I can see it flicker to black during startup but then it goes back to the theme color (which is #181A26)

How can I get this to stick?

  • I'm not familiar with spacemacs, but I use gui emacs with a theme and some color overrides. Could you provide your .emacs file (if spacemacs has one)? My instinct is that the theme is being loaded after the black, so the override is going the wrong way. In vanilla emacs the theme and overrides should be together in a call to custom-set-variables.
    – memtha
    Jul 24, 2021 at 22:21
  • 1
    Secondly, if you do M-x set-background-color <RET> black <RET> manually, does it do what you want?
    – memtha
    Jul 24, 2021 at 22:25
  • I have tested it on Spacemacs here, and setting the background color via the (set-background-color "black") in my user-config works fine. I am not sure how much you have configured already, but otherwise maybe try with a clean setup (e.g. moving your old dotfile and restart Spacemacs, and then add that line to your user-config). Also, I am not sure if you have already tried, but probably the Spacemacs gitter is a better place for asking these type of questions. Jul 25, 2021 at 10:55
  • Thank you, commenting out parts of my user-config revealed that setting transparency was messing up the color for some reason.
    – oneself
    Jul 26, 2021 at 7:02

1 Answer 1


It looks like setting background color using set-background-color is the right way to go. I had some code that was setting up (but not using) transparency which seems to have messed up the background color for some reason.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.