README.md (14489B)
1 [![License GPL 3][badge-license]](http://www.gnu.org/licenses/gpl-3.0.txt) 2 [](http://melpa.org/#/solarized-theme) 3 [](http://stable.melpa.org/#/solarized-theme) 4 5 # Solarized for Emacs 6 7 Solarized for Emacs is an Emacs 24bit theme making use of the 8 [Solarized palette](http://ethanschoonover.com/solarized), developed by Ethan Schoonover. 9 10 Here are the two canonical variants: 11 12 <table> 13 <tr> 14 <td align="center"><code>solarized-dark</code><br><img src="screenshots/solarized-dark.png" alt="solarized-dark" width="440"></td> 15 <td align="center"><code>solarized-light</code><br><img src="screenshots/solarized-light.png" alt="solarized-light" width="440"></td> 16 </tr> 17 </table> 18 19 You can find some more screenshots of Solarized for Emacs 20 [here](https://emacsthemes.com/themes/solarized-themes.html). 21 22 Solarized for Emacs supports officially Emacs 24+. The theme is implemented 23 in terms of customisations and `deftheme` and does not require the 24 `color-theme-package`. 25 26 ## Installation 27 28 Solarized for Emacs is available for installation via the 29 [MELPA](http://melpa.org) using `package.el`. Assuming you've set it 30 up you can install Solarized like this: 31 32 `M-x package-install solarized-theme` 33 34 This package will install two variants of the theme; `solarized-light-theme` 35 and `solarized-dark-theme`. You can load one of the theme variants with `M-x 36 load-theme`. 37 38 To load it automatically on Emacs startup add this to your init file: 39 40 ```emacs-lisp 41 (load-theme 'solarized-light t) 42 ``` 43 44 or 45 46 ```emacs-lisp 47 (load-theme 'solarized-dark t) 48 ``` 49 50 You can toggle between the light and dark variant of the theme automatically with 51 `M-x solarized-toggle-theme`. 52 53 ## Alternative Palettes 54 55 In addition to `solarized-dark` and `solarized-light`, the package ships the 56 following theme variants: 57 58 - `solarized-dark-high-contrast` / `solarized-light-high-contrast` 59 - `solarized-gruvbox-dark` / `solarized-gruvbox-light` 60 - `solarized-selenized-dark` / `solarized-selenized-light` / `solarized-selenized-black` / `solarized-selenized-white` 61 - `solarized-zenburn` 62 - `solarized-wombat-dark` 63 64 <table> 65 <tr> 66 <td align="center"><code>solarized-dark-high-contrast</code><br><img src="screenshots/solarized-dark-high-contrast.png" alt="solarized-dark-high-contrast" width="380"></td> 67 <td align="center"><code>solarized-light-high-contrast</code><br><img src="screenshots/solarized-light-high-contrast.png" alt="solarized-light-high-contrast" width="380"></td> 68 </tr> 69 <tr> 70 <td align="center"><code>solarized-gruvbox-dark</code><br><img src="screenshots/solarized-gruvbox-dark.png" alt="solarized-gruvbox-dark" width="380"></td> 71 <td align="center"><code>solarized-gruvbox-light</code><br><img src="screenshots/solarized-gruvbox-light.png" alt="solarized-gruvbox-light" width="380"></td> 72 </tr> 73 <tr> 74 <td align="center"><code>solarized-selenized-dark</code><br><img src="screenshots/solarized-selenized-dark.png" alt="solarized-selenized-dark" width="380"></td> 75 <td align="center"><code>solarized-selenized-light</code><br><img src="screenshots/solarized-selenized-light.png" alt="solarized-selenized-light" width="380"></td> 76 </tr> 77 <tr> 78 <td align="center"><code>solarized-selenized-black</code><br><img src="screenshots/solarized-selenized-black.png" alt="solarized-selenized-black" width="380"></td> 79 <td align="center"><code>solarized-selenized-white</code><br><img src="screenshots/solarized-selenized-white.png" alt="solarized-selenized-white" width="380"></td> 80 </tr> 81 <tr> 82 <td align="center"><code>solarized-zenburn</code><br><img src="screenshots/solarized-zenburn.png" alt="solarized-zenburn" width="380"></td> 83 <td align="center"><code>solarized-wombat-dark</code><br><img src="screenshots/solarized-wombat-dark.png" alt="solarized-wombat-dark" width="380"></td> 84 </tr> 85 </table> 86 87 The intent of this theme will always be that Solarized-dark/light will give you 88 the best possible experience. Palettes other than Solarized will never have 89 influence over theming decisions, they are complementary. 90 91 You should not expect the complementary themes to be fully accurate or the most 92 suitable versions of how to apply those palettes into an emacs theme. The 93 important aspect is that the color usage should be about the same as they are 94 with the default Solarized palette. 95 96 Colors stand out with varying amounts depending on which palette is used. This 97 theme aims for a very soft look, violet is one of the most pronounced accent 98 colors in the Solarized palette and that is one reason why it's rarely used by 99 the theme. Violet in another palette might stand out less and therefore be used 100 more often if the theme was specifically designed with that palette in mind. 101 102 The original Zenburn palette doesn't have a violet it is created by blending 103 blue and magenta to get it to fit into the theme so it's tilted towards 104 translating into what this theme has decided. 105 106 *TLDR*; While `solarized-gruvbox-light` might be a good complement for users of 107 `solarized-light`, another theme not contained in this package (`gruvbox-light` 108 or whatever) might be more finely tuned in relation to the Gruvbox palette. 109 110 ## Customisations 111 112 ### Theme-specific settings 113 114 If you don't like low-contrast modeline or fringe, you can `customize` them 115 either by doing `M-x customize-group solarized` or setting the values using 116 elisp code: 117 118 ```emacs-lisp 119 ;; make the fringe stand out from the background 120 (setq solarized-distinct-fringe-background t) 121 122 ;; Don't change the font for some headings and titles 123 (setq solarized-use-variable-pitch nil) 124 125 ;; make the modeline high contrast 126 (setq solarized-high-contrast-mode-line t) 127 128 ;; Use less bolding 129 (setq solarized-use-less-bold t) 130 131 ;; Use more italics 132 (setq solarized-use-more-italic t) 133 134 ;; Use less colors for indicators such as git:gutter, flycheck and similar 135 (setq solarized-emphasize-indicators nil) 136 137 ;; Don't change size of org-mode headlines (but keep other size-changes) 138 (setq solarized-scale-org-headlines nil) 139 140 ;; Change the size of markdown-mode headlines (off by default) 141 (setq solarized-scale-markdown-headlines t) 142 143 ;; Avoid all font-size changes 144 (setq solarized-height-minus-1 1.0) 145 (setq solarized-height-plus-1 1.0) 146 (setq solarized-height-plus-2 1.0) 147 (setq solarized-height-plus-3 1.0) 148 (setq solarized-height-plus-4 1.0) 149 150 ;; Highlight all numbers 151 (setq solarized-highlight-numbers t) 152 153 ``` 154 155 Note that these need to be set **before** `load-theme` is invoked for Solarized. 156 Alternatively you can invoke `M-x solarized-reload` after making configuration changes. 157 158 ### Overriding specific faces 159 160 If you're unhappy with how a particular mode looks you can override individual 161 faces after loading the theme. Use `custom-theme-set-faces` to keep your 162 overrides tied to the theme, or `custom-set-faces` for global overrides. 163 164 ```emacs-lisp 165 ;; Override org-mode heading colors 166 (custom-theme-set-faces 167 'solarized-dark 168 '(org-level-1 ((t (:foreground "#268bd2" :weight bold :height 1.3)))) 169 '(org-level-2 ((t (:foreground "#2aa198" :weight bold :height 1.2))))) 170 ``` 171 172 ```emacs-lisp 173 ;; Make markdown code blocks stand out more 174 (custom-theme-set-faces 175 'solarized-light 176 '(markdown-code-face ((t (:background "#eee8d5" :foreground "#657b83")))) 177 '(markdown-inline-code-face ((t (:background "#eee8d5" :foreground "#657b83"))))) 178 ``` 179 180 ```emacs-lisp 181 ;; Tone down font-lock colors across all modes 182 (custom-theme-set-faces 183 'solarized-dark 184 '(font-lock-keyword-face ((t (:foreground "#859900" :weight normal)))) 185 '(font-lock-function-name-face ((t (:foreground "#268bd2" :weight bold))))) 186 ``` 187 188 These overrides should be placed **after** `load-theme` in your init file. 189 You can discover face names at point with `M-x describe-face` or see all 190 active faces with `M-x list-faces-display`. 191 192 ### Buffer-local face overrides 193 194 If you only want to tweak faces in certain major modes (without affecting the 195 rest of Emacs), you can use `face-remap-add-relative` in a mode hook. It 196 remaps a face only in the current buffer. 197 198 ```emacs-lisp 199 ;; Customize faces only in OCaml buffers 200 (defun my-ocaml-faces () 201 (face-remap-add-relative 'font-lock-type-face :foreground "DarkGreen") 202 (face-remap-add-relative 'font-lock-function-name-face :weight 'bold)) 203 204 (add-hook 'tuareg-mode-hook #'my-ocaml-faces) 205 ``` 206 207 ```emacs-lisp 208 ;; Use a larger default font in org-mode 209 (defun my-org-faces () 210 (face-remap-add-relative 'default :height 1.2)) 211 212 (add-hook 'org-mode-hook #'my-org-faces) 213 ``` 214 215 See [Buffer-Local Face Remapping with face-remap-add-relative](https://emacsredux.com/blog/2026/03/16/buffer-local-face-remapping-with-face-remap-add-relative/) 216 for more details and advanced usage (toggling remappings, wrapping them in minor modes, etc.). 217 218 ### Underline position setting for X 219 220 If you are using Emacs under X you might like the following setting which puts 221 the underline below the 222 [font bottomline instead of the baseline](https://stackoverflow.com/questions/27631736/meaning-of-top-ascent-baseline-descent-bottom-and-leading-in-androids-font). 223 224 Imho it enhances the general readability and also it fits well with the default 225 `solarized-high-contrast-mode-line` setting which uses a slightly emphasized 226 underline for the modeline to create one horizontal window border in the same 227 manner as the vertical border. 228 229 ```emacs-lisp 230 (setq x-underline-at-descent-line t) 231 ``` 232 233 ## Custom Themes 234 235 You can create your own theme that reuses all of Solarized's face definitions 236 but with a different color palette. You provide 10 colors -- a darkest base, a 237 brightest base, and 8 accents (yellow, orange, red, magenta, violet, blue, cyan, 238 green) -- and the theme framework derives all the intermediate shades and 239 highlight variants automatically. 240 241 ### Creating a theme from a custom palette 242 243 Call `solarized-create-theme-file-with-palette` in your init file. It generates 244 a theme file in `~/.emacs.d/themes/` that you can then load normally. 245 246 ```emacs-lisp 247 ;; inspired by vim's jellybeans color-theme 248 (solarized-create-theme-file-with-palette 'light 'solarized-jellybeans-light 249 '("#202020" "#ffffff" 250 "#ffb964" "#8fbfdc" "#a04040" "#b05080" "#805090" "#fad08a" "#99ad6a" "#8fbfdc")) 251 252 (load-theme 'solarized-jellybeans-light t) 253 ``` 254 255 ```emacs-lisp 256 ;; inspired by emacs's mesa color-theme 257 (solarized-create-theme-file-with-palette 'light 'solarized-mesa-light 258 '("#000000" "#faf5ee" 259 "#3388dd" "#ac3d1a" "#dd2222" "#8b008b" "#00b7f0" "#1388a2" "#104e8b" "#00688b")) 260 261 (load-theme 'solarized-mesa-light t) 262 ``` 263 264 You can also override individual faces by passing a sexp as the fourth argument. 265 This lets you tweak specific faces while still inheriting everything else from 266 the palette: 267 268 ```emacs-lisp 269 ;; wombat palette with custom face overrides 270 (solarized-create-theme-file-with-palette 'dark 'solarized-wombat-dark 271 '("#2a2a29" "#f6f3e8" 272 "#e5c06d" "#ddaa6f" "#ffb4ac" "#e5786d" "#834c98" "#a4b5e6" "#7ec98f" "#8ac6f2") 273 '((custom-theme-set-faces 274 theme-name 275 `(default ((,class (:foreground ,(solarized-color-blend base03 base3 0.15 2) :background ,base03)))) 276 `(highlight ((,class (:background ,violet)))) 277 `(font-lock-builtin-face ((,class (:foreground ,magenta)))) 278 `(font-lock-constant-face ((,class (:foreground ,blue)))) 279 `(font-lock-comment-face ((,class (:foreground ,base00)))) 280 `(mode-line 281 ((,class (:foreground ,base2 :background ,(solarized-color-blend base03 base3 0.85 2))))) 282 `(mode-line-inactive 283 ((,class (:foreground ,base00 :background ,(solarized-color-blend base03 "black" 0.85 2))))) 284 `(mode-line-buffer-id ((,class (:foreground ,base3 :weight bold)))) 285 `(minibuffer-prompt ((,class (:foreground ,base1)))) 286 `(vertical-border ((,class (:foreground ,base03))))))) 287 288 (load-theme 'solarized-wombat-dark t) 289 ``` 290 291 **Note:** If the theme file already exists, `solarized-create-theme-file` does not 292 regenerate it. Pass `t` as the fifth argument to overwrite. 293 294 ### Child themes 295 296 If you want to keep the Solarized palette but override specific faces 297 consistently across dark and light variants, you can create a child theme. This 298 is useful when you like Solarized's colors but want to adjust how certain 299 modes look. 300 301 Define your face overrides in a shared file: 302 303 ```emacs-lisp 304 ;; my-solarized.el 305 (defvar my-solarized-faces 306 '("My personal solarized customizations." 307 (custom-theme-set-faces 308 theme-name 309 `(rainbow-delimiters-depth-1-face ((,class (:foreground ,base02)))) 310 `(org-level-1 ((,class (:foreground ,blue :weight bold))))))) 311 312 (provide 'my-solarized) 313 ``` 314 315 Then create thin wrapper files for each variant (place these on your 316 `custom-theme-load-path`): 317 318 ```emacs-lisp 319 ;; themes/my-solarized-dark-theme.el 320 (require 'solarized) 321 (require 'my-solarized) 322 (eval-when-compile 323 (require 'solarized-palettes)) 324 325 (deftheme my-solarized-dark "My dark Solarized child theme") 326 (solarized-with-color-variables 327 'dark 'my-solarized-dark solarized-dark-color-palette-alist my-solarized-faces) 328 329 (provide-theme 'my-solarized-dark) 330 ``` 331 332 ```emacs-lisp 333 ;; themes/my-solarized-light-theme.el 334 (require 'solarized) 335 (require 'my-solarized) 336 (eval-when-compile 337 (require 'solarized-palettes)) 338 339 (deftheme my-solarized-light "My light Solarized child theme") 340 (solarized-with-color-variables 341 'light 'my-solarized-light solarized-light-color-palette-alist my-solarized-faces) 342 343 (provide-theme 'my-solarized-light) 344 ``` 345 346 Your face overrides have access to all palette variables (`base03`, `base0`, 347 `yellow`, `blue`, etc.) and all derived variables (`s-fringe-bg`, 348 `s-mode-line-fg`, etc.). See the 349 [child-theme-example](child-theme-example/) directory for a working example. 350 351 ## Versioning Policy 352 353 - This package uses [semantic versioning](https://semver.org/) 354 355 - Master branch is to be considered unstable (which isn't an excuse to 356 constantly break behaviour). Use MELPA Stable if you want fewer breaking 357 changes. 358 359 ## Bugs & Improvements 360 361 Please, report any problems that you find on the projects integrated 362 issue tracker. If you've added some improvements and you want them 363 included upstream don't hesitate to send me a patch or even better - a 364 GitHub pull request. 365 366 ## License 367 368 Copyright © 2011-2026 Bozhidar Batsov, [Thomas Frössman](http://t.jossystem.se), and 369 [contributors](https://github.com/bbatsov/solarized-emacs/contributors). 370 371 Distributed under the GNU General Public License, version 3 372 373 [badge-license]: https://img.shields.io/badge/license-GPL_3-green.svg