diff options
| author | Protesilaos Stavrou | 2023-01-01 14:14:09 +0200 |
|---|---|---|
| committer | Protesilaos Stavrou | 2023-01-01 14:14:09 +0200 |
| commit | 4e4a808eca8f68a8079272442aab0f8815abdaa8 (patch) | |
| tree | d488f43e889bcf158759f439f1d14274da0d9e2a /doc/misc | |
| parent | 9596e683834a36060497903b47b870b338d88095 (diff) | |
| download | emacs-4e4a808eca8f68a8079272442aab0f8815abdaa8.tar.gz emacs-4e4a808eca8f68a8079272442aab0f8815abdaa8.zip | |
Update Modus themes to version 4 and add new themes
* etc/NEWS: Document the addition of four new Modus themes.
* doc/misc/modus-themes.org: Update the manual.
* etc/themes/modus-operandi-deuteranopia-theme.el:
* etc/themes/modus-operandi-theme.el:
* etc/themes/modus-operandi-tinted-theme.el:
* etc/themes/modus-vivendi-deuteranopia-theme.el:
* etc/themes/modus-vivendi-theme.el:
* etc/themes/modus-vivendi-tinted-theme.el: Add theme files.
* etc/themes/modus-themes.el: Update main file to the latest version.
Detailed release notes here:
<https://protesilaos.com/codelog/2023-01-01-modus-themes-4-0-0/>.
The inclusion of the four new Modus themes was discussed on
emacs-devel:
<https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00834.html>.
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/modus-themes.org | 4649 |
1 files changed, 1640 insertions, 3009 deletions
diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 0dbe7a6c5b6..1273fd8a3ad 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | #+language: en | 4 | #+language: en |
| 5 | #+options: ':t toc:nil author:t email:t num:t | 5 | #+options: ':t toc:nil author:t email:t num:t |
| 6 | #+startup: content | 6 | #+startup: content |
| 7 | #+macro: stable-version 3.0.0 | 7 | #+macro: stable-version 4.0.0 |
| 8 | #+macro: release-date 2022-10-28 | 8 | #+macro: release-date 2023-01-01 |
| 9 | #+macro: development-version 3.1.0-dev | 9 | #+macro: development-version 4.1.0-dev |
| 10 | #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ | 10 | #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ |
| 11 | #+macro: space @@texinfo:@: @@ | 11 | #+macro: space @@texinfo:@: @@ |
| 12 | #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ | 12 | #+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ |
| @@ -21,20 +21,27 @@ | |||
| 21 | 21 | ||
| 22 | #+texinfo: @insertcopying | 22 | #+texinfo: @insertcopying |
| 23 | 23 | ||
| 24 | This manual, written by Protesilaos Stavrou, describes the customization | 24 | This manual, written by Protesilaos Stavrou, describes the |
| 25 | options for the ~modus-operandi~ and ~modus-vivendi~ themes, and provides | 25 | customization options for the Modus themes, and provides every other |
| 26 | every other piece of information pertinent to them. | 26 | piece of information pertinent to them. |
| 27 | 27 | ||
| 28 | The documentation furnished herein corresponds to stable version | 28 | The documentation furnished herein corresponds to stable version |
| 29 | {{{stable-version}}}, released on {{{release-date}}}. Any reference to a newer | 29 | {{{stable-version}}}, released on {{{release-date}}}. Any reference |
| 30 | feature which does not yet form part of the latest tagged commit, is | 30 | to a newer feature which does not yet form part of the latest tagged |
| 31 | explicitly marked as such. | 31 | commit, is explicitly marked as such. |
| 32 | 32 | ||
| 33 | Current development target is {{{development-version}}}. | 33 | Current development target is {{{development-version}}}. |
| 34 | 34 | ||
| 35 | + Homepage: https://protesilaos.com/emacs/modus-themes. | 35 | + Package name (GNU ELPA): ~modus-themes~ |
| 36 | + Git repository: https://git.sr.ht/~protesilaos/modus-themes. | 36 | + Official manual: <https://protesilaos.com/emacs/modus-themes> |
| 37 | + Mailing list: https://lists.sr.ht/~protesilaos/modus-themes. | 37 | + Change log: <https://protesilaos.com/emacs/modus-themes-changelog> |
| 38 | + Color palette: <https://protesilaos.com/emacs/modus-themes-colors> | ||
| 39 | + Sample pictures: <https://protesilaos.com/emacs/modus-themes-pictures> | ||
| 40 | + Git repo on SourceHut: <https://git.sr.ht/~protesilaos/modus-themes> | ||
| 41 | - Mirrors: | ||
| 42 | + GitHub: <https://github.com/protesilaos/modus-themes> | ||
| 43 | + GitLab: <https://gitlab.com/protesilaos/modus-themes> | ||
| 44 | + Mailing list: <https://lists.sr.ht/~protesilaos/modus-themes> | ||
| 38 | + Backronym: My Old Display Unexpectedly Sharpened ... themes | 45 | + Backronym: My Old Display Unexpectedly Sharpened ... themes |
| 39 | 46 | ||
| 40 | #+toc: headlines 8 insert TOC here, with eight headline levels | 47 | #+toc: headlines 8 insert TOC here, with eight headline levels |
| @@ -45,7 +52,7 @@ Current development target is {{{development-version}}}. | |||
| 45 | :custom_id: h:b14c3fcb-13dd-4144-9d92-2c58b3ed16d3 | 52 | :custom_id: h:b14c3fcb-13dd-4144-9d92-2c58b3ed16d3 |
| 46 | :end: | 53 | :end: |
| 47 | 54 | ||
| 48 | Copyright (C) 2020-2023 Free Software Foundation, Inc. | 55 | Copyright (C) 2020-2023 Free Software Foundation, Inc. |
| 49 | 56 | ||
| 50 | #+begin_quote | 57 | #+begin_quote |
| 51 | Permission is granted to copy, distribute and/or modify this document | 58 | Permission is granted to copy, distribute and/or modify this document |
| @@ -64,44 +71,46 @@ modify this GNU manual.” | |||
| 64 | :custom_id: h:f0f3dbcb-602d-40cf-b918-8f929c441baf | 71 | :custom_id: h:f0f3dbcb-602d-40cf-b918-8f929c441baf |
| 65 | :end: | 72 | :end: |
| 66 | 73 | ||
| 67 | The Modus themes are designed for accessible readability. They conform | 74 | The Modus themes are designed for accessible readability. They |
| 68 | with the highest standard for color contrast between any given | 75 | conform with the highest standard for color contrast between |
| 69 | combination of background and foreground values. This corresponds to | 76 | combinations of background and foreground values. For small sized |
| 70 | the WCAG AAA standard, which specifies a minimum rate of distance in | 77 | text, this corresponds to the WCAG AAA standard, which specifies a |
| 71 | relative luminance of 7:1. | 78 | minimum rate of distance in relative luminance of 7:1. |
| 79 | |||
| 80 | The Modus themes consist of six themes, divided into three subgroups. | ||
| 81 | |||
| 82 | - Main themes :: ~modus-operandi~ is the project's main light theme, | ||
| 83 | while ~modus-vivendi~ is its dark counterpart. These two themes are | ||
| 84 | part of the project since its inception. They are designed to cover | ||
| 85 | a broad range of needs and are, in the opinion of the author, the | ||
| 86 | reference for what a highly legible "default" theme should look | ||
| 87 | like. | ||
| 88 | |||
| 89 | - Tinted themes :: ~modus-operandi-tinted~ and ~modus-vivendi-tinted~ | ||
| 90 | are variants of the two main themes. They slightly tone down the | ||
| 91 | intensity of the background and provide a bit more color variety. | ||
| 92 | ~modus-operandi-tinted~ has a set of base tones that are shades of | ||
| 93 | light ochre (earthly colors), while ~modus-vivendi-tinted~ gives a | ||
| 94 | night sky impression. | ||
| 95 | |||
| 96 | - Deuteranopia themes :: ~modus-operandi-deuteranopia~ and its | ||
| 97 | companion ~modus-vivendi-deuteranopia~ are optimized for users with | ||
| 98 | red-green color deficiency. This means that they do not use red and | ||
| 99 | green hues for color-coding purposes, such as for diff removed and | ||
| 100 | added lines. Instead, they implement colors that are discernible by | ||
| 101 | users with deueteranopia or deuteranomaly (mostly yellow and blue | ||
| 102 | hues). | ||
| 72 | 103 | ||
| 73 | Modus Operandi (~modus-operandi~) is a light theme, while Modus Vivendi | 104 | To ensure that users have a consistently accessible experience, the |
| 74 | (~modus-vivendi~) is dark. Each theme's color palette is designed to meet | 105 | themes strive to achieve as close to full face coverage as possible, |
| 75 | the needs of the numerous interfaces that are possible in the Emacs | 106 | while still targeting a curated list of well-maintained packages |
| 76 | computing environment. | 107 | ([[#h:a9c8f29d-7f72-4b54-b74b-ddefe15d6a19][Face coverage]]). |
| 77 | 108 | ||
| 78 | The overarching objective of this project is to always offer accessible | 109 | The overarching objective of this project is to always offer accessible |
| 79 | color combinations. There shall never be a compromise on this | 110 | color combinations. There shall never be a compromise on this |
| 80 | principle. If there arises an inescapable trade-off between readability | 111 | principle. If there arises an inescapable trade-off between readability |
| 81 | and stylistic considerations, we will always opt for the former. | 112 | and stylistic considerations, we will always opt for the former. |
| 82 | 113 | ||
| 83 | To ensure that users have a consistently accessible experience, the | ||
| 84 | themes strive to achieve as close to full face coverage as possible | ||
| 85 | ([[#h:a9c8f29d-7f72-4b54-b74b-ddefe15d6a19][Face coverage]]). | ||
| 86 | |||
| 87 | Furthermore, the themes are designed to empower users with red-green | ||
| 88 | color deficiency (deuteranopia). This is achieved in three ways: | ||
| 89 | |||
| 90 | 1. The conformance with the highest legibility standard means that text | ||
| 91 | is always readable no matter the perception of its hue. | ||
| 92 | |||
| 93 | 2. Most contexts use colors on the blue-cyan-magenta-purple side of the | ||
| 94 | spectrum. Put differently, green and/or red are seldom used, thus | ||
| 95 | minimizing the potential for confusion. | ||
| 96 | |||
| 97 | [[#h:0b26cb47-9733-4cb1-87d9-50850cb0386e][Why are colors mostly variants of blue, magenta, cyan?]]. | ||
| 98 | |||
| 99 | 3. In contexts where a red/green color-coding is unavoidable, we provide | ||
| 100 | a universal toggle to customize the themes so that a red/blue scheme | ||
| 101 | is used instead. | ||
| 102 | |||
| 103 | [[#h:3ed03a48-20d8-4ce7-b214-0eb7e4c79abe][Option for red-green color deficiency or deuteranopia]]. | ||
| 104 | |||
| 105 | Starting with version 0.12.0 and onwards, the themes are built into GNU | 114 | Starting with version 0.12.0 and onwards, the themes are built into GNU |
| 106 | Emacs. | 115 | Emacs. |
| 107 | 116 | ||
| @@ -111,12 +120,8 @@ Emacs. | |||
| 111 | :end: | 120 | :end: |
| 112 | #+cindex: Screenshots | 121 | #+cindex: Screenshots |
| 113 | 122 | ||
| 114 | Check the web page with [[https://protesilaos.com/emacs/modus-themes-pictures/][the screen shots]]. There are lots of scenarios | 123 | Check the web page with [[https://protesilaos.com/emacs/modus-themes-pictures/][the screen shots]]. Note that the themes are |
| 115 | on display that draw attention to details and important aspects in the | 124 | highly customizable ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization options]]). |
| 116 | design of the themes. They also showcase the numerous customization | ||
| 117 | options. | ||
| 118 | |||
| 119 | [[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization options]]. | ||
| 120 | 125 | ||
| 121 | ** Learn about the latest changes | 126 | ** Learn about the latest changes |
| 122 | :properties: | 127 | :properties: |
| @@ -137,6 +142,13 @@ On older versions of Emacs, they can be installed using Emacs' package | |||
| 137 | manager or manually from their code repository. There also exist | 142 | manager or manually from their code repository. There also exist |
| 138 | packages for distributions of GNU/Linux. | 143 | packages for distributions of GNU/Linux. |
| 139 | 144 | ||
| 145 | Emacs 28 ships with ~modus-themes~ version =1.6.0=. Emacs 29 includes | ||
| 146 | version =3.0.0=. Emacs 30 provides a newer, refactored version that | ||
| 147 | thoroughly refashions how the themes are implemented and customized. | ||
| 148 | Such major versions are not backward-compatible due to the limited | ||
| 149 | resources at the maintainer's disposal to support multiple versions of | ||
| 150 | Emacs and of the themes across the years. | ||
| 151 | |||
| 140 | ** Install manually from source | 152 | ** Install manually from source |
| 141 | :properties: | 153 | :properties: |
| 142 | :custom_id: h:da3414b7-1426-46b8-8e76-47b845b76fd0 | 154 | :custom_id: h:da3414b7-1426-46b8-8e76-47b845b76fd0 |
| @@ -245,102 +257,82 @@ wrong. | |||
| 245 | :properties: | 257 | :properties: |
| 246 | :custom_id: h:3f3c3728-1b34-437d-9d0c-b110f5b161a9 | 258 | :custom_id: h:3f3c3728-1b34-437d-9d0c-b110f5b161a9 |
| 247 | :end: | 259 | :end: |
| 248 | #+findex: modus-themes-load-themes | ||
| 249 | #+findex: modus-themes-toggle | 260 | #+findex: modus-themes-toggle |
| 250 | #+findex: modus-themes-load-operandi | 261 | #+findex: modus-themes-load-theme |
| 251 | #+findex: modus-themes-load-vivendi | ||
| 252 | #+cindex: Essential configuration | ||
| 253 | #+vindex: modus-themes-after-load-theme-hook | 262 | #+vindex: modus-themes-after-load-theme-hook |
| 263 | #+cindex: Essential configuration | ||
| 264 | |||
| 265 | NOTE that Emacs can load multiple themes, which typically produces | ||
| 266 | undesirable results and undoes the work of the designer. Use the | ||
| 267 | ~disable-theme~ command if you are trying other themes beside the | ||
| 268 | Modus collection. | ||
| 254 | 269 | ||
| 255 | Users of the built-in themes cannot ~require~ the package as usual | 270 | Users of the built-in themes cannot ~require~ the package as usual |
| 256 | because there is no package to speak of. Instead, things are simpler as | 271 | because there is no package to speak of. Instead, things are simpler |
| 257 | all one needs is to load the theme of their preference by adding either | 272 | as built-in themes are considered safe. All one needs is to load the |
| 258 | form to their init file: | 273 | theme of their preference by adding either form to their init file: |
| 259 | 274 | ||
| 260 | #+begin_src emacs-lisp | 275 | #+begin_src emacs-lisp |
| 261 | (load-theme 'modus-operandi) ; Light theme | 276 | (load-theme 'modus-operandi) ; Light theme |
| 262 | (load-theme 'modus-vivendi) ; Dark theme | 277 | (load-theme 'modus-vivendi) ; Dark theme |
| 263 | #+end_src | 278 | #+end_src |
| 264 | 279 | ||
| 280 | Remember that the Modus themes are six themes ([[#h:f0f3dbcb-602d-40cf-b918-8f929c441baf][Overview]]). Adapt the | ||
| 281 | above snippet accordingly. | ||
| 282 | |||
| 265 | Users of packaged variants of the themes must add a few more lines to | 283 | Users of packaged variants of the themes must add a few more lines to |
| 266 | ensure that everything works as intended. First, one has to require the | 284 | ensure that everything works as intended. First, one has to require the |
| 267 | main library before loading either theme: | 285 | main library before loading one of the themes: |
| 268 | 286 | ||
| 269 | #+begin_src emacs-lisp | 287 | #+begin_src emacs-lisp |
| 270 | (require 'modus-themes) | 288 | (require 'modus-themes) |
| 271 | #+end_src | 289 | #+end_src |
| 272 | 290 | ||
| 273 | Then it is recommended to load the individual theme files with the | 291 | One can activate a theme with something like the following expression, |
| 274 | helper function ~modus-themes-load-themes~: | 292 | replacing ~modus-operandi~ with their preferred Modus theme: |
| 275 | 293 | ||
| 276 | #+begin_src emacs-lisp | 294 | #+begin_src emacs-lisp |
| 277 | ;; Load the theme files before enabling a theme (else you get an error). | 295 | (load-theme 'modus-operandi :no-confim) |
| 278 | (modus-themes-load-themes) | ||
| 279 | #+end_src | ||
| 280 | |||
| 281 | Once the libraries that define the themes are enabled, one can activate | ||
| 282 | a theme with either of the following expressions: | ||
| 283 | |||
| 284 | #+begin_src emacs-lisp | ||
| 285 | (modus-themes-load-operandi) ; Light theme | ||
| 286 | ;; OR | ||
| 287 | (modus-themes-load-vivendi) ; Dark theme | ||
| 288 | #+end_src | 296 | #+end_src |
| 289 | 297 | ||
| 290 | Changes to the available customization options must always be evaluated | 298 | Changes to the available customization options must always be evaluated |
| 291 | before loading a theme ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). An exception to this | 299 | before loading a theme ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). Reload a theme for |
| 292 | norm is when using the various Custom interfaces or with commands like | 300 | new changes to take effect. |
| 293 | {{{kbd(M-x customize-set-variable)}}}, which can optionally | ||
| 294 | automatically reload the theme ([[#h:9001527a-4e2c-43e0-98e8-3ef72d770639][Option for inhibiting theme reload]]). | ||
| 295 | 301 | ||
| 296 | This is how a basic setup could look like: | 302 | This is how a basic setup could look like: |
| 297 | 303 | ||
| 298 | #+begin_src emacs-lisp | 304 | #+begin_src emacs-lisp |
| 299 | ;;; For the built-in themes which cannot use `require': | 305 | ;;; For the built-in themes which cannot use `require'. |
| 300 | ;; Add all your customizations prior to loading the themes | 306 | |
| 307 | ;; Add all your customizations prior to loading the themes. | ||
| 301 | (setq modus-themes-italic-constructs t | 308 | (setq modus-themes-italic-constructs t |
| 302 | modus-themes-bold-constructs nil | 309 | modus-themes-bold-constructs nil) |
| 303 | modus-themes-region '(bg-only no-extend)) | ||
| 304 | 310 | ||
| 305 | ;; Load the theme of your choice: | 311 | ;; Load the theme of your choice. |
| 306 | (load-theme 'modus-operandi) ;; OR (load-theme 'modus-vivendi) | 312 | (load-theme 'modus-operandi) |
| 307 | 313 | ||
| 314 | ;; Optionally define a key to switch between Modus themes. Also check | ||
| 315 | ;; the user option `modus-themes-to-toggle'. | ||
| 308 | (define-key global-map (kbd "<f5>") #'modus-themes-toggle) | 316 | (define-key global-map (kbd "<f5>") #'modus-themes-toggle) |
| 309 | 317 | ||
| 310 | 318 | ||
| 311 | 319 | ||
| 312 | ;;; For packaged versions which must use `require': | 320 | ;;; For packaged versions which must use `require'. |
| 321 | |||
| 313 | (require 'modus-themes) | 322 | (require 'modus-themes) |
| 314 | 323 | ||
| 315 | ;; Add all your customizations prior to loading the themes | 324 | ;; Add all your customizations prior to loading the themes |
| 316 | (setq modus-themes-italic-constructs t | 325 | (setq modus-themes-italic-constructs t |
| 317 | modus-themes-bold-constructs nil | 326 | modus-themes-bold-constructs nil) |
| 318 | modus-themes-region '(bg-only no-extend)) | ||
| 319 | 327 | ||
| 320 | ;; Load the theme files before enabling a theme | 328 | ;; Load the theme of your choice. |
| 321 | (modus-themes-load-themes) | 329 | (load-theme 'modus-operandi :no-confim) |
| 322 | |||
| 323 | ;; Load the theme of your choice: | ||
| 324 | (modus-themes-load-operandi) ;; OR (modus-themes-load-vivendi) | ||
| 325 | 330 | ||
| 326 | (define-key global-map (kbd "<f5>") #'modus-themes-toggle) | 331 | (define-key global-map (kbd "<f5>") #'modus-themes-toggle) |
| 327 | #+end_src | 332 | #+end_src |
| 328 | 333 | ||
| 329 | [[#h:e979734c-a9e1-4373-9365-0f2cd36107b8][Sample configuration with and without use-package]]. | 334 | [[#h:e979734c-a9e1-4373-9365-0f2cd36107b8][Sample configuration with and without use-package]]. |
| 330 | 335 | ||
| 331 | With those granted, bear in mind a couple of technical points on | ||
| 332 | ~modus-themes-load-operandi~ and ~modus-themes-load-vivendi~, as well as | ||
| 333 | ~modus-themes-toggle~ which relies on them: | ||
| 334 | |||
| 335 | 1. Those functions call ~load-theme~. Some users prefer to opt for | ||
| 336 | ~enable-theme~ instead ([[#h:e68560b3-7fb0-42bc-a151-e015948f8a35][Differences between loading and enabling]]). | ||
| 337 | |||
| 338 | 2. The functions will run the ~modus-themes-after-load-theme-hook~ as | ||
| 339 | their final step. This can be employed for bespoke configurations | ||
| 340 | ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]). Experienced users may not wish to rely on | ||
| 341 | such a hook and the functions that run it: they may prefer a custom | ||
| 342 | solution ([[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]). | ||
| 343 | |||
| 344 | ** Sample configuration with and without use-package | 336 | ** Sample configuration with and without use-package |
| 345 | :properties: | 337 | :properties: |
| 346 | :custom_id: h:e979734c-a9e1-4373-9365-0f2cd36107b8 | 338 | :custom_id: h:e979734c-a9e1-4373-9365-0f2cd36107b8 |
| @@ -348,38 +340,36 @@ With those granted, bear in mind a couple of technical points on | |||
| 348 | #+cindex: use-package configuration | 340 | #+cindex: use-package configuration |
| 349 | #+cindex: sample configuration | 341 | #+cindex: sample configuration |
| 350 | 342 | ||
| 343 | What follows is a variant of what we demonstrate in the previous | ||
| 344 | section ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). | ||
| 345 | |||
| 351 | It is common for Emacs users to rely on ~use-package~ for declaring | 346 | It is common for Emacs users to rely on ~use-package~ for declaring |
| 352 | package configurations in their setup. We use this as an example: | 347 | package configurations in their setup. We use this as an example: |
| 353 | 348 | ||
| 354 | #+begin_src emacs-lisp | 349 | #+begin_src emacs-lisp |
| 355 | ;;; For the built-in themes which cannot use `require': | 350 | ;;; For the built-in themes which cannot use `require'. |
| 356 | (use-package emacs | 351 | (use-package emacs |
| 357 | :init | 352 | :init |
| 358 | ;; Add all your customizations prior to loading the themes | 353 | ;; Add all your customizations prior to loading the themes |
| 359 | (setq modus-themes-italic-constructs t | 354 | (setq modus-themes-italic-constructs t |
| 360 | modus-themes-bold-constructs nil | 355 | modus-themes-bold-constructs nil) |
| 361 | modus-themes-region '(bg-only no-extend)) | ||
| 362 | :config | 356 | :config |
| 363 | ;; Load the theme of your choice: | 357 | ;; Load the theme of your choice. |
| 364 | (load-theme 'modus-operandi) ;; OR (load-theme 'modus-vivendi) | 358 | (load-theme 'modus-operandi) |
| 365 | :bind ("<f5>" . modus-themes-toggle)) | 359 | :bind ("<f5>" . modus-themes-toggle)) |
| 366 | 360 | ||
| 367 | 361 | ||
| 368 | 362 | ||
| 369 | ;;; For packaged versions which must use `require': | 363 | ;;; For packaged versions which must use `require'. |
| 370 | (use-package modus-themes | 364 | (use-package modus-themes |
| 371 | :ensure | 365 | :ensure |
| 372 | :init | 366 | :init |
| 373 | ;; Add all your customizations prior to loading the themes | 367 | ;; Add all your customizations prior to loading the themes |
| 374 | (setq modus-themes-italic-constructs t | 368 | (setq modus-themes-italic-constructs t |
| 375 | modus-themes-bold-constructs nil | 369 | modus-themes-bold-constructs nil) |
| 376 | modus-themes-region '(bg-only no-extend)) | ||
| 377 | |||
| 378 | ;; Load the theme files before enabling a theme | ||
| 379 | (modus-themes-load-themes) | ||
| 380 | :config | 370 | :config |
| 381 | ;; Load the theme of your choice: | 371 | ;; Load the theme of your choice. |
| 382 | (modus-themes-load-operandi) ;; OR (modus-themes-load-vivendi) | 372 | (load-theme 'modus-operandi :no-confim) |
| 383 | :bind ("<f5>" . modus-themes-toggle)) | 373 | :bind ("<f5>" . modus-themes-toggle)) |
| 384 | #+end_src | 374 | #+end_src |
| 385 | 375 | ||
| @@ -389,8 +379,7 @@ The same without ~use-package~: | |||
| 389 | ;;; For the built-in themes which cannot use `require': | 379 | ;;; For the built-in themes which cannot use `require': |
| 390 | ;; Add all your customizations prior to loading the themes | 380 | ;; Add all your customizations prior to loading the themes |
| 391 | (setq modus-themes-italic-constructs t | 381 | (setq modus-themes-italic-constructs t |
| 392 | modus-themes-bold-constructs nil | 382 | modus-themes-bold-constructs nil) |
| 393 | modus-themes-region '(bg-only no-extend)) | ||
| 394 | 383 | ||
| 395 | ;; Load the theme of your choice: | 384 | ;; Load the theme of your choice: |
| 396 | (load-theme 'modus-operandi) ;; OR (load-theme 'modus-vivendi) | 385 | (load-theme 'modus-operandi) ;; OR (load-theme 'modus-vivendi) |
| @@ -404,14 +393,10 @@ The same without ~use-package~: | |||
| 404 | 393 | ||
| 405 | ;; Add all your customizations prior to loading the themes | 394 | ;; Add all your customizations prior to loading the themes |
| 406 | (setq modus-themes-italic-constructs t | 395 | (setq modus-themes-italic-constructs t |
| 407 | modus-themes-bold-constructs nil | 396 | modus-themes-bold-constructs nil) |
| 408 | modus-themes-region '(bg-only no-extend)) | ||
| 409 | |||
| 410 | ;; Load the theme files before enabling a theme | ||
| 411 | (modus-themes-load-themes) | ||
| 412 | 397 | ||
| 413 | ;; Load the theme of your choice: | 398 | ;; Load the theme of your choice: |
| 414 | (modus-themes-load-operandi) ;; OR (modus-themes-load-vivendi) | 399 | (load-theme 'modus-operandi :no-confim) ;; OR (load-theme 'modus-vivendi :no-confim) |
| 415 | 400 | ||
| 416 | (define-key global-map (kbd "<f5>") #'modus-themes-toggle) | 401 | (define-key global-map (kbd "<f5>") #'modus-themes-toggle) |
| 417 | #+end_src | 402 | #+end_src |
| @@ -433,8 +418,8 @@ package declaration of the themes. | |||
| 433 | The reason we recommend ~load-theme~ instead of the other option of | 418 | The reason we recommend ~load-theme~ instead of the other option of |
| 434 | ~enable-theme~ is that the former does a kind of "reset" on the face | 419 | ~enable-theme~ is that the former does a kind of "reset" on the face |
| 435 | specs. It quite literally loads (or reloads) the theme. Whereas the | 420 | specs. It quite literally loads (or reloads) the theme. Whereas the |
| 436 | latter simply puts an already loaded theme at the top of the list of | 421 | ~enable-theme~ function simply puts an already loaded theme to the top |
| 437 | enabled items, re-using whatever state was last loaded. | 422 | of the list of enabled items, re-using whatever state was last loaded. |
| 438 | 423 | ||
| 439 | As such, ~load-theme~ reads all customizations that may happen during | 424 | As such, ~load-theme~ reads all customizations that may happen during |
| 440 | any given Emacs session: even after the initial setup of a theme. | 425 | any given Emacs session: even after the initial setup of a theme. |
| @@ -453,10 +438,13 @@ session, are better off using something like this: | |||
| 453 | 438 | ||
| 454 | #+begin_src emacs-lisp | 439 | #+begin_src emacs-lisp |
| 455 | (require 'modus-themes) | 440 | (require 'modus-themes) |
| 441 | |||
| 442 | ;; Activate your desired themes here | ||
| 456 | (load-theme 'modus-operandi t t) | 443 | (load-theme 'modus-operandi t t) |
| 457 | (load-theme 'modus-vivendi t t) | 444 | (load-theme 'modus-vivendi t t) |
| 458 | 445 | ||
| 459 | (enable-theme 'modus-operandi) ;; OR (enable-theme 'modus-vivendi) | 446 | ;; Enable the preferred one |
| 447 | (enable-theme 'modus-operandi) | ||
| 460 | #+end_src | 448 | #+end_src |
| 461 | 449 | ||
| 462 | [[#h:b40aca50-a3b2-4c43-be58-2c26fcd14237][Toggle themes without reloading them]]. | 450 | [[#h:b40aca50-a3b2-4c43-be58-2c26fcd14237][Toggle themes without reloading them]]. |
| @@ -467,198 +455,95 @@ With the above granted, other sections of the manual discuss how to | |||
| 467 | configure custom faces, where ~load-theme~ is expected, though | 455 | configure custom faces, where ~load-theme~ is expected, though |
| 468 | ~enable-theme~ could still apply in stable setups: | 456 | ~enable-theme~ could still apply in stable setups: |
| 469 | 457 | ||
| 470 | [[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Case-by-case face specs using the themes' palette]]. | 458 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 471 | |||
| 472 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | ||
| 473 | 459 | ||
| 474 | * Customization Options | 460 | * Customization options |
| 475 | :properties: | 461 | :properties: |
| 476 | :custom_id: h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f | 462 | :custom_id: h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f |
| 477 | :end: | 463 | :end: |
| 478 | 464 | ||
| 479 | The Modus themes are highly configurable, though they should work well | 465 | The Modus themes are highly configurable, though they should work well |
| 480 | without any further tweaks. By default, all customization options are | 466 | without any further tweaks. We provide a variety of user options. |
| 481 | set to nil, unless otherwise noted in this manual. | 467 | The following code block provides an overview. In addition to those |
| 468 | variables, the themes support a comprehensive system of overrides: it | ||
| 469 | can be used to make thoroughgoing changes to the looks of the themes | ||
| 470 | ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). We document everything at length in | ||
| 471 | the pages of this manual and also provide ready-to-use code samples. | ||
| 482 | 472 | ||
| 483 | Remember that all customization options must be evaluated before loading | 473 | Remember that all customization options must be evaluated before loading |
| 484 | a theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). If the theme is already active, it must be | 474 | a theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). If the theme is already active, it must be |
| 485 | reloaded for changes in user options to come into force. | 475 | reloaded for changes to take effect. |
| 486 | |||
| 487 | Below is a summary of what you will learn in the subsequent sections of | ||
| 488 | this manual. | ||
| 489 | 476 | ||
| 490 | #+begin_src emacs-lisp | 477 | #+begin_src emacs-lisp |
| 478 | ;; In all of the following, WEIGHT is a symbol such as `semibold', | ||
| 479 | ;; `light', `bold', or anything mentioned in `modus-themes-weights'. | ||
| 491 | (setq modus-themes-italic-constructs t | 480 | (setq modus-themes-italic-constructs t |
| 492 | modus-themes-bold-constructs nil | 481 | modus-themes-bold-constructs nil |
| 493 | modus-themes-mixed-fonts nil | 482 | modus-themes-mixed-fonts t |
| 494 | modus-themes-subtle-line-numbers nil | ||
| 495 | modus-themes-intense-mouseovers nil | ||
| 496 | modus-themes-deuteranopia t | ||
| 497 | modus-themes-tabs-accented t | ||
| 498 | modus-themes-variable-pitch-ui nil | 483 | modus-themes-variable-pitch-ui nil |
| 499 | modus-themes-inhibit-reload t ; only applies to `customize-set-variable' and related | 484 | modus-themes-custom-auto-reload t |
| 500 | |||
| 501 | modus-themes-fringes nil ; {nil,'subtle,'intense} | ||
| 502 | |||
| 503 | ;; Options for `modus-themes-lang-checkers' are either nil (the | ||
| 504 | ;; default), or a list of properties that may include any of those | ||
| 505 | ;; symbols: `straight-underline', `text-also', `background', | ||
| 506 | ;; `intense' OR `faint'. | ||
| 507 | modus-themes-lang-checkers nil | ||
| 508 | |||
| 509 | ;; Options for `modus-themes-mode-line' are either nil, or a list | ||
| 510 | ;; that can combine any of `3d' OR `moody', `borderless', | ||
| 511 | ;; `accented', a natural number for extra padding (or a cons cell | ||
| 512 | ;; of padding and NATNUM), and a floating point for the height of | ||
| 513 | ;; the text relative to the base font size (or a cons cell of | ||
| 514 | ;; height and FLOAT) | ||
| 515 | modus-themes-mode-line '(accented borderless (padding . 4) (height . 0.9)) | ||
| 516 | |||
| 517 | ;; Same as above: | ||
| 518 | ;; modus-themes-mode-line '(accented borderless 4 0.9) | ||
| 519 | |||
| 520 | ;; Options for `modus-themes-markup' are either nil, or a list | ||
| 521 | ;; that can combine any of `bold', `italic', `background', | ||
| 522 | ;; `intense'. | ||
| 523 | modus-themes-markup '(background italic) | ||
| 524 | |||
| 525 | ;; Options for `modus-themes-syntax' are either nil (the default), | ||
| 526 | ;; or a list of properties that may include any of those symbols: | ||
| 527 | ;; `faint', `yellow-comments', `green-strings', `alt-syntax' | ||
| 528 | modus-themes-syntax nil | ||
| 529 | |||
| 530 | ;; Options for `modus-themes-hl-line' are either nil (the default), | ||
| 531 | ;; or a list of properties that may include any of those symbols: | ||
| 532 | ;; `accented', `underline', `intense' | ||
| 533 | modus-themes-hl-line '(underline accented) | ||
| 534 | |||
| 535 | ;; Options for `modus-themes-paren-match' are either nil (the | ||
| 536 | ;; default), or a list of properties that may include any of those | ||
| 537 | ;; symbols: `bold', `intense', `underline' | ||
| 538 | modus-themes-paren-match '(bold intense) | ||
| 539 | |||
| 540 | ;; Options for `modus-themes-links' are either nil (the default), | ||
| 541 | ;; or a list of properties that may include any of those symbols: | ||
| 542 | ;; `neutral-underline' OR `no-underline', `faint' OR `no-color', | ||
| 543 | ;; `bold', `italic', `background' | ||
| 544 | modus-themes-links '(neutral-underline background) | ||
| 545 | |||
| 546 | ;; Options for `modus-themes-box-buttons' are either nil (the | ||
| 547 | ;; default), or a list that can combine any of `flat', `accented', | ||
| 548 | ;; `faint', `variable-pitch', `underline', `all-buttons', the | ||
| 549 | ;; symbol of any font weight as listed in `modus-themes-weights', | ||
| 550 | ;; and a floating point number (e.g. 0.9) for the height of the | ||
| 551 | ;; button's text. | ||
| 552 | modus-themes-box-buttons '(variable-pitch flat faint 0.9) | ||
| 553 | 485 | ||
| 554 | ;; Options for `modus-themes-prompts' are either nil (the | 486 | ;; Options for `modus-themes-prompts' are either nil (the |
| 555 | ;; default), or a list of properties that may include any of those | 487 | ;; default), or a list of properties that may include any of those |
| 556 | ;; symbols: `background', `bold', `gray', `intense', `italic' | 488 | ;; symbols: `italic', `WEIGHT' |
| 557 | modus-themes-prompts '(intense bold) | 489 | modus-themes-prompts '(italic bold) |
| 558 | 490 | ||
| 559 | ;; The `modus-themes-completions' is an alist that reads three | 491 | ;; The `modus-themes-completions' is an alist that reads two |
| 560 | ;; keys: `matches', `selection', `popup'. Each accepts a nil | 492 | ;; keys: `matches', `selection'. Each accepts a nil value (or |
| 561 | ;; value (or empty list) or a list of properties that can include | 493 | ;; empty list) or a list of properties that can include any of |
| 562 | ;; any of the following (for WEIGHT read further below): | 494 | ;; the following (for WEIGHT read further below): |
| 563 | ;; | ||
| 564 | ;; `matches' - `background', `intense', `underline', `italic', WEIGHT | ||
| 565 | ;; `selection' - `accented', `intense', `underline', `italic', `text-also' WEIGHT | ||
| 566 | ;; `popup' - same as `selected' | ||
| 567 | ;; `t' - applies to any key not explicitly referenced (check docs) | ||
| 568 | ;; | 495 | ;; |
| 569 | ;; WEIGHT is a symbol such as `semibold', `light', or anything | 496 | ;; `matches' :: `underline', `italic', `WEIGHT' |
| 570 | ;; covered in `modus-themes-weights'. Bold is used in the absence | 497 | ;; `selection' :: `underline', `italic', `WEIGHT' |
| 571 | ;; of an explicit WEIGHT. | 498 | modus-themes-completions |
| 572 | modus-themes-completions '((matches . (extrabold)) | 499 | '((matches . (extrabold)) |
| 573 | (selection . (semibold accented)) | 500 | (selection . (semibold italic text-also))) |
| 574 | (popup . (accented intense))) | ||
| 575 | |||
| 576 | modus-themes-mail-citations nil ; {nil,'intense,'faint,'monochrome} | ||
| 577 | |||
| 578 | ;; Options for `modus-themes-region' are either nil (the default), | ||
| 579 | ;; or a list of properties that may include any of those symbols: | ||
| 580 | ;; `no-extend', `bg-only', `accented' | ||
| 581 | modus-themes-region '(bg-only no-extend) | ||
| 582 | |||
| 583 | ;; Options for `modus-themes-diffs': nil, 'desaturated, 'bg-only | ||
| 584 | modus-themes-diffs 'desaturated | ||
| 585 | 501 | ||
| 586 | modus-themes-org-blocks 'gray-background ; {nil,'gray-background,'tinted-background} | 502 | modus-themes-org-blocks 'gray-background ; {nil,'gray-background,'tinted-background} |
| 587 | 503 | ||
| 588 | modus-themes-org-agenda ; this is an alist: read the manual or its doc string | 504 | ;; The `modus-themes-headings' is an alist: read the manual's |
| 589 | '((header-block . (variable-pitch 1.3)) | 505 | ;; node about it or its doc string. Basically, it supports |
| 590 | (header-date . (grayscale workaholic bold-today 1.1)) | 506 | ;; per-level configurations for the optional use of |
| 591 | (event . (accented varied)) | 507 | ;; `variable-pitch' typography, a height value as a multiple of |
| 592 | (scheduled . uniform) | 508 | ;; the base font size (e.g. 1.5), and a `WEIGHT'. |
| 593 | (habit . traffic-light)) | 509 | modus-themes-headings |
| 594 | 510 | '((1 . (variable-pitch 1.5)) | |
| 595 | modus-themes-headings ; this is an alist: read the manual or its doc string | 511 | (2 . (1.3)) |
| 596 | '((1 . (overline background variable-pitch 1.3)) | 512 | (agenda-date . (1.3)) |
| 597 | (2 . (rainbow overline 1.1)) | 513 | (agenda-structure . (variable-pitch light 1.8)) |
| 598 | (t . (semibold)))) | 514 | (t . (1.1)))) |
| 515 | |||
| 516 | ;; Remember that more (MUCH MORE) can be done with overrides, which we | ||
| 517 | ;; document extensively in this manual. | ||
| 599 | #+end_src | 518 | #+end_src |
| 600 | 519 | ||
| 601 | ** Option for inhibiting theme reload | 520 | ** Option for reloading the theme on custom change |
| 602 | :properties: | 521 | :properties: |
| 603 | :alt_title: Custom reload theme | 522 | :alt_title: Custom reload theme |
| 604 | :description: Toggle auto-reload of the theme when setting custom variables | 523 | :description: Toggle auto-reload of the theme when setting custom variables |
| 605 | :custom_id: h:9001527a-4e2c-43e0-98e8-3ef72d770639 | 524 | :custom_id: h:9001527a-4e2c-43e0-98e8-3ef72d770639 |
| 606 | :end: | 525 | :end: |
| 607 | #+vindex: modus-themes-inhibit-reload | 526 | #+vindex: modus-themes-custom-auto-reload |
| 608 | 527 | ||
| 609 | Brief: Toggle reloading of the active theme when an option is changed | 528 | Brief: Toggle reloading of the active theme when an option is changed |
| 610 | through the Customize UI. | 529 | through the Custom UI. |
| 611 | 530 | ||
| 612 | Symbol: ~modus-themes-inhibit-reload~ (=boolean= type) | 531 | Symbol: ~modus-themes-custom-auto-reload~ (=boolean= type) |
| 613 | 532 | ||
| 614 | Possible values: | 533 | Possible values: |
| 615 | 534 | ||
| 616 | 1. ~nil~ | 535 | 1. ~nil~ |
| 617 | 2. ~t~ (default) | 536 | 2. ~t~ (default) |
| 618 | 537 | ||
| 619 | By default, customizing a theme-related user option through the Custom | 538 | All theme user options take effect when a theme is loaded. Any |
| 620 | interfaces or with {{{kbd(M-x customize-set-variable)}}} will not reload the | 539 | subsequent changes require the theme to be reloaded. |
| 621 | currently active Modus theme. | ||
| 622 | |||
| 623 | Enable this behavior by setting this variable to ~nil~. | ||
| 624 | |||
| 625 | Regardless of this option, the active theme must be reloaded for changes | ||
| 626 | to user options to take effect ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). | ||
| 627 | |||
| 628 | ** Option for red-green color deficiency or deuteranopia | ||
| 629 | :properties: | ||
| 630 | :alt_title: Deuteranopia style | ||
| 631 | :description: Toggle red/blue color-coding instead of red/green | ||
| 632 | :custom_id: h:3ed03a48-20d8-4ce7-b214-0eb7e4c79abe | ||
| 633 | :end: | ||
| 634 | #+vindex: modus-themes-deuteranopia | ||
| 635 | |||
| 636 | Brief: When non-~nil~ use red/blue color-coding instead of red/green, | ||
| 637 | where appropriate. | ||
| 638 | |||
| 639 | Symbol: ~modus-themes-deuteranopia~ (=boolean= type) | ||
| 640 | |||
| 641 | Possible values: | ||
| 642 | |||
| 643 | 1. ~nil~ (default) | ||
| 644 | 2. ~t~ | ||
| 645 | |||
| 646 | This is to account for red-green color deficiency, also know as | ||
| 647 | deuteranopia and variants. It applies to all contexts where there can | ||
| 648 | be a color-coded distinction between failure or success, a to-do or done | ||
| 649 | state, a mark for deletion versus a mark for selection (e.g. in Dired), | ||
| 650 | current and lazily highlighted search matches, removed lines in diffs as | ||
| 651 | opposed to added ones, and so on. | ||
| 652 | 540 | ||
| 653 | Note that this does not change all colors throughout the active theme, | 541 | When this variable has a non-nil value, any change made via the Custom |
| 654 | but only applies to cases that have color-coding significance. For | 542 | UI or related functions such as ~customize-set-variable~ and ~setopt~ |
| 655 | example, regular code syntax highlighting is not affected. There is no | 543 | (Emacs 29), will trigger a reload automatically. |
| 656 | such need because of the themes' overarching commitment to the highest | ||
| 657 | legibility standard, which ensures that text is readable regardless of | ||
| 658 | hue, as well as the predominance of colors on the | ||
| 659 | blue-cyan-magenta-purple side of the spectrum. | ||
| 660 | 544 | ||
| 661 | [[#h:0b26cb47-9733-4cb1-87d9-50850cb0386e][Why are colors mostly variants of blue, magenta, cyan?]]. | 545 | With a nil value, changes to user options have no further consequences: |
| 546 | the user must manually reload the theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). | ||
| 662 | 547 | ||
| 663 | ** Option for more bold constructs | 548 | ** Option for more bold constructs |
| 664 | :properties: | 549 | :properties: |
| @@ -680,9 +565,9 @@ Possible values: | |||
| 680 | The default is to use a bold typographic weight only when it is | 565 | The default is to use a bold typographic weight only when it is |
| 681 | required. | 566 | required. |
| 682 | 567 | ||
| 683 | With a non-~nil~ value (~t~) display several syntactic constructs in bold | 568 | With a non-~nil~ value (~t~) display several syntactic constructs in |
| 684 | weight. This concerns keywords and other important aspects of code | 569 | bold weight. This concerns keywords and other important aspects of |
| 685 | syntax. It also affects certain mode line indicators and command-line | 570 | code syntax. It also affects certain mode line indicators and command |
| 686 | prompts. | 571 | prompts. |
| 687 | 572 | ||
| 688 | Advanced users may also want to configure the exact attributes of the | 573 | Advanced users may also want to configure the exact attributes of the |
| @@ -718,70 +603,6 @@ Advanced users may also want to configure the exact attributes of the | |||
| 718 | 603 | ||
| 719 | [[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. | 604 | [[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. |
| 720 | 605 | ||
| 721 | ** Option for syntax highlighting | ||
| 722 | :properties: | ||
| 723 | :alt_title: Syntax styles | ||
| 724 | :description: Choose the overall aesthetic of code syntax | ||
| 725 | :custom_id: h:c119d7b2-fcd4-4e44-890e-5e25733d5e52 | ||
| 726 | :end: | ||
| 727 | #+vindex: modus-themes-syntax | ||
| 728 | |||
| 729 | Brief: Set the overall style of code syntax highlighting. | ||
| 730 | |||
| 731 | Symbol: ~modus-themes-syntax~ (=choice= type, list of properties) | ||
| 732 | |||
| 733 | Possible values are expressed as a list of properties (default is ~nil~ or | ||
| 734 | an empty list). The list can include any of the following symbols: | ||
| 735 | |||
| 736 | + ~faint~ | ||
| 737 | + ~yellow-comments~ | ||
| 738 | + ~green-strings~ | ||
| 739 | + ~alt-syntax~ | ||
| 740 | |||
| 741 | The default (a ~nil~ value or an empty list) is to use a balanced | ||
| 742 | combination of colors on the cyan-blue-magenta side of the spectrum. | ||
| 743 | There is little to no use of greens, yellows, and reds. Comments are | ||
| 744 | gray, strings are blue colored, doc strings are a shade of cyan, while | ||
| 745 | color combinations are designed to avoid exaggerations. | ||
| 746 | |||
| 747 | The property ~faint~ fades the saturation of all applicable colors, where | ||
| 748 | that is possible or appropriate. | ||
| 749 | |||
| 750 | The property ~yellow-comments~ applies a yellow color to comments. | ||
| 751 | |||
| 752 | The property ~green-strings~ applies a green color to strings and a green | ||
| 753 | tint to doc strings. | ||
| 754 | |||
| 755 | The property ~alt-syntax~ changes the combination of colors beyond strings | ||
| 756 | and comments, so that the effective palette is broadened to provide | ||
| 757 | greater variety relative to the default. | ||
| 758 | |||
| 759 | Combinations of any of those properties are expressed as a list, like in | ||
| 760 | these examples: | ||
| 761 | |||
| 762 | #+begin_src emacs-lisp | ||
| 763 | (faint) | ||
| 764 | (green-strings yellow-comments) | ||
| 765 | (alt-syntax green-strings yellow-comments) | ||
| 766 | (faint alt-syntax green-strings yellow-comments) | ||
| 767 | #+end_src | ||
| 768 | |||
| 769 | The order in which the properties are set is not significant. | ||
| 770 | |||
| 771 | In user configuration files the form may look like this: | ||
| 772 | |||
| 773 | #+begin_src emacs-lisp | ||
| 774 | (setq modus-themes-syntax '(faint alt-syntax)) | ||
| 775 | #+end_src | ||
| 776 | |||
| 777 | Independent of this variable, users may also control the use of a bold | ||
| 778 | weight or italic text: ~modus-themes-bold-constructs~ and | ||
| 779 | ~modus-themes-italic-constructs~. | ||
| 780 | |||
| 781 | [[#h:b25714f6-0fbe-41f6-89b5-6912d304091e][Option for more bold constructs]]. | ||
| 782 | |||
| 783 | [[#h:977c900d-0d6d-4dbb-82d9-c2aae69543d6][Option for more italic constructs]]. | ||
| 784 | |||
| 785 | ** Option for font mixing | 606 | ** Option for font mixing |
| 786 | :properties: | 607 | :properties: |
| 787 | :alt_title: Mixed fonts | 608 | :alt_title: Mixed fonts |
| @@ -805,111 +626,31 @@ tables and code blocks to always inherit from the ~fixed-pitch~ face. | |||
| 805 | This is to ensure that certain constructs like code blocks and tables | 626 | This is to ensure that certain constructs like code blocks and tables |
| 806 | remain monospaced even when users opt for a mode that remaps typeface | 627 | remain monospaced even when users opt for a mode that remaps typeface |
| 807 | families, such as the built-in {{{kbd(M-x variable-pitch-mode)}}}. Otherwise | 628 | families, such as the built-in {{{kbd(M-x variable-pitch-mode)}}}. Otherwise |
| 808 | the layout would appear broken, due to how spacing is done. | 629 | the layout can appear broken, due to how spacing is done. |
| 809 | 630 | ||
| 810 | For a consistent experience, user may need to specify the font family of | 631 | For a consistent experience, user may need to specify the font family of |
| 811 | the ~fixed-pitch~ face. | 632 | the ~fixed-pitch~ face. |
| 812 | 633 | ||
| 813 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. | 634 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. |
| 814 | 635 | ||
| 815 | Furthermore, users may prefer to use another package for handling mixed | 636 | ** Option for command prompt styles |
| 816 | typeface configurations, rather than letting the theme do it, perhaps | ||
| 817 | because a purpose-specific package has extra functionality. Two | ||
| 818 | possible options are ~org-variable-pitch~ and ~mixed-pitch~. | ||
| 819 | |||
| 820 | ** Option for links | ||
| 821 | :properties: | 637 | :properties: |
| 822 | :alt_title: Link styles | 638 | :alt_title: Command prompts |
| 823 | :description: Choose among several styles, with or without underline | 639 | :description: Control the style of command prompts |
| 824 | :custom_id: h:5808be52-361a-4d18-88fd-90129d206f9b | 640 | :custom_id: h:db5a9a7c-2928-4a28-b0f0-6f2b9bd52ba1 |
| 825 | :end: | 641 | :end: |
| 826 | #+vindex: modus-themes-links | 642 | #+vindex: modus-themes-prompts |
| 827 | 643 | ||
| 828 | Brief: Control the style of links to web pages, files, buffers... | 644 | Brief: Control the style of command prompts (e.g. minibuffer, shell, IRC |
| 645 | clients). | ||
| 829 | 646 | ||
| 830 | Symbol: ~modus-themes-links~ (=choice= type, list of properties) | 647 | Symbol: ~modus-themes-prompts~ (=choice= type, list of properties) |
| 831 | 648 | ||
| 832 | Possible values are expressed as a list of properties (default is ~nil~ or | 649 | Possible values are expressed as a list of properties (default is ~nil~ or |
| 833 | an empty list). The list can include any of the following symbols: | 650 | an empty list). The list can include any of the following symbols: |
| 834 | 651 | ||
| 835 | + Underline style: | ||
| 836 | - ~neutral-underline~ | ||
| 837 | - ~no-underline~ | ||
| 838 | + Text coloration: | ||
| 839 | - ~faint~ | ||
| 840 | - ~no-color~ | ||
| 841 | + ~bold~ | ||
| 842 | + ~italic~ | 652 | + ~italic~ |
| 843 | + ~background~ | 653 | + ~italic~ |
| 844 | |||
| 845 | The default (a ~nil~ value or an empty list) is a prominent text color, | ||
| 846 | typically blue, with an underline of the same color. | ||
| 847 | |||
| 848 | For the style of the underline, a ~neutral-underline~ property turns the | ||
| 849 | color of the line into a subtle gray, while the ~no-underline~ property | ||
| 850 | removes the line altogether. If both of those are set, the latter takes | ||
| 851 | precedence. | ||
| 852 | |||
| 853 | For text coloration, a ~faint~ property desaturates the color of the text | ||
| 854 | and the underline, unless the underline is affected by the | ||
| 855 | aforementioned properties. While a ~no-color~ property removes the color | ||
| 856 | from the text. If both of those are set, the latter takes precedence. | ||
| 857 | |||
| 858 | A ~bold~ property applies a heavy typographic weight to the text of the | ||
| 859 | link. | ||
| 860 | |||
| 861 | An ~italic~ property adds a slant to the link's text (italic or oblique | ||
| 862 | forms, depending on the typeface). | ||
| 863 | |||
| 864 | A ~background~ property applies a subtle tinted background color. | ||
| 865 | |||
| 866 | In case both ~no-underline~ and ~no-color~ are set, then a subtle gray | ||
| 867 | background is applied to all links. This can still be combined with the | ||
| 868 | ~bold~ and ~italic~ properties. | ||
| 869 | |||
| 870 | Combinations of any of those properties are expressed as a list, | ||
| 871 | like in these examples: | ||
| 872 | |||
| 873 | #+begin_src emacs-lisp | ||
| 874 | (faint) | ||
| 875 | (no-underline faint) | ||
| 876 | (no-color no-underline bold) | ||
| 877 | (italic bold background no-color no-underline) | ||
| 878 | #+end_src | ||
| 879 | |||
| 880 | The order in which the properties are set is not significant. | ||
| 881 | |||
| 882 | In user configuration files the form may look like this: | ||
| 883 | |||
| 884 | #+begin_src emacs-lisp | ||
| 885 | (setq modus-themes-links '(neutral-underline background)) | ||
| 886 | #+end_src | ||
| 887 | |||
| 888 | The placement of the underline, meaning its proximity to the text, is | ||
| 889 | controlled by ~x-use-underline-position-properties~, | ||
| 890 | ~x-underline-at-descent-line~, ~underline-minimum-offset~. Please refer to | ||
| 891 | their documentation strings. | ||
| 892 | |||
| 893 | ** Option for box buttons | ||
| 894 | :properties: | ||
| 895 | :alt_title: Box buttons | ||
| 896 | :description: Choose among several styles for buttons | ||
| 897 | :custom_id: h:8b85f711-ff40-45b0-b7fc-4727503cd2ec | ||
| 898 | :end: | ||
| 899 | #+vindex: modus-themes-box-buttons | ||
| 900 | |||
| 901 | Brief: Control the style of buttons in the Custom UI and related. | ||
| 902 | |||
| 903 | Symbol: ~modus-themes-box-buttons~ (=choice= type, list of properties) | ||
| 904 | |||
| 905 | Possible values are expressed as a list of properties (default is ~nil~ or | ||
| 906 | an empty list). The list can include any of the following symbols: | ||
| 907 | |||
| 908 | + ~flat~ | ||
| 909 | + ~accented~ | ||
| 910 | + ~faint~ | ||
| 911 | + ~variable-pitch~ | ||
| 912 | + ~underline~ | ||
| 913 | + A font weight, which must be supported by the underlying typeface: | 654 | + A font weight, which must be supported by the underlying typeface: |
| 914 | - ~thin~ | 655 | - ~thin~ |
| 915 | - ~ultralight~ | 656 | - ~ultralight~ |
| @@ -923,213 +664,24 @@ an empty list). The list can include any of the following symbols: | |||
| 923 | - ~heavy~ | 664 | - ~heavy~ |
| 924 | - ~extrabold~ | 665 | - ~extrabold~ |
| 925 | - ~ultrabold~ | 666 | - ~ultrabold~ |
| 926 | + A floating point as a height multiple of the default or a cons cell in | ||
| 927 | the form of =(height . FLOAT)= | ||
| 928 | + ~all-buttons~ | ||
| 929 | |||
| 930 | The default (a ~nil~ value or an empty list) is a gray background | ||
| 931 | combined with a pseudo three-dimensional effect. | ||
| 932 | |||
| 933 | The ~flat~ property makes the button two dimensional. | ||
| 934 | |||
| 935 | The ~accented~ property changes the background from gray to an accent | ||
| 936 | color. | ||
| 937 | |||
| 938 | The ~faint~ property reduces the overall coloration. | ||
| 939 | |||
| 940 | The ~variable-pitch~ property applies a proportionately spaced typeface | ||
| 941 | to the button~s text. | ||
| 942 | |||
| 943 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. | ||
| 944 | |||
| 945 | The ~underline~ property draws a line below the affected text and | ||
| 946 | removes whatever box effect. This is optimal when Emacs runs inside a | ||
| 947 | terminal emulator ([[#h:fbb5e254-afd6-4313-bb05-93b3b4f67358][More accurate colors in terminal emulators]]). If | ||
| 948 | ~flat~ and ~underline~ are defined together, the latter takes | ||
| 949 | precedence. | ||
| 950 | |||
| 951 | The symbol of a weight attribute adjusts the font of the button | ||
| 952 | accordingly, such as ~light~, ~semibold~, etc. Valid symbols are | ||
| 953 | defined in the variable ~modus-themes-weights~. | ||
| 954 | |||
| 955 | [[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. | ||
| 956 | |||
| 957 | A number, expressed as a floating point (e.g. =0.9=), adjusts the height | ||
| 958 | of the button's text to that many times the base font size. The default | ||
| 959 | height is the same as =1.0=, though it need not be explicitly stated. | ||
| 960 | Instead of a floating point, an acceptable value can be in the form of a | ||
| 961 | cons cell like =(height . FLOAT)= or =(height FLOAT)=, where FLOAT is | ||
| 962 | the given number. | ||
| 963 | |||
| 964 | The ~all-buttons~ property extends the box button effect (or the | ||
| 965 | aforementioned properties) to the faces of the generic widget library. | ||
| 966 | By default, those do not look like the buttons of the Custom UI as they | ||
| 967 | are ordinary text wrapped in square brackets. | ||
| 968 | |||
| 969 | Combinations of any of those properties are expressed as a list, | ||
| 970 | like in these examples: | ||
| 971 | |||
| 972 | #+begin_src emacs-lisp | ||
| 973 | (flat) | ||
| 974 | (variable-pitch flat) | ||
| 975 | (variable-pitch flat semibold 0.9) | ||
| 976 | (variable-pitch flat semibold (height 0.9)) ; same as above | ||
| 977 | (variable-pitch flat semibold (height . 0.9)) ; same as above | ||
| 978 | #+end_src | ||
| 979 | |||
| 980 | The order in which the properties are set is not significant. | ||
| 981 | |||
| 982 | In user configuration files the form may look like this: | ||
| 983 | |||
| 984 | #+begin_src emacs-lisp | ||
| 985 | (setq modus-themes-box-buttons '(variable-pitch flat 0.9)) | ||
| 986 | #+end_src | ||
| 987 | |||
| 988 | ** Option for command prompt styles | ||
| 989 | :properties: | ||
| 990 | :alt_title: Command prompts | ||
| 991 | :description: Choose among plain, subtle, or intense prompts | ||
| 992 | :custom_id: h:db5a9a7c-2928-4a28-b0f0-6f2b9bd52ba1 | ||
| 993 | :end: | ||
| 994 | #+vindex: modus-themes-prompts | ||
| 995 | |||
| 996 | Brief: Control the style of command prompts (e.g. minibuffer, shell, IRC | ||
| 997 | clients). | ||
| 998 | |||
| 999 | Symbol: ~modus-themes-prompts~ (=choice= type, list of properties) | ||
| 1000 | |||
| 1001 | Possible values are expressed as a list of properties (default is ~nil~ or | ||
| 1002 | an empty list). The list can include any of the following symbols: | ||
| 1003 | |||
| 1004 | + ~background~ | ||
| 1005 | + ~bold~ | ||
| 1006 | + ~gray~ | ||
| 1007 | + ~intense~ | ||
| 1008 | + ~italic~ | ||
| 1009 | 667 | ||
| 1010 | The default (a ~nil~ value or an empty list) means to only use a subtle | 668 | The default (a ~nil~ value or an empty list) means to only use a subtle |
| 1011 | accented foreground color. | 669 | colored foreground color. |
| 1012 | |||
| 1013 | The property ~background~ applies a background color to the prompt's text. | ||
| 1014 | By default, this is a subtle accented value. | ||
| 1015 | |||
| 1016 | The property ~intense~ makes the foreground color more prominent. If the | ||
| 1017 | ~background~ property is also set, it amplifies the value of the | ||
| 1018 | background as well. | ||
| 1019 | |||
| 1020 | The property ~gray~ changes the prompt's colors to grayscale. This | ||
| 1021 | affects the foreground and, if the ~background~ property is also set, the | ||
| 1022 | background. Its effect is subtle, unless it is combined with the | ||
| 1023 | ~intense~ property. | ||
| 1024 | |||
| 1025 | The property ~bold~ makes the text use a bold typographic weight. | ||
| 1026 | Similarly, ~italic~ adds a slant to the font's forms (italic or oblique | ||
| 1027 | forms, depending on the typeface). | ||
| 1028 | |||
| 1029 | Combinations of any of those properties are expressed as a list, like in | ||
| 1030 | these examples: | ||
| 1031 | |||
| 1032 | #+begin_src emacs-lisp | ||
| 1033 | (intense) | ||
| 1034 | (bold intense) | ||
| 1035 | (intense bold gray) | ||
| 1036 | (intense background gray bold) | ||
| 1037 | #+end_src | ||
| 1038 | |||
| 1039 | The order in which the properties are set is not significant. | ||
| 1040 | 670 | ||
| 1041 | In user configuration files the form may look like this: | 671 | The ~italic~ property adds a slant to the font's forms (italic or |
| 1042 | 672 | oblique forms, depending on the typeface). | |
| 1043 | #+begin_src emacs-lisp | ||
| 1044 | (setq modus-themes-prompts '(background gray)) | ||
| 1045 | #+end_src | ||
| 1046 | 673 | ||
| 1047 | ** Option for mode line presentation | 674 | The symbol of a font weight attribute such as ~light~, ~semibold~, et |
| 1048 | :properties: | 675 | cetera, adds the given weight to links. Valid symbols are defined in |
| 1049 | :alt_title: Mode line | 676 | the variable ~modus-themes-weights~. The absence of a weight means |
| 1050 | :description: Choose among several styles, with or without borders | 677 | that the one of the underlying text will be used. |
| 1051 | :custom_id: h:27943af6-d950-42d0-bc23-106e43f50a24 | ||
| 1052 | :end: | ||
| 1053 | #+vindex: modus-themes-mode-line | ||
| 1054 | |||
| 1055 | Brief: Control the style of the mode lines. | ||
| 1056 | |||
| 1057 | Symbol: ~modus-themes-mode-line~ (=choice= type, list of properties) | ||
| 1058 | |||
| 1059 | Possible values, which can be expressed as a list of combinations of box | ||
| 1060 | effect, color, and border visibility: | ||
| 1061 | |||
| 1062 | + Overall style: | ||
| 1063 | - ~3d~ | ||
| 1064 | - ~moody~ | ||
| 1065 | + ~accented~ | ||
| 1066 | + ~borderless~ | ||
| 1067 | + A natural number > 1 for extra padding or a cons cell in the form of | ||
| 1068 | ~(padding . NATNUM)~. | ||
| 1069 | + A floating point to set the height of the mode line's text. It can | ||
| 1070 | also be a cons cell in the form of ~(height . FLOAT)~. | ||
| 1071 | |||
| 1072 | The default (a ~nil~ value or an empty list) is a two-dimensional | ||
| 1073 | rectangle with a border around it. The active and the inactive mode | ||
| 1074 | lines use different shades of grayscale values for the background, | ||
| 1075 | foreground, border. | ||
| 1076 | |||
| 1077 | The ~3d~ property applies a three-dimensional effect to the active mode | ||
| 1078 | line. The inactive mode lines remain two-dimensional and are toned down | ||
| 1079 | a bit, relative to the default style. | ||
| 1080 | |||
| 1081 | The ~moody~ property optimizes the mode line for use with the library of | ||
| 1082 | the same name (hereinafter referred to as 'Moody'). In practice, it | ||
| 1083 | removes the box effect and replaces it with underline and overline | ||
| 1084 | properties. It also tones down the inactive mode lines. Despite its | ||
| 1085 | intended purpose, this option can also be used without the Moody library | ||
| 1086 | (please consult the themes' manual on this point for more details). If | ||
| 1087 | both ~3d~ and ~moody~ properties are set, the latter takes precedence. | ||
| 1088 | |||
| 1089 | The ~borderless~ property removes the color of the borders. It does not | ||
| 1090 | actually remove the borders, but only makes their color the same as the | ||
| 1091 | background, effectively creating some padding. | ||
| 1092 | |||
| 1093 | The ~accented~ property ensures that the active mode line uses a colored | ||
| 1094 | background instead of the standard shade of gray. | ||
| 1095 | |||
| 1096 | A positive integer (natural number or natnum) applies a padding effect | ||
| 1097 | of NATNUM pixels at the boundaries of the mode lines. The default value | ||
| 1098 | is 1 and does not need to be specified explicitly. The padding has no | ||
| 1099 | effect when the ~moody~ property is also used, because Moody already | ||
| 1100 | applies its own tweaks. To ensure that the underline is placed at the | ||
| 1101 | bottom of the mode line, set ~x-underline-at-descent-line~ to non-~nil~ | ||
| 1102 | (this is not needed when the ~borderless~ property is also set). For | ||
| 1103 | users on Emacs 29, the ~x-use-underline-position-properties~ variable must | ||
| 1104 | also be set to nil. | ||
| 1105 | |||
| 1106 | The padding can also be expressed as a cons cell in the form of | ||
| 1107 | =(padding . NATNUM)= or =(padding NATNUM)= where the key is constant and | ||
| 1108 | NATNUM is the desired natural number. | ||
| 1109 | |||
| 1110 | A floating point applies an adjusted height to the mode line's text as a | ||
| 1111 | multiple of the main font size. The default rate is 1.0 and does not | ||
| 1112 | need to be specified. Apart from a floating point, the height may also | ||
| 1113 | be expressed as a cons cell in the form of =(height . FLOAT)= or | ||
| 1114 | =(height FLOAT)= where the key is constant and the FLOAT is the desired | ||
| 1115 | number. | ||
| 1116 | 678 | ||
| 1117 | Combinations of any of those properties are expressed as a list, like in | 679 | Combinations of any of those properties are expressed as a list, like in |
| 1118 | these examples: | 680 | these examples: |
| 1119 | 681 | ||
| 1120 | #+begin_src emacs-lisp | 682 | #+begin_src emacs-lisp |
| 1121 | (accented) | 683 | (bold italic) |
| 1122 | (borderless 3d) | 684 | (italic semibold) |
| 1123 | (moody accented borderless) | ||
| 1124 | #+end_src | ||
| 1125 | |||
| 1126 | Same as above, using the padding and height as an example (these | ||
| 1127 | all yield the same result): | ||
| 1128 | |||
| 1129 | #+begin_src emacs-lisp | ||
| 1130 | (accented borderless 4 0.9) | ||
| 1131 | (accented borderless (padding . 4) (height . 0.9)) | ||
| 1132 | (accented borderless (padding 4) (height 0.9)) | ||
| 1133 | #+end_src | 685 | #+end_src |
| 1134 | 686 | ||
| 1135 | The order in which the properties are set is not significant. | 687 | The order in which the properties are set is not significant. |
| @@ -1137,57 +689,10 @@ The order in which the properties are set is not significant. | |||
| 1137 | In user configuration files the form may look like this: | 689 | In user configuration files the form may look like this: |
| 1138 | 690 | ||
| 1139 | #+begin_src emacs-lisp | 691 | #+begin_src emacs-lisp |
| 1140 | (setq modus-themes-mode-line '(borderless accented)) | 692 | (setq modus-themes-prompts '(extrabold italic)) |
| 1141 | #+end_src | 693 | #+end_src |
| 1142 | 694 | ||
| 1143 | Note that Moody does not expose any faces that the themes could style | 695 | [[#h:bd75b43a-0bf1-45e7-b8b4-20944ca8b7f8][Make prompts more or less colorful]]. |
| 1144 | directly. Instead it re-purposes existing ones to render its tabs and | ||
| 1145 | ribbons. As such, there may be cases where the contrast ratio falls | ||
| 1146 | below the 7:1 target that the themes conform with (WCAG AAA). To hedge | ||
| 1147 | against this, we configure a fallback foreground for the ~moody~ property, | ||
| 1148 | which will come into effect when the background of the mode line changes | ||
| 1149 | to something less accessible, such as Moody ribbons (read the doc string | ||
| 1150 | of ~set-face-attribute~, specifically ~:distant-foreground~). This fallback | ||
| 1151 | is activated when Emacs determines that the background and foreground of | ||
| 1152 | the given construct are too close to each other in terms of color | ||
| 1153 | distance. In practice, users will need to experiment with the variable | ||
| 1154 | ~face-near-same-color-threshold~ to trigger the effect. We find that a | ||
| 1155 | value of =45000= shall suffice, contrary to the default =30000=. Though for | ||
| 1156 | the combinations that involve the ~accented~ and ~moody~ properties, as | ||
| 1157 | mentioned above, that should be raised up to =70000=. Do not set it too | ||
| 1158 | high, because it has the adverse effect of always overriding the default | ||
| 1159 | colors (which have been carefully designed to be highly accessible). | ||
| 1160 | |||
| 1161 | Furthermore, because Moody expects an underline and overline instead of | ||
| 1162 | a box style, it is strongly advised to set ~x-underline-at-descent-line~ | ||
| 1163 | to a non-~nil~ value. | ||
| 1164 | |||
| 1165 | Finally, note that various packages which heavily modify the mode line, | ||
| 1166 | such as =doom-modeline=, =nano-modeline=, =powerline=, =spaceline= may not look | ||
| 1167 | as intended with all possible combinations of this user option. | ||
| 1168 | |||
| 1169 | ** Option for accented background in tab interfaces | ||
| 1170 | :properties: | ||
| 1171 | :alt_title: Tab style | ||
| 1172 | :description: Toggle accented background for tabs | ||
| 1173 | :custom_id: h:27cef8f5-dc4e-4c93-ba41-b899e650d936 | ||
| 1174 | :end: | ||
| 1175 | #+vindex: modus-themes-tabs-accented | ||
| 1176 | |||
| 1177 | Brief: Toggle accent colors for tabbed interfaces. | ||
| 1178 | |||
| 1179 | Symbol: ~modus-themes-tabs-accented~ (=boolean= type) | ||
| 1180 | |||
| 1181 | Possible values: | ||
| 1182 | |||
| 1183 | + ~nil~ (default) | ||
| 1184 | + ~t~ | ||
| 1185 | |||
| 1186 | By default, all tab interfaces use backgrounds which are shades of gray. | ||
| 1187 | When this option is set to non-~nil~, the backgrounds become colorful. | ||
| 1188 | |||
| 1189 | This affects the built-in ~tab-bar-mode~ and ~tab-line-mode~, as well as the | ||
| 1190 | Centaur tabs package. | ||
| 1191 | 696 | ||
| 1192 | ** Option for completion framework aesthetics | 697 | ** Option for completion framework aesthetics |
| 1193 | :properties: | 698 | :properties: |
| @@ -1201,204 +706,194 @@ Brief: Set the overall style of completion framework interfaces. | |||
| 1201 | 706 | ||
| 1202 | Symbol: ~modus-themes-completions~ (=alist= type properties) | 707 | Symbol: ~modus-themes-completions~ (=alist= type properties) |
| 1203 | 708 | ||
| 1204 | This affects Company, Corfu, Flx, Helm, Icomplete/Fido, Ido, Ivy, | 709 | This affects Company, Corfu, Flx, Icomplete/Fido, Ido, Ivy, Orderless, |
| 1205 | Orderless, Selectrum, Vertico. The value is an alist that takes the | 710 | Vertico. The value is an alist of expressions, each of which takes |
| 1206 | form of a =(KEY . PROPERTIES)= combination. =KEY= is a symbol, while | 711 | the form of =(KEY . LIST-OF-PROPERTIES)=. =KEY= is a symbol, while |
| 1207 | =PROPERTIES= is a list. Here is a sample, followed by a description | 712 | =PROPERTIES= is a list. Here is a sample, followed by a description |
| 1208 | of the particularities: | 713 | of the particularities: |
| 1209 | 714 | ||
| 1210 | #+begin_src emacs-lisp | 715 | #+begin_src emacs-lisp |
| 1211 | (setq modus-themes-completions | 716 | (setq modus-themes-completions |
| 1212 | '((matches . (extrabold background intense)) | 717 | '((matches . (extrabold background)) |
| 1213 | (selection . (semibold accented intense)) | 718 | (selection . (semibold italic)))) |
| 1214 | (popup . (accented)))) | ||
| 1215 | #+end_src | 719 | #+end_src |
| 1216 | 720 | ||
| 1217 | The ~matches~ key refers to the highlighted characters that correspond | 721 | The ~matches~ key refers to the highlighted characters that correspond |
| 1218 | to the user's input. When its properties are ~nil~ or an empty list, | 722 | to the user's input. When its properties are nil or an empty list, |
| 1219 | matching characters in the user interface will have a bold weight and | 723 | matching characters in the user interface will have a bold weight and |
| 1220 | a colored foreground. The list of properties may include any of the | 724 | a colored foreground. The list of properties may include any of the |
| 1221 | following symbols regardless of the order they may appear in: | 725 | following symbols regardless of the order they may appear in: |
| 1222 | 726 | ||
| 1223 | - ~background~ to add a background color; | ||
| 1224 | |||
| 1225 | - ~intense~ to increase the overall coloration (also amplifies | ||
| 1226 | the ~background~, if present); | ||
| 1227 | |||
| 1228 | - ~underline~ to draw a line below the characters; | 727 | - ~underline~ to draw a line below the characters; |
| 1229 | 728 | ||
| 1230 | - ~italic~ to use a slanted font (italic or oblique forms); | 729 | - ~italic~ to use a slanted font (italic or oblique forms); |
| 1231 | 730 | ||
| 1232 | - The symbol of a font weight attribute such as ~light~, ~semibold~, et | 731 | - The symbol of a font weight attribute such as ~light~, |
| 1233 | cetera. Valid symbols are defined in the ~modus-themes-weights~ | 732 | ~semibold~, et cetera. Valid symbols are defined in the |
| 1234 | variable. The absence of a weight means that bold will be used. | 733 | variable ~modus-themes-weights~. The absence of a weight means |
| 734 | that bold will be used. | ||
| 1235 | 735 | ||
| 1236 | The ~selection~ key applies to the current line or currently matched | 736 | The ~selection~ key applies to the current line or currently matched |
| 1237 | candidate, depending on the specifics of the user interface. When its | 737 | candidate, depending on the specifics of the user interface. When its |
| 1238 | properties are ~nil~ or an empty list, it has a subtle gray background, | 738 | properties are nil or an empty list, it has a subtle gray background, |
| 1239 | a bold weight, and the base foreground value for the text. The list | 739 | a bold weight, and the base foreground value for the text. The list |
| 1240 | of properties it accepts is as follows (order is not significant): | 740 | of properties it accepts is as follows (order is not significant): |
| 1241 | 741 | ||
| 1242 | - ~accented~ to make the background colorful instead of gray; | ||
| 1243 | |||
| 1244 | - ~text-also~ to apply extra color to the text of the selected line; | ||
| 1245 | |||
| 1246 | - ~intense~ to increase the overall coloration; | ||
| 1247 | |||
| 1248 | - ~underline~ to draw a line below the characters; | 742 | - ~underline~ to draw a line below the characters; |
| 1249 | 743 | ||
| 1250 | - ~italic~ to use a slanted font (italic or oblique forms); | 744 | - ~italic~ to use a slanted font (italic or oblique forms); |
| 1251 | 745 | ||
| 1252 | - The symbol of a font weight attribute such as ~light~, ~semibold~, et | 746 | - The symbol of a font weight attribute such as ~light~, |
| 1253 | cetera. Valid symbols are defined in the ~modus-themes-weights~ | 747 | ~semibold~, et cetera. Valid symbols are defined in the |
| 1254 | variable. The absence of a weight means that bold will be used. | 748 | variable ~modus-themes-weights~. The absence of a weight means |
| 749 | that bold will be used. | ||
| 1255 | 750 | ||
| 1256 | The ~popup~ key takes the same values as ~selection~. The only | 751 | Apart from specifying each key separately, a catch-all list is |
| 1257 | difference is that it applies specifically to user interfaces that | 752 | accepted. This is only useful when the desired aesthetic is the same |
| 1258 | display an inline popup and thus have slightly different styling | 753 | across all keys that are not explicitly referenced. For example, |
| 1259 | requirements than the minibuffer. The two prominent packages are | 754 | this: |
| 1260 | =company= and =corfu=. | ||
| 1261 | |||
| 1262 | Apart from specifying each key separately, a fallback list is accepted. | ||
| 1263 | This is only useful when the desired aesthetic is the same across all | ||
| 1264 | keys that are not explicitly referenced. For example, this: | ||
| 1265 | 755 | ||
| 1266 | #+begin_src emacs-lisp | 756 | #+begin_src emacs-lisp |
| 1267 | (setq modus-themes-completions | 757 | (setq modus-themes-completions |
| 1268 | '((t . (extrabold intense)))) | 758 | '((t . (extrabold underline)))) |
| 1269 | #+end_src | 759 | #+end_src |
| 1270 | 760 | ||
| 1271 | Is the same as: | 761 | Is the same as: |
| 1272 | 762 | ||
| 1273 | #+begin_src emacs-lisp | 763 | #+begin_src emacs-lisp |
| 1274 | (setq modus-themes-completions | 764 | (setq modus-themes-completions |
| 1275 | '((matches . (extrabold intense)) | 765 | '((matches . (extrabold underline)) |
| 1276 | (selection . (extrabold intense)) | 766 | (selection . (extrabold underline)))) |
| 1277 | (popup . (extrabold intense)))) | ||
| 1278 | #+end_src | 767 | #+end_src |
| 1279 | 768 | ||
| 1280 | In the case of the fallback, any property that does not apply to the | 769 | [[#h:d959f789-0517-4636-8780-18123f936f91][Make completion matches more or less colorful]]. |
| 1281 | corresponding key is simply ignored (~matches~ does not have ~accented~ | ||
| 1282 | and ~text-also~, while ~selection~ and ~popup~ do not have | ||
| 1283 | ~background~). | ||
| 1284 | 770 | ||
| 1285 | [[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. | 771 | ** Option for org-mode block styles |
| 1286 | |||
| 1287 | Also refer to the documentation of the ~orderless~ package for its | ||
| 1288 | intersection with ~company~ (if you choose to use those in tandem). | ||
| 1289 | |||
| 1290 | ** Option for mail citations | ||
| 1291 | :properties: | 772 | :properties: |
| 1292 | :alt_title: Mail citations | 773 | :alt_title: Org mode blocks |
| 1293 | :description: Choose among colorful, desaturated, monochrome citations | 774 | :description: Choose among plain, gray, or tinted backgrounds |
| 1294 | :custom_id: h:5a12765d-0ba0-4a75-ab11-e35d3bbb317d | 775 | :custom_id: h:b7e328c0-3034-4db7-9cdf-d5ba12081ca2 |
| 1295 | :end: | 776 | :end: |
| 1296 | #+vindex: modus-themes-mail-citations | 777 | #+vindex: modus-themes-org-blocks |
| 1297 | 778 | ||
| 1298 | Brief: Set the overall style of citations/quotes when composing | 779 | Brief: Set the overall style of Org code blocks, quotes, and the like. |
| 1299 | emails. | ||
| 1300 | 780 | ||
| 1301 | Symbol: ~modus-themes-mail-citations~ (=choice= type) | 781 | Symbol: ~modus-themes-org-blocks~ (=choice= type) |
| 1302 | 782 | ||
| 1303 | Possible values: | 783 | Possible values: |
| 1304 | 784 | ||
| 1305 | 1. ~nil~ (default) | 785 | 1. ~nil~ (default) |
| 1306 | 2. ~intense~ | 786 | 2. ~gray-background~ |
| 1307 | 3. ~faint~ | 787 | 3. ~tinted-background~ |
| 1308 | 4. ~monochrome~ | ||
| 1309 | |||
| 1310 | By default (a ~nil~ value) citations are styled with contrasting hues to | ||
| 1311 | denote their depth. Colors are easy to tell apart because they | ||
| 1312 | complement each other, but they otherwise are not very prominent. | ||
| 1313 | 788 | ||
| 1314 | Option ~intense~ is similar to the default in terms of using contrasting | 789 | Nil (the default) means that the block has no background of its own: |
| 1315 | and complementary hues, but applies more saturated colors. | 790 | it uses the one that applies to the rest of the buffer. In this case, |
| 1316 | 791 | the delimiter lines have a gray color for their text, making them look | |
| 1317 | Option ~faint~ maintains the same color-based distinction between citation | 792 | exactly like all other Org properties. |
| 1318 | levels though the colors it uses have subtle differences between them. | ||
| 1319 | 793 | ||
| 1320 | Option ~monochrome~ turns all quotes into a shade of gray. | 794 | Option ~gray-background~ applies a subtle gray background to the |
| 795 | block's contents. It also affects the begin and end lines of the | ||
| 796 | block as they get another shade of gray as their background, which | ||
| 797 | differentiates them from the contents of the block. All background | ||
| 798 | colors extend to the edge of the window, giving the area a | ||
| 799 | rectangular, "blocky" presentation. If the begin/end lines do not | ||
| 800 | extend in this way, check the value of the Org user option | ||
| 801 | ~org-fontify-whole-block-delimiter-line~. | ||
| 802 | |||
| 803 | Option ~tinted-background~ uses a colored background for the contents | ||
| 804 | of the block. The exact color value will depend on the programming | ||
| 805 | language and is controlled by the variable ~org-src-block-faces~ | ||
| 806 | (refer to the theme's source code for the current association list). | ||
| 807 | For this to take effect, the Org buffer needs to be restarted with | ||
| 808 | ~org-mode-restart~. | ||
| 809 | |||
| 810 | Code blocks use their major mode's fontification (syntax highlighting) | ||
| 811 | only when the variable ~org-src-fontify-natively~ is non-nil. While | ||
| 812 | quote/verse blocks require setting | ||
| 813 | ~org-fontify-quote-and-verse-blocks~ to a non-nil value. | ||
| 1321 | 814 | ||
| 1322 | Whatever the value assigned to this variable, citations in emails are | 815 | [[#h:f44cc6e3-b0f1-4a5e-8a90-9e48fa557b50][Update Org block delimiter fontification]]. |
| 1323 | controlled by typographic elements or indentation, which the themes do | ||
| 1324 | not touch. | ||
| 1325 | 816 | ||
| 1326 | ** Option for fringe visibility | 817 | ** Option for the headings' overall style |
| 1327 | :properties: | 818 | :properties: |
| 1328 | :alt_title: Fringes | 819 | :alt_title: Heading styles |
| 1329 | :description: Choose among invisible, subtle, or intense fringe styles | 820 | :description: Choose among several styles, also per heading level |
| 1330 | :custom_id: h:1983c3fc-74f6-44f3-b917-967c403bebae | 821 | :custom_id: h:271eff19-97aa-4090-9415-a6463c2f9ae1 |
| 1331 | :end: | 822 | :end: |
| 1332 | #+vindex: modus-themes-fringes | 823 | #+vindex: modus-themes-headings |
| 1333 | |||
| 1334 | Brief: Control the overall coloration of the fringes. | ||
| 1335 | |||
| 1336 | Symbol: ~modus-themes-fringes~ (=choice= type) | ||
| 1337 | |||
| 1338 | Possible values: | ||
| 1339 | |||
| 1340 | 1. ~nil~ | ||
| 1341 | 2. ~subtle~ | ||
| 1342 | 3. ~intense~ | ||
| 1343 | 824 | ||
| 1344 | When the value is nil, do not apply a distinct background color. | 825 | Brief: Heading styles with optional list of values per heading level. |
| 1345 | 826 | ||
| 1346 | With a value of ~subtle~ use a gray background color that is | 827 | Symbol: ~modus-themes-headings~ (=alist= type, multiple properties) |
| 1347 | visible yet close to the main background color. | ||
| 1348 | 828 | ||
| 1349 | With ~intense~ use a more pronounced gray background color. | 829 | This is an alist that accepts a =(KEY . LIST-OF-VALUES)= combination. |
| 830 | The =KEY= is either a number, representing the heading's level (0 | ||
| 831 | through 8) or ~t~, which pertains to the fallback style. The named | ||
| 832 | keys =agenda-date= and =agenda-structure= apply to the Org agenda. | ||
| 1350 | 833 | ||
| 1351 | ** Option for language checkers | 834 | Level 0 is a special heading: it is used for what counts as a document |
| 1352 | :properties: | 835 | title or equivalent, such as the =#+title= construct we find in Org |
| 1353 | :alt_title: Language checkers | 836 | files. Levels 1-8 are regular headings. |
| 1354 | :description: Control the style of language checkers/linters | ||
| 1355 | :custom_id: h:4b13743a-8ebf-4d2c-a043-cceba10b1eb4 | ||
| 1356 | :end: | ||
| 1357 | #+vindex: modus-themes-lang-checkers | ||
| 1358 | |||
| 1359 | Brief: Control the style of in-buffer warnings and errors produced by | ||
| 1360 | spell checkers, code linters, and the like. | ||
| 1361 | 837 | ||
| 1362 | Symbol: ~modus-themes-lang-checkers~ (=choice= type, list of properties) | 838 | The =LIST-OF-VALUES= covers symbols that refer to properties, as |
| 839 | described below. Here is a complete sample with various stylistic | ||
| 840 | combinations, followed by a presentation of all available properties: | ||
| 1363 | 841 | ||
| 1364 | Possible values are expressed as a list of properties (default is ~nil~ or | 842 | #+begin_src emacs-lisp |
| 1365 | an empty list). The list can include any of the following symbols: | 843 | (setq modus-themes-headings |
| 844 | '((1 . (variable-pitch 1.5)) | ||
| 845 | (2 . (1.3)) | ||
| 846 | (agenda-date . (1.3)) | ||
| 847 | (agenda-structure . (variable-pitch light 1.8)) | ||
| 848 | (t . (1.1)))) | ||
| 849 | #+end_src | ||
| 1366 | 850 | ||
| 1367 | + ~straight-underline~ | 851 | Properties: |
| 1368 | + ~text-also~ | ||
| 1369 | + ~background~ | ||
| 1370 | + Overall coloration: | ||
| 1371 | - ~intense~ | ||
| 1372 | - ~faint~ | ||
| 1373 | 852 | ||
| 1374 | The default (a ~nil~ value or an empty list) applies a color-coded | 853 | + A font weight, which must be supported by the underlying typeface: |
| 1375 | underline to the affected text, while it leaves the original foreground | 854 | - ~thin~ |
| 1376 | intact. If the display spec of Emacs has support for it, the | 855 | - ~ultralight~ |
| 1377 | underline's style is that of a wave, otherwise it is a straight line. | 856 | - ~extralight~ |
| 857 | - ~light~ | ||
| 858 | - ~semilight~ | ||
| 859 | - ~regular~ | ||
| 860 | - ~medium~ | ||
| 861 | - ~semibold~ | ||
| 862 | - ~bold~ (default) | ||
| 863 | - ~heavy~ | ||
| 864 | - ~extrabold~ | ||
| 865 | - ~ultrabold~ | ||
| 866 | + A floating point as a height multiple of the default or a cons cell in | ||
| 867 | the form of =(height . FLOAT)=. | ||
| 1378 | 868 | ||
| 1379 | The property ~straight-underline~ ensures that the underline under the | 869 | By default (a ~nil~ value for this variable), all headings have a bold |
| 1380 | affected text is always drawn as a straight line. | 870 | typographic weight and use a desaturated text color. |
| 1381 | 871 | ||
| 1382 | The property ~text-also~ applies the same color of the underline to the | 872 | A ~variable-pitch~ property changes the font family of the heading to that |
| 1383 | affected text. | 873 | of the ~variable-pitch~ face (normally a proportionately spaced typeface). |
| 1384 | 874 | ||
| 1385 | The property ~background~ adds a color-coded background. | 875 | The symbol of a weight attribute adjusts the font of the heading |
| 876 | accordingly, such as ~light~, ~semibold~, etc. Valid symbols are | ||
| 877 | defined in the variable ~modus-themes-weights~. The absence of a weight | ||
| 878 | means that bold will be used by virtue of inheriting the ~bold~ face. | ||
| 1386 | 879 | ||
| 1387 | The property ~intense~ amplifies the applicable colors if ~background~ | 880 | [[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. |
| 1388 | and/or ~text-also~ are set. If ~intense~ is set on its own, then it implies | ||
| 1389 | ~text-also~. | ||
| 1390 | 881 | ||
| 1391 | The property ~faint~ uses nuanced colors for the underline and for the | 882 | A number, expressed as a floating point (e.g. 1.5), adjusts the height |
| 1392 | foreground when ~text-also~ is included. If both ~faint~ and ~intense~ are | 883 | of the heading to that many times the base font size. The default |
| 1393 | specified, the former takes precedence. | 884 | height is the same as 1.0, though it need not be explicitly stated. |
| 885 | Instead of a floating point, an acceptable value can be in the form of a | ||
| 886 | cons cell like =(height . FLOAT)= or =(height FLOAT)=, where FLOAT is | ||
| 887 | the given number. | ||
| 1394 | 888 | ||
| 1395 | Combinations of any of those properties can be expressed in a list, as | 889 | Combinations of any of those properties are expressed as a list, like in |
| 1396 | in those examples: | 890 | these examples: |
| 1397 | 891 | ||
| 1398 | #+begin_src emacs-lisp | 892 | #+begin_src emacs-lisp |
| 1399 | (background) | 893 | (semibold) |
| 1400 | (straight-underline intense) | 894 | (variable-pitch semibold 1.3) |
| 1401 | (background text-also straight-underline) | 895 | (variable-pitch semibold (height 1.3)) ; same as above |
| 896 | (variable-pitch semibold (height . 1.3)) ; same as above | ||
| 1402 | #+end_src | 897 | #+end_src |
| 1403 | 898 | ||
| 1404 | The order in which the properties are set is not significant. | 899 | The order in which the properties are set is not significant. |
| @@ -1406,752 +901,1230 @@ The order in which the properties are set is not significant. | |||
| 1406 | In user configuration files the form may look like this: | 901 | In user configuration files the form may look like this: |
| 1407 | 902 | ||
| 1408 | #+begin_src emacs-lisp | 903 | #+begin_src emacs-lisp |
| 1409 | (setq modus-themes-lang-checkers '(text-also background)) | 904 | (setq modus-themes-headings |
| 905 | '((1 . (variable-pitch 1.5)) | ||
| 906 | (2 . (1.3)) | ||
| 907 | (agenda-date . (1.3)) | ||
| 908 | (agenda-structure . (variable-pitch light 1.8)) | ||
| 909 | (t . (1.1)))) | ||
| 1410 | #+end_src | 910 | #+end_src |
| 1411 | 911 | ||
| 1412 | NOTE: The placement of the straight underline, though not the wave | 912 | When defining the styles per heading level, it is possible to pass a |
| 1413 | style, is controlled by the built-in variables ~underline-minimum-offset~, | 913 | non-~nil~ value (~t~) instead of a list of properties. This will retain the |
| 1414 | ~x-underline-at-descent-line~, ~x-use-underline-position-properties~. | 914 | original aesthetic for that level. For example: |
| 1415 | |||
| 1416 | To disable fringe indicators for Flymake or Flycheck, refer to variables | ||
| 1417 | ~flymake-fringe-indicator-position~ and ~flycheck-indication-mode~, | ||
| 1418 | respectively. | ||
| 1419 | |||
| 1420 | ** Option for line highlighting | ||
| 1421 | :properties: | ||
| 1422 | :alt_title: Line highlighting | ||
| 1423 | :description: Choose style of current line (hl-line-mode) | ||
| 1424 | :custom_id: h:1dba1cfe-d079-4c13-a810-f768e8789177 | ||
| 1425 | :end: | ||
| 1426 | #+vindex: modus-themes-hl-line | ||
| 1427 | |||
| 1428 | Brief: Control the style of the current line of ~hl-line-mode~. | ||
| 1429 | |||
| 1430 | Symbol: ~modus-themes-hl-line~ (=choice= type, list of properties) | ||
| 1431 | |||
| 1432 | The value is a list of properties, each designated by a symbol. With | ||
| 1433 | a ~nil~ value, or an empty list, the style is a subtle gray background | ||
| 1434 | color. | ||
| 1435 | |||
| 1436 | Possible properties are the following symbols: | ||
| 1437 | |||
| 1438 | + ~accented~ | ||
| 1439 | + ~intense~ | ||
| 1440 | + ~underline~ | ||
| 1441 | |||
| 1442 | The property ~accented~ changes the background to a colored variant. | ||
| 1443 | |||
| 1444 | An ~underline~ property draws a line below the highlighted area. Its | ||
| 1445 | color is similar to the background, so gray by default or an accent | ||
| 1446 | color when ~accented~ is also set. | ||
| 1447 | |||
| 1448 | An ~intense~ property amplifies the colors in use, which may be both the | ||
| 1449 | background and the underline. | ||
| 1450 | |||
| 1451 | Combinations of any of those properties are expressed as a list, like in | ||
| 1452 | these examples: | ||
| 1453 | 915 | ||
| 1454 | #+begin_src emacs-lisp | 916 | #+begin_src emacs-lisp |
| 1455 | (intense) | 917 | (setq modus-themes-headings |
| 1456 | (underline intense) | 918 | '((1 . t) ; keep the default style |
| 1457 | (accented intense underline) | 919 | (2 . (semibold 1.2)) |
| 1458 | #+end_src | 920 | (t . (rainbow)))) ; style for all other headings |
| 1459 | |||
| 1460 | The order in which the properties are set is not significant. | ||
| 1461 | |||
| 1462 | In user configuration files the form may look like this: | ||
| 1463 | 921 | ||
| 1464 | #+begin_src emacs-lisp | 922 | (setq modus-themes-headings |
| 1465 | (setq modus-themes-hl-line '(underline accented)) | 923 | '((1 . (variable-pitch 1.5)) |
| 924 | (2 . (semibold)) | ||
| 925 | (t . t))) ; default style for all other levels | ||
| 1466 | #+end_src | 926 | #+end_src |
| 1467 | 927 | ||
| 1468 | Set ~x-underline-at-descent-line~ to a non-~nil~ value so that the | 928 | Note that the text color of headings, of their background, and |
| 1469 | placement of the underline coincides with the lower boundary of the | 929 | overline can all be set via the overrides. It is possible to have any |
| 1470 | colored background. | 930 | color combination for any heading level (something that could not be |
| 931 | done in older versions of the themes). | ||
| 1471 | 932 | ||
| 1472 | This style affects several packages that enable ~hl-line-mode~, such as | 933 | [[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]. |
| 1473 | =elfeed=, =notmuch=, and =mu4e=. | ||
| 1474 | 934 | ||
| 1475 | [ Also check the =lin= package on GNU ELPA (by the author of the | 935 | [[#h:11297984-85ea-4678-abe9-a73aeab4676a][Make headings more or less colorful]]. |
| 1476 | modus-themes) for a stylistic enhancement to ~hl-line-mode~. ] | ||
| 1477 | 936 | ||
| 1478 | ** Option for line numbers | 937 | ** Option for variable-pitch font in UI elements |
| 1479 | :properties: | 938 | :properties: |
| 1480 | :alt_title: Line numbers | 939 | :alt_title: UI typeface |
| 1481 | :description: Toggle subtle style for line numbers | 940 | :description: Toggle the use of variable-pitch across the User Interface |
| 1482 | :custom_id: h:8c4a6230-2e43-4aa2-a631-3b7179392e09 | 941 | :custom_id: h:16cf666c-5e65-424c-a855-7ea8a4a1fcac |
| 1483 | :end: | 942 | :end: |
| 1484 | #+vindex: modus-themes-subtle-line-numbers | 943 | #+vindex: modus-themes-variable-pitch-ui |
| 1485 | 944 | ||
| 1486 | Brief: Toggle subtle line numbers. | 945 | Brief: Toggle the use of proportionately spaced (~variable-pitch~) fonts |
| 946 | in the User Interface. | ||
| 1487 | 947 | ||
| 1488 | Symbol: ~modus-themes-subtle-line-numbers~ (=boolean= type) | 948 | Symbol: ~modus-themes-variable-pitch-ui~ (=boolean= type) |
| 1489 | 949 | ||
| 1490 | Possible value: | 950 | Possible values: |
| 1491 | 951 | ||
| 1492 | 1. ~nil~ (default) | 952 | 1. ~nil~ (default) |
| 1493 | 2. ~t~ | 953 | 2. ~t~ |
| 1494 | 954 | ||
| 1495 | The default style for ~display-line-numbers-mode~ and its global variant | 955 | This option concerns User Interface elements that are under the direct |
| 1496 | is to apply a subtle gray background to the line numbers. The current | 956 | control of Emacs. In particular: the mode line, header line, tab bar, |
| 1497 | line has a more pronounced background and foreground combination to | 957 | and tab line. |
| 1498 | bring more attention to itself. | 958 | |
| 959 | The default is to use the same font as the rest of Emacs, which usually | ||
| 960 | is a monospaced family. | ||
| 1499 | 961 | ||
| 1500 | Similarly, the faces for ~display-line-numbers-major-tick~ and its | 962 | With a non-~nil~ value (~t~) apply a proportionately spaced typeface. This |
| 1501 | counterpart ~display-line-numbers-minor-tick~ use appropriate styles that | 963 | is done by assigning the ~variable-pitch~ face to the relevant items. |
| 1502 | involve a bespoke background and foreground combination. | ||
| 1503 | 964 | ||
| 1504 | With a non-~nil~ value (~t~), line numbers have no background of their own. | 965 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. |
| 1505 | Instead they retain the primary background of the theme, blending with | ||
| 1506 | the rest of the buffer. Foreground values for all relevant faces are | ||
| 1507 | updated to accommodate this aesthetic. | ||
| 1508 | 966 | ||
| 1509 | ** Option for mouseover effects | 967 | ** Option for palette overrides |
| 1510 | :properties: | 968 | :properties: |
| 1511 | :alt_title: Mouse hover effects | 969 | :alt_title: Palette overrides |
| 1512 | :description: Toggle intense style for mouseover highlights | 970 | :description: Refashion color values and/or semantic color mappings |
| 1513 | :custom_id: h:9b869620-fcc5-4b5f-9ab8-225d73b7f22f | 971 | :custom_id: h:34c7a691-19bb-4037-8d2f-67a07edab150 |
| 1514 | :end: | 972 | :end: |
| 1515 | #+vindex: modus-themes-intense-mouseovers | ||
| 1516 | 973 | ||
| 1517 | Brief: Toggle intense mouse hover effects. | 974 | This section describes palette overrides in detail. For a simpler |
| 975 | alternative, use the presets we provide ([[#h:b0bc811c-227e-42ec-bf67-15e1f41eb7bc][Palette override presets]]). | ||
| 1518 | 976 | ||
| 1519 | Symbol: ~modus-themes-intense-mouseovers~ (=boolean= type) | 977 | Each Modus theme specifies a color palette that declares named color |
| 978 | values and semantic color mappings: | ||
| 1520 | 979 | ||
| 1521 | Possible value: | 980 | + Named colors consist of a symbol and a string that specifies a |
| 981 | hexadecimal RGB value. For example: =(blue-warmer "#354fcf")=. | ||
| 1522 | 982 | ||
| 1523 | 1. ~nil~ (default) | 983 | + The semantic color mappings associate an abstract construct with a |
| 1524 | 2. ~t~ | 984 | given named color from the palette, like =(heading-2 yellow-faint)=. |
| 985 | Both elements of the list are symbols, though the ~cadr~ (value) can | ||
| 986 | be a string that specifies a color, such as =(heading-2 "#354fcf")=. | ||
| 987 | Semantic color mappings cannot be recursive: their value must be | ||
| 988 | either a named color or a hexadecimal RGB value. | ||
| 1525 | 989 | ||
| 1526 | By default all mouseover effects apply a highlight with a subtle colored | 990 | #+vindex: modus-themes-common-palette-overrides |
| 1527 | background. When non-~nil~, these have a more pronounced effect. | 991 | Both of those subsets can be overridden, thus refashioning the theme. |
| 992 | Overrides are either shared, by being stored in the user option | ||
| 993 | ~modus-themes-common-palette-overrides~, or they are specific to the | ||
| 994 | theme they name. In the latter case, the naming scheme of each | ||
| 995 | palette variable is =THEME-NAME-palette-overrides=, thus yielding: | ||
| 1528 | 996 | ||
| 1529 | Note that this affects the generic ~highlight~ which, strictly speaking, | 997 | #+vindex: modus-operandi-palette-overrides |
| 1530 | is not limited to mouse usage. | 998 | + ~modus-operandi-palette-overrides~ |
| 1531 | 999 | ||
| 1532 | ** Option for markup style in Org and others | 1000 | #+vindex: modus-operandi-deuteranopia-palette-overrides |
| 1533 | :properties: | 1001 | + ~modus-operandi-deuteranopia-palette-overrides~ |
| 1534 | :alt_title: Markup | ||
| 1535 | :description: Choose style for markup in Org and others | ||
| 1536 | :custom_id: h:9d9a4e64-99ac-4018-8f66-3051b9c43fd7 | ||
| 1537 | :end: | ||
| 1538 | #+vindex: modus-themes-markup | ||
| 1539 | 1002 | ||
| 1540 | Brief: Choose style of markup in Org, Markdown, and others (affects | 1003 | #+vindex: modus-operandi-tinted-palette-overrides |
| 1541 | constructs such as Org's ==verbatim== and =~code~=). | 1004 | + ~modus-operandi-tinted-palette-overrides~ |
| 1542 | 1005 | ||
| 1543 | Symbol: ~modus-themes-markup~ (=boolean= type) | 1006 | #+vindex: modus-vivendi-palette-overrides |
| 1007 | + ~modus-vivendi-palette-overrides~ | ||
| 1544 | 1008 | ||
| 1545 | Possible values are expressed as a list of properties (default is ~nil~ or | 1009 | #+vindex: modus-vivendi-deuteranopia-palette-overrides |
| 1546 | an empty list). The list can include any of the following symbols: | 1010 | + ~modus-vivendi-deuteranopia-palette-overrides~ |
| 1547 | 1011 | ||
| 1548 | 1. ~bold~ | 1012 | #+vindex: modus-vivendi-tinted-palette-overrides |
| 1549 | 2. ~italic~ | 1013 | + ~modus-vivendi-tinted-palette-overrides~ |
| 1550 | 3. ~background~ | ||
| 1551 | 4. ~intense~ | ||
| 1552 | 1014 | ||
| 1553 | The ~italic~ property applies a typographic slant (italics). | 1015 | Theme-specific overrides take precedence over the shared ones. It is |
| 1016 | strongly advised that shared overrides do NOT alter color values, as | ||
| 1017 | those will not be appropriate for both dark and light themes. Common | ||
| 1018 | overrides are best limited to the semantic color mappings as those use | ||
| 1019 | the color value that corresponds to the active theme (e.g. make the | ||
| 1020 | cursor =blue-warmer= in all themes, whatever the value of | ||
| 1021 | =blue-warmer= is in each theme). | ||
| 1554 | 1022 | ||
| 1555 | The ~bold~ property applies a heavier typographic weight. | 1023 | The value of any overrides' variable must mirror a theme's palette. |
| 1024 | Palette variables are named after their theme as =THEME-NAME-palette=. | ||
| 1025 | For example, the ~modus-operandi-palette~ is like this: | ||
| 1556 | 1026 | ||
| 1557 | [[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. | 1027 | #+begin_src emacs-lisp |
| 1028 | (defconst modus-operandi-palette | ||
| 1029 | '( | ||
| 1030 | ;;; Basic values | ||
| 1558 | 1031 | ||
| 1559 | The ~background~ property adds a background color. The background is a | 1032 | (bg-main "#ffffff") |
| 1560 | shade of gray, unless the ~intense~ property is also set. | 1033 | (bg-dim "#f0f0f0") |
| 1034 | (fg-main "#000000") | ||
| 1561 | 1035 | ||
| 1562 | The ~intense~ property amplifies the existing coloration. When | 1036 | ;; ... |
| 1563 | ~background~ is used, the background color is enhanced as well and | ||
| 1564 | becomes tinted instead of being gray. | ||
| 1565 | 1037 | ||
| 1566 | Combinations of any of those properties are expressed as a list, | 1038 | (red "#a60000") |
| 1567 | like in these examples: | 1039 | (red-warmer "#972500") |
| 1040 | (red-cooler "#a0132f") | ||
| 1041 | (red-faint "#7f0000") | ||
| 1042 | (red-intense "#d00000") | ||
| 1568 | 1043 | ||
| 1569 | #+begin_src emacs-lisp | 1044 | ;; ... |
| 1570 | (bold) | ||
| 1571 | (bold italic) | ||
| 1572 | (bold italic intense) | ||
| 1573 | (bold italic intense background) | ||
| 1574 | #+end_src | ||
| 1575 | 1045 | ||
| 1576 | The order in which the properties are set is not significant. | 1046 | ;;;; Mappings |
| 1577 | 1047 | ||
| 1578 | In user configuration files the form may look like this: | 1048 | ;; ... |
| 1579 | 1049 | ||
| 1580 | #+begin_src emacs-lisp | 1050 | (cursor fg-main) |
| 1581 | (setq modus-themes-markup '(bold italic)) | 1051 | (builtin magenta-warmer) |
| 1582 | #+end_src | 1052 | (comment fg-dim) |
| 1053 | (constant blue-cooler) | ||
| 1054 | (docstring green-faint) | ||
| 1055 | (fnname magenta) | ||
| 1056 | (keyword magenta-cooler) | ||
| 1583 | 1057 | ||
| 1584 | Also check the variables ~org-hide-emphasis-markers~, | 1058 | ;; ... |
| 1585 | ~org-hide-macro-markers~. | 1059 | )) |
| 1060 | #+end_src | ||
| 1586 | 1061 | ||
| 1587 | ** Option for parenthesis matching | 1062 | The ~modus-operandi-palette-overrides~ targets the entries that need |
| 1588 | :properties: | 1063 | to be changed. For example, to make the main foreground colour a dark |
| 1589 | :alt_title: Matching parentheses | 1064 | gray instead of pure black, use a shade of red for comments, and apply |
| 1590 | :description: Choose between various styles for matching delimiters/parentheses | 1065 | a cyan hue to keywords: |
| 1591 | :custom_id: h:e66a7e4d-a512-4bc7-9f86-fbbb5923bf37 | ||
| 1592 | :end: | ||
| 1593 | #+vindex: modus-themes-paren-match | ||
| 1594 | 1066 | ||
| 1595 | Brief: Control the style of matching delimiters produced by | 1067 | #+begin_src emacs-lisp |
| 1596 | ~show-paren-mode~. | 1068 | (setq modus-operandi-palette-overrides |
| 1069 | '((fg-main "#333333") | ||
| 1070 | (comment red-faint) | ||
| 1071 | (keyword cyan-cooler))) | ||
| 1072 | #+end_src | ||
| 1597 | 1073 | ||
| 1598 | Symbol: ~modus-themes-paren-match~ (=choice= type, list of properties) | 1074 | Changes take effect upon theme reload ([[#h:9001527a-4e2c-43e0-98e8-3ef72d770639][Custom reload theme]]). |
| 1075 | Overrides are removed by setting their variable to a ~nil~ value. | ||
| 1599 | 1076 | ||
| 1600 | Possible values are expressed as a list of properties (default is ~nil~ or | 1077 | The common accented foregrounds in each palette follow a predictable |
| 1601 | an empty list). The list can include any of the following symbols: | 1078 | naming scheme: =HUE{,-warmer,-cooler,-faint,-intense}=. =HUE= is one |
| 1079 | of the six basic colors: red, green, blue, yellow, magenta, cyan. | ||
| 1602 | 1080 | ||
| 1603 | + ~bold~ | 1081 | Named colors that are meant to be used as backgrounds contain =bg= in |
| 1604 | + ~intense~ | 1082 | their name, such as =bg-red-intense=. While special purpose |
| 1605 | + ~underline~ | 1083 | foregrounds that are meant to be combined with such backgrounds, |
| 1084 | contain =fg= in their name, such as =fg-removed= which complements | ||
| 1085 | =bg-removed=. | ||
| 1606 | 1086 | ||
| 1607 | The default (a ~nil~ value or an empty list) is a subtle background color. | 1087 | Named colors can be previewed, such as with the command |
| 1088 | ~modus-themes-list-colors~ ([[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Preview theme colors]]). | ||
| 1608 | 1089 | ||
| 1609 | The ~bold~ property adds a bold weight to the characters of the matching | 1090 | For a video tutorial that users of all skill levels can approach, |
| 1610 | delimiters. | 1091 | watch: https://protesilaos.com/codelog/2022-12-17-modus-themes-v4-demo/. |
| 1611 | 1092 | ||
| 1612 | The ~intense~ property applies a more prominent background color to the | 1093 | *** Palette override presets |
| 1613 | delimiters. | 1094 | :PROPERTIES: |
| 1095 | :CUSTOM_ID: h:b0bc811c-227e-42ec-bf67-15e1f41eb7bc | ||
| 1096 | :END: | ||
| 1614 | 1097 | ||
| 1615 | The ~underline~ property draws a straight line under the affected text. | 1098 | This section shows how to refashion the themes by opting in to the |
| 1099 | stylistic presets we provide. Those presets override the default | ||
| 1100 | color mappings to amplify or tone down the overall coloration of the | ||
| 1101 | them. | ||
| 1616 | 1102 | ||
| 1617 | Combinations of any of those properties are expressed as a list, like in | 1103 | To make almost all aspects of the themes less intense, use this: |
| 1618 | these examples: | ||
| 1619 | 1104 | ||
| 1620 | #+begin_src emacs-lisp | 1105 | #+begin_src emacs-lisp |
| 1621 | (bold) | 1106 | ;; Always remember to reload the theme for changes to take effect! |
| 1622 | (underline intense) | 1107 | (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-faint) |
| 1623 | (bold intense underline) | ||
| 1624 | #+end_src | 1108 | #+end_src |
| 1625 | 1109 | ||
| 1626 | The order in which the properties are set is not significant. | 1110 | #+vindex: modus-themes-preset-overrides-faint |
| 1111 | With ~modus-themes-preset-overrides-faint~ the grays are toned down, | ||
| 1112 | gray backgrounds are removed from some contexts, and almost all accent | ||
| 1113 | colors are desaturated. It makes the themes less attention-grabbing. | ||
| 1627 | 1114 | ||
| 1628 | In user configuration files the form may look like this: | 1115 | On the opposite end of the stylistic spectrum, we have this |
| 1629 | 1116 | ||
| 1630 | #+begin_src emacs-lisp | 1117 | #+begin_src emacs-lisp |
| 1631 | (setq modus-themes-paren-match '(bold intense)) | 1118 | ;; Always remember to reload the theme for changes to take effect! |
| 1119 | (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-intense) | ||
| 1632 | #+end_src | 1120 | #+end_src |
| 1633 | 1121 | ||
| 1634 | This customization variable affects the built-in ~show-paren-mode~ and the | 1122 | #+vindex: modus-themes-preset-overrides-intense |
| 1635 | =smartparens= package. | 1123 | The ~modus-themes-preset-overrides-intense~ makes many background |
| 1636 | 1124 | colors accented instead of gray and increases coloration in a number | |
| 1637 | ** Option for active region | 1125 | of places. Colors stand out more and are made easier to spot. |
| 1638 | :properties: | ||
| 1639 | :alt_title: Active region | ||
| 1640 | :description: Choose between various styles for the active region | ||
| 1641 | :custom_id: h:60798063-b4ad-45ea-b9a7-ff7b5c0ab74c | ||
| 1642 | :end: | ||
| 1643 | #+vindex: modus-themes-region | ||
| 1644 | 1126 | ||
| 1645 | Brief: Control the style of the region. | 1127 | Note that the user is not limited to those presets. The system of |
| 1128 | overrides we provide makes it possible to tweak the value of each | ||
| 1129 | individual named color and to change how values are assigned to | ||
| 1130 | semantic color mappings ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). Subsequent | ||
| 1131 | sections provide examples ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). | ||
| 1646 | 1132 | ||
| 1647 | Symbol: ~modus-themes-region~ (=choice= type, list of properties) | 1133 | It is also possible to use those presets as a basis and, for example, |
| 1648 | 1134 | add to them code from the subsequent sections of this manual. This is | |
| 1649 | Possible values are expressed as a list of properties (default is ~nil~ or | 1135 | the general idea (extra space for didactic purposes): |
| 1650 | an empty list). The list can include any of the following symbols: | ||
| 1651 | 1136 | ||
| 1652 | + ~no-extend~ | 1137 | #+begin_src emacs-lisp |
| 1653 | + ~bg-only~ | 1138 | (setq modus-themes-common-palette-overrides |
| 1654 | + ~accented~ | 1139 | `( |
| 1140 | ;; From the section "Make the mode line borderless" | ||
| 1141 | (border-mode-line-active unspecified) | ||
| 1142 | (border-mode-line-inactive unspecified) | ||
| 1655 | 1143 | ||
| 1656 | The default (a ~nil~ value or an empty list) is a prominent gray | 1144 | ;; From the section "Make matching parenthesis more or less intense" |
| 1657 | background that overrides all foreground colors in the area it | 1145 | (bg-paren-match bg-magenta-intense) |
| 1658 | encompasses. Its reach extends to the edge of the window. | 1146 | (underline-paren-match fg-main) |
| 1659 | 1147 | ||
| 1660 | The ~no-extend~ property limits the region to the end of the line, so that | 1148 | ;; And expand the preset here. Note that the ,@ works because |
| 1661 | it does not reach the edge of the window. | 1149 | ;; we use the backtick for this list, instead of a straight |
| 1150 | ;; quote. | ||
| 1151 | ,@modus-themes-preset-overrides-intense)) | ||
| 1152 | #+end_src | ||
| 1662 | 1153 | ||
| 1663 | The ~bg-only~ property makes the region's background color more subtle to | 1154 | *** Stylistic variants using palette overrides |
| 1664 | allow the underlying text to retain its foreground colors. | 1155 | :PROPERTIES: |
| 1156 | :CUSTOM_ID: h:df1199d8-eaba-47db-805d-6b568a577bf3 | ||
| 1157 | :END: | ||
| 1665 | 1158 | ||
| 1666 | The ~accented~ property applies a more colorful background to the region. | 1159 | This section contains practical examples of overriding the palette of |
| 1160 | the themes ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). Users can copy the code to | ||
| 1161 | their init file, evaluate it, and then re-load the theme for changes | ||
| 1162 | to take effect. To apply overrides at startup simply define them | ||
| 1163 | before the call that loads the theme. Remember that we also provide | ||
| 1164 | presets that are easier to apply ([[#h:b0bc811c-227e-42ec-bf67-15e1f41eb7bc][Palette override presets]]). | ||
| 1667 | 1165 | ||
| 1668 | Combinations of any of those properties are expressed as a list, like in | 1166 | **** Make the mode line borderless |
| 1669 | these examples: | 1167 | :PROPERTIES: |
| 1168 | :CUSTOM_ID: h:80ddba52-e188-411f-8cc0-480ebd75befe | ||
| 1169 | :END: | ||
| 1670 | 1170 | ||
| 1671 | #+begin_src emacs-lisp | 1171 | This is one of our practical examples to override the semantic colors |
| 1672 | (no-extend) | 1172 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). To |
| 1673 | (bg-only accented) | 1173 | hide the border around the active and inactive mode lines, we need to |
| 1674 | (accented bg-only no-extend) | 1174 | set their color to that of the underlying background. |
| 1675 | #+end_src | ||
| 1676 | 1175 | ||
| 1677 | The order in which the properties are set is not significant. | 1176 | [[#h:e8d781be-eefc-4a81-ac4e-5ed156190df7][Make the active mode line colorful]]. |
| 1678 | 1177 | ||
| 1679 | In user configuration files the form may look like this: | 1178 | [[#h:5a0c58cc-f97f-429c-be08-927b9fbb0a9c][Add padding to mode line]]. |
| 1680 | 1179 | ||
| 1681 | #+begin_src emacs-lisp | 1180 | #+begin_src emacs-lisp |
| 1682 | (setq modus-themes-region '(bg-only no-extend)) | 1181 | ;; These overrides are common to all Modus themes. We also provide |
| 1683 | #+end_src | 1182 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. |
| 1183 | ;; | ||
| 1184 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1185 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1186 | ;; common overrides are best used for changes to semantic color | ||
| 1187 | ;; mappings, as we show below. | ||
| 1684 | 1188 | ||
| 1685 | ** Option for diff buffer looks | 1189 | (setq modus-themes-common-palette-overrides |
| 1686 | :properties: | 1190 | '((border-mode-line-active unspecified) |
| 1687 | :alt_title: Diffs | 1191 | (border-mode-line-inactive unspecified))) |
| 1688 | :description: Choose among intense, desaturated, or background-only diffs | 1192 | #+end_src |
| 1689 | :custom_id: h:ea7ac54f-5827-49bd-b09f-62424b3b6427 | ||
| 1690 | :end: | ||
| 1691 | #+vindex: modus-themes-diffs | ||
| 1692 | 1193 | ||
| 1693 | Brief: Set the overall style of diffs. | 1194 | **** Make the active mode line colorful |
| 1195 | :PROPERTIES: | ||
| 1196 | :CUSTOM_ID: h:e8d781be-eefc-4a81-ac4e-5ed156190df7 | ||
| 1197 | :END: | ||
| 1694 | 1198 | ||
| 1695 | Symbol: ~modus-themes-diffs~ (=choice= type) | 1199 | This is one of our practical examples to override the semantic colors |
| 1200 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). | ||
| 1201 | Here we show some snippets that apply different stylistic variants. | ||
| 1202 | Of course, it is possible to use theme-specific overrides to, say, | ||
| 1203 | have a blue mode line for ~modus-operandi~ and a red one for | ||
| 1204 | ~modus-vivendi~. | ||
| 1696 | 1205 | ||
| 1697 | Possible values: | 1206 | [[#h:80ddba52-e188-411f-8cc0-480ebd75befe][Make the mode line borderless]]. |
| 1698 | 1207 | ||
| 1699 | 1. ~nil~ (default) | 1208 | [[#h:5a0c58cc-f97f-429c-be08-927b9fbb0a9c][Add padding to mode line]]. |
| 1700 | 2. ~desaturated~ | ||
| 1701 | 3. ~bg-only~ | ||
| 1702 | 1209 | ||
| 1703 | The default (~nil~) uses fairly intense color combinations for diffs, by | 1210 | #+begin_src emacs-lisp |
| 1704 | applying prominently colored backgrounds, with appropriately tinted | 1211 | ;; These overrides are common to all Modus themes. We also provide |
| 1705 | foregrounds. | 1212 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. |
| 1706 | 1213 | ;; | |
| 1707 | Option ~desaturated~ follows the same principles as with the default | 1214 | ;; In general, the theme-specific overrides are better for overriding |
| 1708 | (~nil~), though it tones down all relevant colors. | 1215 | ;; color values, such as redefining what `blue-faint' looks like. The |
| 1216 | ;; common overrides are best used for changes to semantic color | ||
| 1217 | ;; mappings, as we show below. | ||
| 1709 | 1218 | ||
| 1710 | Option ~bg-only~ applies a background but does not override the text's | 1219 | ;; Blue background, neutral foreground, intense blue border |
| 1711 | foreground. This makes it suitable for a non-~nil~ value passed to | 1220 | (setq modus-themes-common-palette-overrides |
| 1712 | ~diff-font-lock-syntax~ (note: Magit does not support syntax highlighting | 1221 | '((bg-mode-line-active bg-blue) |
| 1713 | in diffs---last checked on 2021-12-02). | 1222 | (fg-mode-line-active fg-main) |
| 1223 | (border-mode-line-active blue-intense))) | ||
| 1714 | 1224 | ||
| 1715 | When the user option ~modus-themes-deuteranopia~ is non-~nil~, all diffs | 1225 | ;; Subtle blue background, neutral foreground, intense blue border |
| 1716 | will use a red/blue color-coding system instead of the standard | 1226 | (setq modus-themes-common-palette-overrides |
| 1717 | red/green. Other stylistic changes are made in the interest of | 1227 | '((bg-mode-line-active bg-blue-subtle) |
| 1718 | optimizing for such a use-case. | 1228 | (fg-mode-line-active fg-main) |
| 1229 | (border-mode-line-active blue-intense))) | ||
| 1719 | 1230 | ||
| 1720 | [[#h:3ed03a48-20d8-4ce7-b214-0eb7e4c79abe][Option for red-green color deficiency or deuteranopia]]. | 1231 | ;; Subtle red background, red foreground, invisible border |
| 1232 | (setq modus-themes-common-palette-overrides | ||
| 1233 | '((bg-mode-line-active bg-red-subtle) | ||
| 1234 | (fg-mode-line-active red-warmer) | ||
| 1235 | (border-mode-line-active bg-red-subtle))) | ||
| 1236 | #+end_src | ||
| 1721 | 1237 | ||
| 1722 | In versions before =2.0.0= there was an option for foreground-only diffs. | 1238 | **** Make the fringe invisible or another color |
| 1723 | This is no longer supported at the theme level because there are cases | 1239 | :PROPERTIES: |
| 1724 | where the perceived contrast and overall contextuality were not good | 1240 | :CUSTOM_ID: h:c312dcac-36b6-4a1f-b1f5-ab1c9abe27b0 |
| 1725 | enough although the applied colors were technically above the 7:1 | 1241 | :END: |
| 1726 | contrast threshold. | ||
| 1727 | 1242 | ||
| 1728 | [[#h:e2aed9eb-5e1e-45ec-bbd7-bc4faeab3236][Diffs with only the foreground]]. | 1243 | This is one of our practical examples to override the semantic colors |
| 1244 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). | ||
| 1245 | Here we show how to make the fringe invisible or how to assign to it a | ||
| 1246 | different color. The "fringe" is a small area to the right and left | ||
| 1247 | side of the Emacs window which shows indicators such as for truncation | ||
| 1248 | or continuation lines. | ||
| 1729 | 1249 | ||
| 1730 | [[#h:b0b31802-0216-427e-b071-1a47adcfe608][Ediff without diff color-coding]]. | 1250 | #+begin_src emacs-lisp |
| 1251 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1252 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1253 | ;; | ||
| 1254 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1255 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1256 | ;; common overrides are best used for changes to semantic color | ||
| 1257 | ;; mappings, as we show below. | ||
| 1731 | 1258 | ||
| 1732 | ** Option for org-mode block styles | 1259 | ;; Make the fringe invisible |
| 1733 | :properties: | 1260 | (setq modus-themes-common-palette-overrides |
| 1734 | :alt_title: Org mode blocks | 1261 | '((fringe unspecified))) |
| 1735 | :description: Choose among plain, gray, or tinted backgrounds | ||
| 1736 | :custom_id: h:b7e328c0-3034-4db7-9cdf-d5ba12081ca2 | ||
| 1737 | :end: | ||
| 1738 | #+vindex: modus-themes-org-blocks | ||
| 1739 | 1262 | ||
| 1740 | Brief: Set the overall style of Org code blocks, quotes, and the like. | 1263 | ;; Make the fringe more intense |
| 1264 | (setq modus-themes-common-palette-overrides | ||
| 1265 | '((fringe bg-active))) | ||
| 1741 | 1266 | ||
| 1742 | Symbol: ~modus-themes-org-blocks~ (=choice= type) | 1267 | ;; Make the fringe colorful, but nuanced |
| 1268 | (setq modus-themes-common-palette-overrides | ||
| 1269 | '((fringe bg-blue-nuanced))) | ||
| 1270 | #+end_src | ||
| 1743 | 1271 | ||
| 1744 | Possible values: | 1272 | **** Make links use subtle or no underlines |
| 1273 | :PROPERTIES: | ||
| 1274 | :CUSTOM_ID: h:6c1d1dea-5cbf-4d92-b7bb-570a7a23ffe9 | ||
| 1275 | :END: | ||
| 1745 | 1276 | ||
| 1746 | 1. ~nil~ (default) | 1277 | This is one of our practical examples to override the semantic colors |
| 1747 | 2. ~gray-background~ (value ~grayscale~ exists for backward compatibility) | 1278 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). In |
| 1748 | 3. ~tinted-background~ (value ~rainbow~ exists for backward compatibility) | 1279 | this example, we showcase the special use of the ~unspecified~ symbol |
| 1280 | that underline mappings can read correctly. | ||
| 1749 | 1281 | ||
| 1750 | Nil (the default) means that the block has no background of its own: it | 1282 | #+begin_src emacs-lisp |
| 1751 | uses the one that applies to the rest of the buffer. In this case, the | 1283 | ;; Subtle underlines |
| 1752 | delimiter lines have a gray color for their text, making them look | 1284 | (setq modus-themes-common-palette-overrides |
| 1753 | exactly like all other Org properties. | 1285 | '((underline-link border) |
| 1286 | (underline-link-visited border) | ||
| 1287 | (underline-link-symbolic border))) | ||
| 1754 | 1288 | ||
| 1755 | Option ~gray-background~ applies a subtle gray background to the block's | 1289 | ;; No underlines |
| 1756 | contents. It also affects the begin and end lines of the block as they | 1290 | (setq modus-themes-common-palette-overrides |
| 1757 | get another shade of gray as their background, which differentiates them | 1291 | '((underline-link unspecified) |
| 1758 | from the contents of the block. All background colors extend to the | 1292 | (underline-link-visited unspecified) |
| 1759 | edge of the window, giving the area a rectangular, "blocky" | 1293 | (underline-link-symbolic unspecified))) |
| 1760 | presentation. | 1294 | #+end_src |
| 1761 | |||
| 1762 | Option ~tinted-background~ uses a slightly colored background for the | ||
| 1763 | contents of the block. The exact color will depend on the programming | ||
| 1764 | language and is controlled by the variable ~org-src-block-faces~ (refer to | ||
| 1765 | the theme's source code for the current association list). For this to | ||
| 1766 | take effect, the Org buffer needs to be restarted with ~org-mode-restart~. | ||
| 1767 | In this scenario, it may be better to inhibit the extension of the | ||
| 1768 | delimiter lines' background to the edge of the window because Org does | ||
| 1769 | not provide a mechanism to update their colors depending on the contents | ||
| 1770 | of the block. Disable the extension of such backgrounds by setting | ||
| 1771 | ~org-fontify-whole-block-delimiter-line~ to nil. | ||
| 1772 | |||
| 1773 | Code blocks use their major mode's colors only when the variable | ||
| 1774 | ~org-src-fontify-natively~ is non-~nil~. While quote/verse blocks require | ||
| 1775 | setting ~org-fontify-quote-and-verse-blocks~ to a non-~nil~ value. | ||
| 1776 | 1295 | ||
| 1777 | [[#h:f44cc6e3-b0f1-4a5e-8a90-9e48fa557b50][Update Org block delimiter fontification]]. | 1296 | **** Make prompts more or less colorful |
| 1297 | :PROPERTIES: | ||
| 1298 | :CUSTOM_ID: h:bd75b43a-0bf1-45e7-b8b4-20944ca8b7f8 | ||
| 1299 | :END: | ||
| 1778 | 1300 | ||
| 1779 | Older versions of the themes provided options ~grayscale~ (or ~greyscale~) | 1301 | This section contains practical examples of overriding the palette of |
| 1780 | and ~rainbow~. Those will continue to work as they are aliases for | 1302 | the themes ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). In the following code |
| 1781 | ~gray-background~ and ~tinted-background~, respectively. | 1303 | block we show how to add or remove color from prompts. |
| 1782 | 1304 | ||
| 1783 | ** Option for Org agenda constructs | 1305 | [[#h:db5a9a7c-2928-4a28-b0f0-6f2b9bd52ba1][Option for command prompt styles]]. |
| 1784 | :properties: | ||
| 1785 | :alt_title: Org agenda | ||
| 1786 | :description: Control each element in the presentation of the agenda | ||
| 1787 | :custom_id: h:68f481bc-5904-4725-a3e6-d7ecfa7c3dbc | ||
| 1788 | :end: | ||
| 1789 | #+vindex: modus-themes-org-agenda | ||
| 1790 | 1306 | ||
| 1791 | Brief: Control the style of the Org agenda. Multiple parameters are | 1307 | #+begin_src emacs-lisp |
| 1792 | available, each with its own options. | 1308 | ;; These overrides are common to all Modus themes. We also provide |
| 1309 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1310 | ;; | ||
| 1311 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1312 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1313 | ;; common overrides are best used for changes to semantic color | ||
| 1314 | ;; mappings, as we show below. | ||
| 1793 | 1315 | ||
| 1794 | Symbol: ~modus-themes-org-agenda~ (=alist= type, multiple styles) | 1316 | ;; Keep the background unspecified (like the default), but use a faint |
| 1317 | ;; foreground color. | ||
| 1318 | (setq modus-themes-common-palette-overrides | ||
| 1319 | '((fg-prompt cyan-faint) | ||
| 1320 | (bg-prompt unspecified))) | ||
| 1795 | 1321 | ||
| 1796 | This is an alist that accepts a =(key . value)= combination. Some values | 1322 | ;; Add a nuanced background to prompts that complements their foreground. |
| 1797 | are specified as a list. Here is a sample, followed by a description of | 1323 | (setq modus-themes-common-palette-overrides |
| 1798 | all possible combinations: | 1324 | '((fg-prompt cyan) |
| 1325 | (bg-prompt bg-cyan-nuanced))) | ||
| 1799 | 1326 | ||
| 1800 | #+begin_src emacs-lisp | 1327 | ;; Add a yellow background and adjust the foreground accordingly. |
| 1801 | (setq modus-themes-org-agenda | 1328 | (setq modus-themes-common-palette-overrides |
| 1802 | '((header-block . (variable-pitch 1.5)) | 1329 | '((fg-prompt fg-main) |
| 1803 | (header-date . (grayscale workaholic bold-today 1.2)) | 1330 | (bg-prompt bg-yellow-subtle))) ; try to replace "subtle" with "intense" |
| 1804 | (event . (accented italic varied)) | ||
| 1805 | (scheduled . uniform) | ||
| 1806 | (habit . traffic-light))) | ||
| 1807 | #+end_src | 1331 | #+end_src |
| 1808 | 1332 | ||
| 1809 | A ~header-block~ key applies to elements that concern the headings which | 1333 | **** Make completion matches more or less colorful |
| 1810 | demarcate blocks in the structure of the agenda. By default (a ~nil~ | 1334 | :PROPERTIES: |
| 1811 | value) those are rendered in a bold typographic weight, plus a height | 1335 | :CUSTOM_ID: h:d959f789-0517-4636-8780-18123f936f91 |
| 1812 | that is slightly taller than the default font size. Acceptable values | 1336 | :END: |
| 1813 | come in the form of a list that can include either or both of those | ||
| 1814 | properties: | ||
| 1815 | 1337 | ||
| 1816 | - ~variable-pitch~ to use a proportionately spaced typeface; | 1338 | This section contains practical examples of overriding the palette of |
| 1339 | the themes ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). Here we demonstrate how | ||
| 1340 | to activate background coloration for completion matches. We show | ||
| 1341 | three different degrees of intensity. | ||
| 1342 | |||
| 1343 | [[#h:f1c20c02-7b34-4c35-9c65-99170efb2882][Option for completion framework aesthetics]]. | ||
| 1344 | |||
| 1345 | #+begin_src emacs-lisp | ||
| 1346 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1347 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1348 | ;; | ||
| 1349 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1350 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1351 | ;; common overrides are best used for changes to semantic color | ||
| 1352 | ;; mappings, as we show below. | ||
| 1353 | |||
| 1354 | ;; Add a nuanced background color to completion matches, while keeping | ||
| 1355 | ;; their foreground intact. | ||
| 1356 | (setq modus-themes-common-palette-overrides | ||
| 1357 | '((fg-completion-match-0 blue) | ||
| 1358 | (fg-completion-match-1 magenta-warmer) | ||
| 1359 | (fg-completion-match-2 cyan) | ||
| 1360 | (fg-completion-match-3 red) | ||
| 1361 | (bg-completion-match-0 bg-blue-nuanced) | ||
| 1362 | (bg-completion-match-1 bg-magenta-nuanced) | ||
| 1363 | (bg-completion-match-2 bg-cyan-nuanced) | ||
| 1364 | (bg-completion-match-3 bg-red-nuanced))) | ||
| 1365 | |||
| 1366 | ;; Add intense background colors to completion matches and adjust the | ||
| 1367 | ;; foregrounds accordingly. | ||
| 1368 | (setq modus-themes-common-palette-overrides | ||
| 1369 | '((fg-completion-match-0 fg-main) | ||
| 1370 | (fg-completion-match-1 fg-main) | ||
| 1371 | (fg-completion-match-2 fg-main) | ||
| 1372 | (fg-completion-match-3 fg-main) | ||
| 1373 | (bg-completion-match-0 bg-blue-intense) | ||
| 1374 | (bg-completion-match-1 bg-yellow-intense) | ||
| 1375 | (bg-completion-match-2 bg-cyan-intense) | ||
| 1376 | (bg-completion-match-3 bg-red-intense))) | ||
| 1377 | |||
| 1378 | ;; Like the above, but with subtle backgrounds. | ||
| 1379 | (setq modus-themes-common-palette-overrides | ||
| 1380 | '((fg-completion-match-0 fg-main) | ||
| 1381 | (fg-completion-match-1 fg-main) | ||
| 1382 | (fg-completion-match-2 fg-main) | ||
| 1383 | (fg-completion-match-3 fg-main) | ||
| 1384 | (bg-completion-match-0 bg-blue-subtle) | ||
| 1385 | (bg-completion-match-1 bg-yellow-subtle) | ||
| 1386 | (bg-completion-match-2 bg-cyan-subtle) | ||
| 1387 | (bg-completion-match-3 bg-red-subtle))) | ||
| 1388 | #+end_src | ||
| 1389 | |||
| 1390 | Adding to the above, it is possible to, say, reduce the number of | ||
| 1391 | colors to two: | ||
| 1392 | |||
| 1393 | #+begin_src emacs-lisp | ||
| 1394 | ;; No backgrounds (like the default) and just use two colors. | ||
| 1395 | (setq modus-themes-common-palette-overrides | ||
| 1396 | '((fg-completion-match-0 blue) | ||
| 1397 | (fg-completion-match-1 yellow) | ||
| 1398 | (fg-completion-match-2 blue) | ||
| 1399 | (fg-completion-match-3 yellow) | ||
| 1400 | (bg-completion-match-0 unspecified) | ||
| 1401 | (bg-completion-match-1 unspecified) | ||
| 1402 | (bg-completion-match-2 unspecified) | ||
| 1403 | (bg-completion-match-3 unspecified))) | ||
| 1404 | |||
| 1405 | ;; Again, a two-color style but this time with backgrounds | ||
| 1406 | (setq modus-themes-common-palette-overrides | ||
| 1407 | '((fg-completion-match-0 blue) | ||
| 1408 | (fg-completion-match-1 yellow) | ||
| 1409 | (fg-completion-match-2 blue) | ||
| 1410 | (fg-completion-match-3 yellow) | ||
| 1411 | (bg-completion-match-0 bg-blue-nuanced) | ||
| 1412 | (bg-completion-match-1 bg-yellow-nuanced) | ||
| 1413 | (bg-completion-match-2 bg-blue-nuanced) | ||
| 1414 | (bg-completion-match-3 bg-yellow-nuanced))) | ||
| 1415 | #+end_src | ||
| 1416 | |||
| 1417 | The user can mix and match to their liking. | ||
| 1418 | |||
| 1419 | **** Make comments yellow and strings green | ||
| 1420 | :PROPERTIES: | ||
| 1421 | :CUSTOM_ID: h:26f53daa-0065-48dc-88ab-6a718d16cd95 | ||
| 1422 | :END: | ||
| 1817 | 1423 | ||
| 1818 | - A number as a floating point (e.g. 1.5) to set the height of the text | 1424 | This is one of our practical examples to override the semantic colors |
| 1819 | to that many times the default font height. A float of 1.0 or the | 1425 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). In |
| 1820 | symbol ~no-scale~ have the same effect of making the font the same | 1426 | previous versions of the themes, we provided an option for yellow-ish |
| 1821 | height as the rest of the buffer. When neither a number nor | 1427 | comments and green-ish strings. For some users, those were still not |
| 1822 | `no-scale' are present, the default is a small increase in height (a | 1428 | good enough, as the exact values were hardcoded. Here we show how to |
| 1823 | value of 1.15). | 1429 | reproduce the effect, but also how to tweak it to one's liking. |
| 1824 | 1430 | ||
| 1825 | Instead of a floating point, an acceptable value can be in the form of | 1431 | [[#h:c8767172-bf11-4c96-81dc-e736c464fc9c][Make code syntax use the old alt-syntax style]]. |
| 1826 | a cons cell like =(height . FLOAT)= or =(height FLOAT)=, where FLOAT | ||
| 1827 | is the given number. | ||
| 1828 | 1432 | ||
| 1829 | - The symbol of a weight attribute adjusts the font of the heading | 1433 | [[#h:943063da-7b27-4ba4-9afe-f8fe77652fd1][Make use of alternative styles for code syntax]]. |
| 1830 | accordingly, such as ~light~, ~semibold~, etc. Valid symbols are | ||
| 1831 | defined in the variable ~modus-themes-weights~. The absence of a | ||
| 1832 | weight means that bold will be used by virtue of inheriting the ~bold~ | ||
| 1833 | face. | ||
| 1834 | 1434 | ||
| 1835 | [[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. | 1435 | #+begin_src emacs-lisp |
| 1436 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1437 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1438 | ;; | ||
| 1439 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1440 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1441 | ;; common overrides are best used for changes to semantic color | ||
| 1442 | ;; mappings, as we show below. | ||
| 1836 | 1443 | ||
| 1837 | In case both a number and ~no-scale~ are in the list, the latter takes | 1444 | ;; Yellow comments and green strings like older versions of the Modus |
| 1838 | precedence. If two numbers are specified, the first one is applied. | 1445 | ;; themes |
| 1446 | (setq modus-themes-common-palette-overrides | ||
| 1447 | '((comment yellow-cooler) | ||
| 1448 | (string green-cooler))) | ||
| 1839 | 1449 | ||
| 1840 | Example usage: | 1450 | ;; Faint yellow comments and a different shade of green for strings |
| 1451 | (setq modus-themes-common-palette-overrides | ||
| 1452 | '((comment yellow-faint) | ||
| 1453 | (string green-warmer))) | ||
| 1841 | 1454 | ||
| 1842 | #+begin_src emacs-lisp | 1455 | ;; Green comments and yellow strings, because now the user has the |
| 1843 | (header-block . nil) | 1456 | ;; freedom to do it |
| 1844 | (header-block . (1.5)) | 1457 | (setq modus-themes-common-palette-overrides |
| 1845 | (header-block . (no-scale)) | 1458 | '((comment green) |
| 1846 | (header-block . (variable-pitch 1.5)) | 1459 | (string yellow-cooler))) |
| 1847 | (header-block . (variable-pitch 1.5 semibold)) | ||
| 1848 | #+end_src | 1460 | #+end_src |
| 1849 | 1461 | ||
| 1850 | A ~header-date~ key covers date headings. Dates use only a foreground | 1462 | **** Make code syntax use the old alt-syntax style |
| 1851 | color by default (a ~nil~ value), with weekdays and weekends having a | 1463 | :PROPERTIES: |
| 1852 | slight difference in hueness. The current date has an added gray | 1464 | :CUSTOM_ID: h:c8767172-bf11-4c96-81dc-e736c464fc9c |
| 1853 | background. This key accepts a list of values that can include any of | 1465 | :END: |
| 1854 | the following properties: | ||
| 1855 | |||
| 1856 | - ~grayscale~ to make weekdays use the main foreground color and | ||
| 1857 | weekends a more subtle gray; | ||
| 1858 | |||
| 1859 | - ~workaholic~ to make weekdays and weekends look the same in | ||
| 1860 | terms of color; | ||
| 1861 | 1466 | ||
| 1862 | - ~bold-today~ to apply a bold typographic weight to the current | 1467 | This is one of our practical examples to override the semantic colors |
| 1863 | date; | 1468 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). In |
| 1469 | this section we show how to reproduce what previous versions of the | ||
| 1470 | Modus themes provided as a stylistic alternative for code syntax. The | ||
| 1471 | upside of using overrides for this purpose is that we can tweak the | ||
| 1472 | style to our liking, but first let's start with its recreation: | ||
| 1473 | |||
| 1474 | #+begin_src emacs-lisp | ||
| 1475 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1476 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1477 | ;; | ||
| 1478 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1479 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1480 | ;; common overrides are best used for changes to semantic color | ||
| 1481 | ;; mappings, as we show below. | ||
| 1482 | |||
| 1483 | |||
| 1484 | ;; The old "alt-syntax" | ||
| 1485 | (setq modus-themes-common-palette-overrides | ||
| 1486 | '((builtin magenta) | ||
| 1487 | (comment fg-dim) | ||
| 1488 | (constant magenta-cooler) | ||
| 1489 | (docstring magenta-faint) | ||
| 1490 | (docmarkup green-faint) | ||
| 1491 | (fnname magenta-warmer) | ||
| 1492 | (keyword cyan) | ||
| 1493 | (preprocessor cyan-cooler) | ||
| 1494 | (string red-cooler) | ||
| 1495 | (type magenta-cooler) | ||
| 1496 | (variable blue-warmer) | ||
| 1497 | (rx-construct magenta-warmer) | ||
| 1498 | (rx-backslash blue-cooler))) | ||
| 1499 | #+end_src | ||
| 1500 | |||
| 1501 | The "alt-syntax" could optionally use green strings and yellow | ||
| 1502 | comments ([[#h:26f53daa-0065-48dc-88ab-6a718d16cd95][Make comments yellow and strings green]]): | ||
| 1503 | |||
| 1504 | #+begin_src emacs-lisp | ||
| 1505 | ;; Same as above, but with yellow comments and green strings | ||
| 1506 | (setq modus-themes-common-palette-overrides | ||
| 1507 | '((builtin magenta) | ||
| 1508 | (comment yellow-faint) | ||
| 1509 | (constant magenta-cooler) | ||
| 1510 | (docstring green-faint) | ||
| 1511 | (docmarkup magenta-faint) | ||
| 1512 | (fnname magenta-warmer) | ||
| 1513 | (keyword cyan) | ||
| 1514 | (preprocessor cyan-cooler) | ||
| 1515 | (string green-cooler) | ||
| 1516 | (type magenta-cooler) | ||
| 1517 | (variable blue-warmer) | ||
| 1518 | (rx-construct magenta-warmer) | ||
| 1519 | (rx-backslash blue-cooler))) | ||
| 1520 | #+end_src | ||
| 1521 | |||
| 1522 | The standard "alt-syntax" has red strings. As such, it is interesting | ||
| 1523 | to experiment with faintly red colored comments: | ||
| 1524 | |||
| 1525 | #+begin_src emacs-lisp | ||
| 1526 | ;; Like the old "alt-syntax" but with faint red comments | ||
| 1527 | (setq modus-themes-common-palette-overrides | ||
| 1528 | '((builtin magenta) | ||
| 1529 | (comment red-faint) | ||
| 1530 | (constant magenta-cooler) | ||
| 1531 | (docstring magenta-faint) | ||
| 1532 | (docmarkup green-faint) | ||
| 1533 | (fnname magenta-warmer) | ||
| 1534 | (keyword cyan) | ||
| 1535 | (preprocessor cyan-cooler) | ||
| 1536 | (string red-cooler) | ||
| 1537 | (type magenta-cooler) | ||
| 1538 | (variable blue-warmer) | ||
| 1539 | (rx-construct magenta-warmer) | ||
| 1540 | (rx-backslash blue-cooler))) | ||
| 1541 | #+end_src | ||
| 1542 | |||
| 1543 | The user can always mix and match styles to their liking. | ||
| 1544 | |||
| 1545 | [[#h:943063da-7b27-4ba4-9afe-f8fe77652fd1][Make use of alternative styles for code syntax]]. | ||
| 1546 | |||
| 1547 | **** Make use of alternative styles for code syntax | ||
| 1548 | :PROPERTIES: | ||
| 1549 | :CUSTOM_ID: h:943063da-7b27-4ba4-9afe-f8fe77652fd1 | ||
| 1550 | :END: | ||
| 1864 | 1551 | ||
| 1865 | - ~bold-all~ to render all date headings in a bold weight; | 1552 | This is one of our practical examples to override the semantic colors |
| 1553 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). The | ||
| 1554 | idea here is to change how named colors are mapped to code syntax. | ||
| 1555 | Each of the following snippets give the ~modus-themes~ a different | ||
| 1556 | feel while editing code. | ||
| 1557 | |||
| 1558 | Note that my ~modus-themes~ and ~ef-themes~ do not use the same | ||
| 1559 | palettes, so some things are different. If you copy from the latter | ||
| 1560 | to the former, double-check that the entries exist in the given Modus | ||
| 1561 | theme palette. | ||
| 1562 | |||
| 1563 | [[#h:26f53daa-0065-48dc-88ab-6a718d16cd95][Make comments yellow and strings green]]. | ||
| 1564 | |||
| 1565 | [[*Make code syntax use the old alt-syntax style][Make code syntax use the old alt-syntax style]]. | ||
| 1566 | |||
| 1567 | #+begin_src emacs-lisp | ||
| 1568 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1569 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1570 | ;; | ||
| 1571 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1572 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1573 | ;; common overrides are best used for changes to semantic color | ||
| 1574 | ;; mappings, as we show below. | ||
| 1575 | |||
| 1576 | |||
| 1577 | ;; Mimic `ef-night' theme (from my `ef-themes') for code syntax | ||
| 1578 | ;; highlighting, while still using the Modus colors (and other | ||
| 1579 | ;; mappings). | ||
| 1580 | (setq modus-themes-common-palette-overrides | ||
| 1581 | '((builtin green-cooler) | ||
| 1582 | (comment yellow-faint) | ||
| 1583 | (constant magenta-cooler) | ||
| 1584 | (fnname cyan-cooler) | ||
| 1585 | (keyword blue-warmer) | ||
| 1586 | (preprocessor red-warmer) | ||
| 1587 | (docstring cyan-faint) | ||
| 1588 | (string blue-cooler) | ||
| 1589 | (type magenta-cooler) | ||
| 1590 | (variable cyan))) | ||
| 1591 | |||
| 1592 | ;; Mimic `ef-summer' theme (from my `ef-themes') for code syntax | ||
| 1593 | ;; highlighting, while still using the Modus colors (and other | ||
| 1594 | ;; mappings). | ||
| 1595 | (setq modus-themes-common-palette-overrides | ||
| 1596 | '((builtin magenta) | ||
| 1597 | (comment yellow-faint) | ||
| 1598 | (constant red-cooler) | ||
| 1599 | (fnname magenta-warmer) | ||
| 1600 | (keyword magenta-cooler) | ||
| 1601 | (preprocessor green-warmer) | ||
| 1602 | (docstring cyan-faint) | ||
| 1603 | (string yellow-warmer) | ||
| 1604 | (type cyan-warmer) | ||
| 1605 | (variable blue-warmer))) | ||
| 1606 | |||
| 1607 | ;; Mimic `ef-bio' theme (from my `ef-themes') for code syntax | ||
| 1608 | ;; highlighting, while still using the Modus colors (and other | ||
| 1609 | ;; mappings). | ||
| 1610 | (setq modus-themes-common-palette-overrides | ||
| 1611 | '((builtin green) | ||
| 1612 | (comment yellow-faint) | ||
| 1613 | (constant blue) | ||
| 1614 | (fnname green-warmer) | ||
| 1615 | (keyword green-cooler) | ||
| 1616 | (preprocessor green) | ||
| 1617 | (docstring green-faint) | ||
| 1618 | (string magenta-cooler) | ||
| 1619 | (type cyan-warmer) | ||
| 1620 | (variable blue-warmer))) | ||
| 1621 | |||
| 1622 | ;; Mimic `ef-trio-light' theme (from my `ef-themes') for code syntax | ||
| 1623 | ;; highlighting, while still using the Modus colors (and other | ||
| 1624 | ;; mappings). | ||
| 1625 | (setq modus-themes-common-palette-overrides | ||
| 1626 | '((builtin magenta-cooler) | ||
| 1627 | (comment yellow-faint) | ||
| 1628 | (constant magenta-warmer) | ||
| 1629 | (fnname blue-warmer) | ||
| 1630 | (keyword magenta) | ||
| 1631 | (preprocessor red-cooler) | ||
| 1632 | (docstring magenta-faint) | ||
| 1633 | (string green-cooler) | ||
| 1634 | (type cyan-cooler) | ||
| 1635 | (variable cyan-warmer))) | ||
| 1636 | #+end_src | ||
| 1637 | |||
| 1638 | **** Make matching parenthesis more or less intense | ||
| 1639 | :PROPERTIES: | ||
| 1640 | :CUSTOM_ID: h:259cf8f5-48ec-4b13-8a69-5d6387094468 | ||
| 1641 | :END: | ||
| 1866 | 1642 | ||
| 1867 | - ~underline-today~ applies an underline to the current date while | 1643 | This is one of our practical examples to override the semantic colors |
| 1868 | removing the background it has by default; | 1644 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). In |
| 1645 | this code block we show how to change the background of matching | ||
| 1646 | delimiters when ~show-paren-mode~ is enabled. We also demonstrate how | ||
| 1647 | to enable underlines for those highlights. | ||
| 1869 | 1648 | ||
| 1870 | - A number as a floating point (e.g. 1.2) to set the height of the text | 1649 | #+begin_src emacs-lisp |
| 1871 | to that many times the default font height. The default is the same | 1650 | ;; These overrides are common to all Modus themes. We also provide |
| 1872 | as the base font height (the equivalent of 1.0). Instead of a | 1651 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. |
| 1873 | floating point, an acceptable value can be in the form of a cons cell | 1652 | ;; |
| 1874 | like =(height . FLOAT)= or =(height FLOAT)=, where FLOAT is the given | 1653 | ;; In general, the theme-specific overrides are better for overriding |
| 1875 | number. | 1654 | ;; color values, such as redefining what `blue-faint' looks like. The |
| 1655 | ;; common overrides are best used for changes to semantic color | ||
| 1656 | ;; mappings, as we show below. | ||
| 1876 | 1657 | ||
| 1877 | For example: | 1658 | ;; Change the background to a shade of magenta |
| 1659 | (setq modus-themes-common-palette-overrides | ||
| 1660 | '((bg-paren-match bg-magenta-intense))) | ||
| 1878 | 1661 | ||
| 1879 | #+begin_src emacs-lisp | 1662 | ;; Enable underlines by applying a color to them |
| 1880 | (header-date . nil) | 1663 | (setq modus-themes-common-palette-overrides |
| 1881 | (header-date . (workaholic)) | 1664 | '((bg-paren-match bg-magenta-intense) |
| 1882 | (header-date . (grayscale bold-all)) | 1665 | (underline-paren-match fg-main))) |
| 1883 | (header-date . (grayscale workaholic)) | ||
| 1884 | (header-date . (grayscale workaholic bold-today)) | ||
| 1885 | (header-date . (grayscale workaholic bold-today scale-heading)) | ||
| 1886 | #+end_src | 1666 | #+end_src |
| 1887 | 1667 | ||
| 1888 | An ~event~ key covers (i) headings with a plain time stamp that are | 1668 | **** Make box buttons more or less gray |
| 1889 | shown on the agenda, also known as events, (ii) entries imported from | 1669 | :PROPERTIES: |
| 1890 | the diary, and (iii) other items that derive from a symbolic expression | 1670 | :CUSTOM_ID: h:4f6b6ca3-f5bb-4830-8312-baa232305360 |
| 1891 | or sexp (phases of the moon, holidays, etc.). By default all those look | 1671 | :END: |
| 1892 | the same and have a subtle foreground color (the default is a ~nil~ value | ||
| 1893 | or an empty list). This key accepts a list of properties. Those are: | ||
| 1894 | |||
| 1895 | - ~accented~ applies an accent value to the event's foreground, | ||
| 1896 | replacing the original gray. It makes all entries stand out more. | ||
| 1897 | - ~italic~ adds a slant to the font's forms (italic or oblique forms, | ||
| 1898 | depending on the typeface). | ||
| 1899 | - ~varied~ differentiates between events with a plain time stamp and | ||
| 1900 | entries that are generated from either the diary or a symbolic | ||
| 1901 | expression. It generally puts more emphasis on events. When ~varied~ | ||
| 1902 | is combined with ~accented~, it makes only events use an accent color, | ||
| 1903 | while diary/sexp entries retain their original subtle foreground. | ||
| 1904 | When ~varied~ is used in tandem with ~italic~, it applies a slant only | ||
| 1905 | to diary and sexp entries, not events. And when ~varied~ is the sole | ||
| 1906 | property passed to the ~event~ key, it has the same meaning as the | ||
| 1907 | list (italic varied). The combination of ~varied~, ~accented~, | ||
| 1908 | ~italic~ covers all of the aforementioned cases. | ||
| 1909 | 1672 | ||
| 1910 | For example: | 1673 | This is one of our practical examples to override the semantic colors |
| 1674 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). By | ||
| 1675 | default, the boxed buttons that appear in {{{kbd(M-x customize)}}} and | ||
| 1676 | related are distinct shades of gray. The following set of overrides | ||
| 1677 | removes the gray from the active buttons and amplifies it for the | ||
| 1678 | inactive ones. | ||
| 1911 | 1679 | ||
| 1912 | #+begin_src emacs-lisp | 1680 | #+begin_src emacs-lisp |
| 1913 | (event . nil) | 1681 | ;; These overrides are common to all Modus themes. We also provide |
| 1914 | (event . (italic)) | 1682 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. |
| 1915 | (event . (accented italic)) | 1683 | ;; |
| 1916 | (event . (accented italic varied)) | 1684 | ;; In general, the theme-specific overrides are better for overriding |
| 1685 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1686 | ;; common overrides are best used for changes to semantic color | ||
| 1687 | ;; mappings, as we show below. | ||
| 1688 | |||
| 1689 | (setq modus-themes-common-palette-overrides | ||
| 1690 | '((bg-button-active bg-main) | ||
| 1691 | (fg-button-active fg-main) | ||
| 1692 | (bg-button-inactive bg-inactive) | ||
| 1693 | (fg-button-inactive "gray50"))) | ||
| 1917 | #+end_src | 1694 | #+end_src |
| 1918 | 1695 | ||
| 1919 | A ~scheduled~ key applies to tasks with a scheduled date. By default (a | 1696 | **** Make TODO and DONE more or less intense |
| 1920 | ~nil~ value), those use varying shades of yellow to denote (i) a past or | 1697 | :PROPERTIES: |
| 1921 | current date and (ii) a future date. Valid values are symbols: | 1698 | :CUSTOM_ID: h:b57bb50b-a863-4ea8-bb38-6de2275fa868 |
| 1699 | :END: | ||
| 1922 | 1700 | ||
| 1923 | - ~nil~ (default); | 1701 | This is one of our practical examples to override the semantic colors |
| 1924 | - ~uniform~ to make all scheduled dates the same color; | 1702 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). |
| 1925 | - ~rainbow~ to use contrasting colors for past, present, future | 1703 | Here we show how to affect just the =TODO= and =DONE= keywords that we |
| 1926 | scheduled dates. | 1704 | encounter in Org buffers. The idea is to make those pop out more or |
| 1705 | to subdue them. | ||
| 1927 | 1706 | ||
| 1928 | For example: | 1707 | [[#h:11297984-85ea-4678-abe9-a73aeab4676a][Make headings more or less colorful]]. |
| 1708 | |||
| 1709 | [[#h:bb5b396f-5532-4d52-ab13-149ca24854f1][Make inline code in prose use alternative styles]]. | ||
| 1929 | 1710 | ||
| 1930 | #+begin_src emacs-lisp | 1711 | #+begin_src emacs-lisp |
| 1931 | (scheduled . nil) | 1712 | ;; These overrides are common to all Modus themes. We also provide |
| 1932 | (scheduled . uniform) | 1713 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. |
| 1933 | (scheduled . rainbow) | 1714 | ;; |
| 1934 | #+end_src | 1715 | ;; In general, the theme-specific overrides are better for overriding |
| 1716 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1717 | ;; common overrides are best used for changes to semantic color | ||
| 1718 | ;; mappings, as we show below. | ||
| 1935 | 1719 | ||
| 1936 | A ~habit~ key applies to the ~org-habit~ graph. All possible value are | 1720 | ;; Increase intensity |
| 1937 | passed as a symbol. Those are: | 1721 | (setq modus-themes-common-palette-overrides |
| 1938 | 1722 | '((prose-done green-intense) | |
| 1939 | - The default (~nil~) is meant to conform with the original aesthetic of | 1723 | (prose-todo red-intense))) |
| 1940 | ~org-habit~. It employs all four color codes that correspond to the | ||
| 1941 | org-habit states---clear, ready, alert, and overdue---while | ||
| 1942 | distinguishing between their present and future variants. This | ||
| 1943 | results in a total of eight colors in use: red, yellow, green, blue, | ||
| 1944 | in tinted and shaded versions. They cover the full set of information | ||
| 1945 | provided by the ~org-habit~ consistency graph. | ||
| 1946 | - ~simplified~ is like the default except that it removes the dichotomy | ||
| 1947 | between current and future variants by applying uniform color-coded | ||
| 1948 | values. It applies a total of four colors: red, yellow, green, blue. | ||
| 1949 | They produce a simplified consistency graph that is more legible (or | ||
| 1950 | less busy) than the default. The intent is to shift focus towards the | ||
| 1951 | distinction between the four states of a habit task, rather than each | ||
| 1952 | state's present/future outlook. | ||
| 1953 | - ~traffic-light~ further reduces the available colors to red, yellow, and | ||
| 1954 | green. As in ~simplified~, present and future variants appear | ||
| 1955 | uniformly, but differently from it, the ~clear~ state is rendered in a | ||
| 1956 | green hue, instead of the original blue. This is meant to capture the | ||
| 1957 | use-case where a habit task being too early is less important than it | ||
| 1958 | being too late. The difference between ready and clear states is | ||
| 1959 | attenuated by painting both of them using shades of green. This | ||
| 1960 | option thus highlights the alert and overdue states. | ||
| 1961 | - When ~modus-themes-deuteranopia~ is non-~nil~ the exact style of the habit | ||
| 1962 | graph adapts to the needs of users with red-green color deficiency by | ||
| 1963 | substituting every instance of green with blue or cyan (depending on | ||
| 1964 | the specifics). | ||
| 1965 | |||
| 1966 | [[#h:3ed03a48-20d8-4ce7-b214-0eb7e4c79abe][Option for red-green color deficiency or deuteranopia]]. | ||
| 1967 | 1724 | ||
| 1968 | For example: | 1725 | ;; Tone down intensity |
| 1726 | (setq modus-themes-common-palette-overrides | ||
| 1727 | '((prose-done green-faint) ; OR replace `green-faint' with `olive' | ||
| 1728 | (prose-todo red-faint))) ; OR replace `red-faint' with `rust' | ||
| 1969 | 1729 | ||
| 1970 | #+begin_src emacs-lisp | 1730 | ;; Keep TODO at its default (so no override for it), but make DONE |
| 1971 | (habit . nil) | 1731 | ;; gray. |
| 1972 | (habit . simplified) | 1732 | (setq modus-themes-common-palette-overrides |
| 1973 | (habit . traffic-light) | 1733 | '((prose-done fg-dim))) |
| 1974 | #+end_src | 1734 | #+end_src |
| 1975 | 1735 | ||
| 1976 | Putting it all together, the alist can look like this: | 1736 | **** Make headings more or less colorful |
| 1977 | 1737 | :PROPERTIES: | |
| 1978 | #+begin_src emacs-lisp | 1738 | :CUSTOM_ID: h:11297984-85ea-4678-abe9-a73aeab4676a |
| 1979 | '((header-block . (1.5 variable-pitch)) | 1739 | :END: |
| 1980 | (header-date . (grayscale workaholic bold-today)) | ||
| 1981 | (event . (accented varied)) | ||
| 1982 | (scheduled . uniform) | ||
| 1983 | (habit . traffic-light)) | ||
| 1984 | |||
| 1985 | ;; Or else: | ||
| 1986 | (setq modus-themes-org-agenda | ||
| 1987 | '((header-block . (1.5 variable-pitch)) | ||
| 1988 | (header-date . (grayscale workaholic bold-today)) | ||
| 1989 | (event . (accented varied)) | ||
| 1990 | (scheduled . uniform) | ||
| 1991 | (habit . traffic-light))) | ||
| 1992 | #+end_src | ||
| 1993 | 1740 | ||
| 1994 | ** Option for the headings' overall style | 1741 | This is one of our practical examples to override the semantic colors |
| 1995 | :properties: | 1742 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). |
| 1996 | :alt_title: Heading styles | 1743 | Here we show how to alter the looks of headings, such as in Org mode. |
| 1997 | :description: Choose among several styles, also per heading level | 1744 | Using overrides here offers far more flexibility than what we could |
| 1998 | :custom_id: h:271eff19-97aa-4090-9415-a6463c2f9ae1 | 1745 | achieve with previous versions of the themes: the user can mix and |
| 1999 | :end: | 1746 | match styles at will. |
| 2000 | #+vindex: modus-themes-headings | 1747 | |
| 1748 | [[#h:b57bb50b-a863-4ea8-bb38-6de2275fa868][Make TODO and DONE more intense]]. | ||
| 1749 | |||
| 1750 | #+begin_src emacs-lisp | ||
| 1751 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1752 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1753 | ;; | ||
| 1754 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1755 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1756 | ;; common overrides are best used for changes to semantic color | ||
| 1757 | ;; mappings, as we show below. | ||
| 1758 | |||
| 1759 | |||
| 1760 | ;; Apply more colorful foreground to some headings (headings 0-8). | ||
| 1761 | ;; Level 0 is for Org #+title and related. | ||
| 1762 | (setq modus-themes-common-palette-overrides | ||
| 1763 | '((fg-heading-1 blue-warmer) | ||
| 1764 | (fg-heading-2 yellow-cooler) | ||
| 1765 | (fg-heading-3 cyan-cooler))) | ||
| 1766 | |||
| 1767 | ;; Like the above, but with gradient colors | ||
| 1768 | (setq modus-themes-common-palette-overrides | ||
| 1769 | '((fg-heading-1 blue) | ||
| 1770 | (fg-heading-2 cyan) | ||
| 1771 | (fg-heading-3 green))) | ||
| 1772 | |||
| 1773 | ;; Add color to level 1 heading, but use the main foreground for | ||
| 1774 | ;; others | ||
| 1775 | (setq modus-themes-common-palette-overrides | ||
| 1776 | '((fg-heading-1 blue) | ||
| 1777 | (fg-heading-2 fg-main) | ||
| 1778 | (fg-heading-3 fg-main))) | ||
| 1779 | |||
| 1780 | ;; Apply colorful foreground, background, and overline (headings 0-8) | ||
| 1781 | (setq modus-themes-common-palette-overrides | ||
| 1782 | '((fg-heading-1 blue-warmer) | ||
| 1783 | (bg-heading-1 bg-blue-nuanced) | ||
| 1784 | (overline-heading-1 blue))) | ||
| 1785 | |||
| 1786 | ;; Apply gray scale foreground, background, and overline (headings 0-8) | ||
| 1787 | (setq modus-themes-common-palette-overrides | ||
| 1788 | '((fg-heading-1 fg-main) | ||
| 1789 | (bg-heading-1 bg-dim) | ||
| 1790 | (overline-heading-1 border))) | ||
| 1791 | #+end_src | ||
| 1792 | |||
| 1793 | **** Make Org agenda more or less colorful | ||
| 1794 | :PROPERTIES: | ||
| 1795 | :CUSTOM_ID: h:a5af0452-a50f-481d-bf60-d8143f98105f | ||
| 1796 | :END: | ||
| 2001 | 1797 | ||
| 2002 | Brief: Heading styles with optional list of values for levels 0-8. | 1798 | This is one of our practical examples to override the semantic colors |
| 1799 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). | ||
| 1800 | Here we provide three distinct code blocks. The first adds | ||
| 1801 | alternative and more varied colors to the Org agenda (and related). | ||
| 1802 | The second uses faint coloration. The third makes the agenda use | ||
| 1803 | various shades of blue. Mix and match at will, while also combining | ||
| 1804 | these styles with what we show in the other chapters with practical | ||
| 1805 | stylistic variants. | ||
| 1806 | |||
| 1807 | #+begin_src emacs-lisp | ||
| 1808 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1809 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1810 | ;; | ||
| 1811 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1812 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1813 | ;; common overrides are best used for changes to semantic color | ||
| 1814 | ;; mappings, as we show below. | ||
| 1815 | |||
| 1816 | ;; Make the Org agenda use alternative and varied colors. | ||
| 1817 | (setq modus-themes-common-palette-overrides | ||
| 1818 | '((date-common cyan) ; default value (for timestamps and more) | ||
| 1819 | (date-deadline red-warmer) | ||
| 1820 | (date-event magenta-warmer) | ||
| 1821 | (date-holiday blue) ; for M-x calendar | ||
| 1822 | (date-now yellow-warmer) | ||
| 1823 | (date-scheduled magenta-cooler) | ||
| 1824 | (date-weekday cyan-cooler) | ||
| 1825 | (date-weekend blue-faint))) | ||
| 1826 | #+end_src | ||
| 1827 | |||
| 1828 | An example with faint coloration: | ||
| 1829 | |||
| 1830 | #+begin_src emacs-lisp | ||
| 1831 | ;; Make the Org agenda use faint colors. | ||
| 1832 | (setq modus-themes-common-palette-overrides | ||
| 1833 | '((date-common cyan-faint) ; for timestamps and more | ||
| 1834 | (date-deadline red-faint) | ||
| 1835 | (date-event fg-alt) ; default | ||
| 1836 | (date-holiday magenta) ; default (for M-x calendar) | ||
| 1837 | (date-now fg-main) ; default | ||
| 1838 | (date-scheduled yellow-faint) | ||
| 1839 | (date-weekday fg-dim) | ||
| 1840 | (date-weekend fg-dim))) | ||
| 1841 | #+end_src | ||
| 1842 | |||
| 1843 | A third example that makes the agenda more blue: | ||
| 1844 | |||
| 1845 | #+begin_src emacs-lisp | ||
| 1846 | ;; Make the Org agenda use more blue instead of yellow and red. | ||
| 1847 | (setq modus-themes-common-palette-overrides | ||
| 1848 | '((date-common cyan) ; default value (for timestamps and more) | ||
| 1849 | (date-deadline blue-cooler) | ||
| 1850 | (date-event blue-faint) | ||
| 1851 | (date-holiday blue) ; for M-x calendar | ||
| 1852 | (date-now blue-faint) | ||
| 1853 | (date-scheduled blue) | ||
| 1854 | (date-weekday fg-main) | ||
| 1855 | (date-weekend fg-dim))) | ||
| 1856 | #+end_src | ||
| 1857 | |||
| 1858 | **** Make inline code in prose use alternative styles | ||
| 1859 | :PROPERTIES: | ||
| 1860 | :CUSTOM_ID: h:bb5b396f-5532-4d52-ab13-149ca24854f1 | ||
| 1861 | :END: | ||
| 2003 | 1862 | ||
| 2004 | Symbol: ~modus-themes-headings~ (=alist= type, multiple properties) | 1863 | This is one of our practical examples to override the semantic colors |
| 1864 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). In | ||
| 1865 | the following code block we show how to affect constructs such as | ||
| 1866 | Org's verbatim, code, and macro entries. We also provide mappings for | ||
| 1867 | tables, property drawers, tags, and code block delimiters, though we | ||
| 1868 | do not show every possible permutation. | ||
| 1869 | |||
| 1870 | [[#h:b57bb50b-a863-4ea8-bb38-6de2275fa868][Make TODO and DONE more or less intense]]. | ||
| 1871 | |||
| 1872 | #+begin_src emacs-lisp | ||
| 1873 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1874 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1875 | ;; | ||
| 1876 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1877 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1878 | ;; common overrides are best used for changes to semantic color | ||
| 1879 | ;; mappings, as we show below. | ||
| 1880 | |||
| 1881 | |||
| 1882 | ;; These are all the mappings at their default values for didactic | ||
| 1883 | ;; purposes | ||
| 1884 | (setq modus-themes-common-palette-overrides | ||
| 1885 | '((prose-block fg-dim) | ||
| 1886 | (prose-code green-cooler) | ||
| 1887 | (prose-done green) | ||
| 1888 | (prose-macro magenta-cooler) | ||
| 1889 | (prose-metadata fg-dim) | ||
| 1890 | (prose-metadata-value fg-alt) | ||
| 1891 | (prose-table fg-alt) | ||
| 1892 | (prose-tag magenta-faint) | ||
| 1893 | (prose-todo red) | ||
| 1894 | (prose-verbatim magenta-warmer))) | ||
| 1895 | |||
| 1896 | ;; Make code block delimiters use a shade of red, tone down | ||
| 1897 | ;; =verbatim=, ~code~, and {{{macro}}}, and amplify the style of | ||
| 1898 | ;; property drawers | ||
| 1899 | (setq modus-themes-common-palette-overrides | ||
| 1900 | '((prose-block red-faint) | ||
| 1901 | (prose-code fg-dim) | ||
| 1902 | (prose-macro magenta-faint) | ||
| 1903 | (prose-metadata cyan) | ||
| 1904 | (prose-metadata-value green-warmer) | ||
| 1905 | (prose-verbatim fg-dim))) | ||
| 1906 | |||
| 1907 | ;; Like the above but with more color variety for the inline code | ||
| 1908 | ;; elements | ||
| 1909 | (setq modus-themes-common-palette-overrides | ||
| 1910 | '((prose-block red-faint) | ||
| 1911 | (prose-code blue-cooler) | ||
| 1912 | (prose-macro yellow-warmer) | ||
| 1913 | (prose-metadata cyan) | ||
| 1914 | (prose-metadata-value green-warmer) | ||
| 1915 | (prose-verbatim red-warmer))) | ||
| 1916 | #+end_src | ||
| 1917 | |||
| 1918 | **** Make mail citations and headers more or less colorful | ||
| 1919 | :PROPERTIES: | ||
| 1920 | :CUSTOM_ID: h:7da7a4ad-5d3a-4f11-9796-5a1abed0f0c4 | ||
| 1921 | :END: | ||
| 2005 | 1922 | ||
| 2006 | This is an alist that accepts a =(key . list-of-values)= combination. | 1923 | This is one of our practical examples to override the semantic colors |
| 2007 | The key is either a number, representing the heading's level (0-8) or t, | 1924 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). In |
| 2008 | which pertains to the fallback style. | 1925 | this section we show how to change the coloration of email message |
| 1926 | headers and citations. Before we show the code, this is the anatomy | ||
| 1927 | of a message: | ||
| 1928 | |||
| 1929 | #+begin_example message | ||
| 1930 | From: Protesilaos <info@protesilaos.com> | ||
| 1931 | To: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht> | ||
| 1932 | Subject: Test subject | ||
| 1933 | --- Headers above this line; message and citations below --- | ||
| 1934 | This is some sample text | ||
| 1935 | |||
| 1936 | > > Older quote | ||
| 1937 | > Newer quote | ||
| 1938 | #+end_example | ||
| 2009 | 1939 | ||
| 2010 | Level 0 is a special heading: it is used for what counts as a document | 1940 | We thus have the following: |
| 2011 | title or equivalent, such as the =#+title= construct we find in Org | 1941 | |
| 2012 | files. Levels 1-8 are regular headings. | 1942 | #+begin_src emacs-lisp |
| 1943 | ;; These overrides are common to all Modus themes. We also provide | ||
| 1944 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 1945 | ;; | ||
| 1946 | ;; In general, the theme-specific overrides are better for overriding | ||
| 1947 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 1948 | ;; common overrides are best used for changes to semantic color | ||
| 1949 | ;; mappings, as we show below. | ||
| 1950 | |||
| 1951 | |||
| 1952 | ;; Reduce the intensity of mail citations and headers | ||
| 1953 | (setq modus-themes-common-palette-overrides | ||
| 1954 | '((mail-cite-0 cyan-faint) | ||
| 1955 | (mail-cite-1 yellow-faint) | ||
| 1956 | (mail-cite-2 green-faint) | ||
| 1957 | (mail-cite-3 red-faint) | ||
| 1958 | (mail-part olive) | ||
| 1959 | (mail-recipient indigo) | ||
| 1960 | (mail-subject maroon) | ||
| 1961 | (mail-other slate))) | ||
| 1962 | |||
| 1963 | ;; Make mail citations more intense; adjust the headers accordingly | ||
| 1964 | (setq modus-themes-common-palette-overrides | ||
| 1965 | '((mail-cite-0 blue) | ||
| 1966 | (mail-cite-1 yellow) | ||
| 1967 | (mail-cite-2 green) | ||
| 1968 | (mail-cite-3 magenta) | ||
| 1969 | (mail-part magenta-cooler) | ||
| 1970 | (mail-recipient cyan) | ||
| 1971 | (mail-subject red-warmer) | ||
| 1972 | (mail-other cyan-cooler))) | ||
| 1973 | |||
| 1974 | ;; Make all citations faint and neutral; make most headers green but | ||
| 1975 | ;; use red for the subject lie so that it stands out | ||
| 1976 | (setq modus-themes-common-palette-overrides | ||
| 1977 | '((mail-cite-0 fg-dim) | ||
| 1978 | (mail-cite-1 fg-alt) | ||
| 1979 | (mail-cite-2 fg-dim) | ||
| 1980 | (mail-cite-3 fg-alt) | ||
| 1981 | (mail-part yellow-cooler) | ||
| 1982 | (mail-recipient green-cooler) | ||
| 1983 | (mail-subject red-cooler) | ||
| 1984 | (mail-other green))) | ||
| 1985 | #+end_src | ||
| 1986 | |||
| 1987 | **** Make the region preserve text colors, plus other styles | ||
| 1988 | :PROPERTIES: | ||
| 1989 | :CUSTOM_ID: h:c8605d37-66e1-42aa-986e-d7514c3af6fe | ||
| 1990 | :END: | ||
| 2013 | 1991 | ||
| 2014 | The list of values covers symbols that refer to properties, as described | 1992 | This is one of our practical examples to override the semantic colors |
| 2015 | below. Here is a complete sample, followed by a presentation of all | 1993 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). |
| 2016 | available properties: | 1994 | Here we show how to make the region respect the underlying text colors |
| 1995 | or how to make the background more/less intense while combining it | ||
| 1996 | with an appropriate foreground value. | ||
| 2017 | 1997 | ||
| 2018 | #+begin_src emacs-lisp | 1998 | #+begin_src emacs-lisp |
| 2019 | (setq modus-themes-headings | 1999 | ;; These overrides are common to all Modus themes. We also provide |
| 2020 | '((1 . (background overline variable-pitch 1.5)) | 2000 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. |
| 2021 | (2 . (overline rainbow 1.3)) | 2001 | ;; |
| 2022 | (3 . (overline 1.1)) | 2002 | ;; In general, the theme-specific overrides are better for overriding |
| 2023 | (t . (monochrome)))) | 2003 | ;; color values, such as redefining what `blue-faint' looks like. The |
| 2024 | #+end_src | 2004 | ;; common overrides are best used for changes to semantic color |
| 2025 | 2005 | ;; mappings, as we show below. | |
| 2026 | Properties: | ||
| 2027 | |||
| 2028 | + ~rainbow~ | ||
| 2029 | + ~overline~ | ||
| 2030 | + ~background~ | ||
| 2031 | + ~monochrome~ | ||
| 2032 | + A font weight, which must be supported by the underlying typeface: | ||
| 2033 | - ~thin~ | ||
| 2034 | - ~ultralight~ | ||
| 2035 | - ~extralight~ | ||
| 2036 | - ~light~ | ||
| 2037 | - ~semilight~ | ||
| 2038 | - ~regular~ | ||
| 2039 | - ~medium~ | ||
| 2040 | - ~semibold~ | ||
| 2041 | - ~bold~ | ||
| 2042 | - ~heavy~ | ||
| 2043 | - ~extrabold~ | ||
| 2044 | - ~ultrabold~ | ||
| 2045 | + ~no-bold~ (deprecated alias of a ~regular~ weight) | ||
| 2046 | + A floating point as a height multiple of the default or a cons cell in | ||
| 2047 | the form of =(height . FLOAT)=. | ||
| 2048 | 2006 | ||
| 2049 | By default (a ~nil~ value for this variable), all headings have a bold | ||
| 2050 | typographic weight and use a desaturated text color. | ||
| 2051 | |||
| 2052 | A ~rainbow~ property makes the text color more saturated. | ||
| 2053 | 2007 | ||
| 2054 | An ~overline~ property draws a line above the area of the heading. | 2008 | ;; A background with no specific foreground (use foreground of |
| 2009 | ;; underlying text) | ||
| 2010 | (setq modus-themes-common-palette-overrides | ||
| 2011 | '((bg-region bg-ochre) ; try to replace `bg-ochre' with `bg-lavender', `bg-sage' | ||
| 2012 | (fg-region unspecified))) | ||
| 2055 | 2013 | ||
| 2056 | A ~background~ property adds a subtle tinted color to the background of | 2014 | ;; Subtle gray with a prominent blue foreground |
| 2057 | the heading. | 2015 | (setq modus-themes-common-palette-overrides |
| 2016 | '((bg-region bg-dim) | ||
| 2017 | (fg-region blue-cooler))) | ||
| 2058 | 2018 | ||
| 2059 | A ~monochrome~ property makes the heading the same as the base color, | 2019 | ;; Intense magenta background combined with the main foreground |
| 2060 | which is that of the ~default~ face's foreground. When ~background~ is also | 2020 | (setq modus-themes-common-palette-overrides |
| 2061 | set, ~monochrome~ changes its color to gray. If both ~monochrome~ and | 2021 | '((bg-region bg-magenta-intense) |
| 2062 | ~rainbow~ are set, the former takes precedence. | 2022 | (fg-region fg-main))) |
| 2023 | #+end_src | ||
| 2063 | 2024 | ||
| 2064 | A ~variable-pitch~ property changes the font family of the heading to that | 2025 | **** Make mouse highlights more or less colorful |
| 2065 | of the ~variable-pitch~ face (normally a proportionately spaced typeface). | 2026 | :PROPERTIES: |
| 2027 | :CUSTOM_ID: h:b5cab69d-d7cb-451c-8ff9-1f545ceb6caf | ||
| 2028 | :END: | ||
| 2066 | 2029 | ||
| 2067 | The symbol of a weight attribute adjusts the font of the heading | 2030 | This is one of our practical examples to override the semantic colors |
| 2068 | accordingly, such as ~light~, ~semibold~, etc. Valid symbols are | 2031 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). In |
| 2069 | defined in the variable ~modus-themes-weights~. The absence of a weight | 2032 | the following code block we show how to affect the semantic color |
| 2070 | means that bold will be used by virtue of inheriting the ~bold~ face. | 2033 | mapping that covers mouse hover effects and related highlights: |
| 2071 | For backward compatibility, the ~no-bold~ value is accepted, though | ||
| 2072 | users are encouraged to specify a ~regular~ weight instead. | ||
| 2073 | 2034 | ||
| 2074 | [[#h:2793a224-2109-4f61-a106-721c57c01375][Configure bold and italic faces]]. | 2035 | #+begin_src emacs-lisp |
| 2036 | ;; These overrides are common to all Modus themes. We also provide | ||
| 2037 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 2038 | ;; | ||
| 2039 | ;; In general, the theme-specific overrides are better for overriding | ||
| 2040 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 2041 | ;; common overrides are best used for changes to semantic color | ||
| 2042 | ;; mappings, as we show below. | ||
| 2075 | 2043 | ||
| 2076 | A number, expressed as a floating point (e.g. 1.5), adjusts the height | ||
| 2077 | of the heading to that many times the base font size. The default | ||
| 2078 | height is the same as 1.0, though it need not be explicitly stated. | ||
| 2079 | Instead of a floating point, an acceptable value can be in the form of a | ||
| 2080 | cons cell like =(height . FLOAT)= or =(height FLOAT)=, where FLOAT is | ||
| 2081 | the given number. | ||
| 2082 | 2044 | ||
| 2083 | Combinations of any of those properties are expressed as a list, like in | 2045 | ;; Make the background an intense yellow |
| 2084 | these examples: | 2046 | (setq modus-themes-common-palette-overrides |
| 2047 | '((bg-hover bg-yellow-intense))) | ||
| 2085 | 2048 | ||
| 2086 | #+begin_src emacs-lisp | 2049 | ;; Make the background subtle green |
| 2087 | (semibold) | 2050 | (setq modus-themes-common-palette-overrides |
| 2088 | (rainbow background) | 2051 | '((bg-hover bg-green-subtle))) |
| 2089 | (overline monochrome semibold 1.3) | ||
| 2090 | (overline monochrome semibold (height 1.3)) ; same as above | ||
| 2091 | (overline monochrome semibold (height . 1.3)) ; same as above | ||
| 2092 | #+end_src | 2052 | #+end_src |
| 2093 | 2053 | ||
| 2094 | The order in which the properties are set is not significant. | 2054 | **** Make language underlines less colorful |
| 2055 | :PROPERTIES: | ||
| 2056 | :CUSTOM_ID: h:03dbd5af-6bae-475e-85a2-cec189f69598 | ||
| 2057 | :END: | ||
| 2095 | 2058 | ||
| 2096 | In user configuration files the form may look like this: | 2059 | This is one of our practical examples to override the semantic colors |
| 2060 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). | ||
| 2061 | Here we show how to affect the color of the underlines that are used | ||
| 2062 | by code linters and prose spell checkers. | ||
| 2097 | 2063 | ||
| 2098 | #+begin_src emacs-lisp | 2064 | #+begin_src emacs-lisp |
| 2099 | (setq modus-themes-headings | 2065 | ;; These overrides are common to all Modus themes. We also provide |
| 2100 | '((1 . (background overline rainbow 1.5)) | 2066 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. |
| 2101 | (2 . (background overline 1.3)) | 2067 | ;; |
| 2102 | (t . (overline semibold)))) | 2068 | ;; In general, the theme-specific overrides are better for overriding |
| 2103 | #+end_src | 2069 | ;; color values, such as redefining what `blue-faint' looks like. The |
| 2070 | ;; common overrides are best used for changes to semantic color | ||
| 2071 | ;; mappings, as we show below. | ||
| 2104 | 2072 | ||
| 2105 | When defining the styles per heading level, it is possible to pass a | ||
| 2106 | non-~nil~ value (~t~) instead of a list of properties. This will retain the | ||
| 2107 | original aesthetic for that level. For example: | ||
| 2108 | 2073 | ||
| 2109 | #+begin_src emacs-lisp | 2074 | ;; Make the underlines less intense |
| 2110 | (setq modus-themes-headings | 2075 | (setq modus-themes-common-palette-overrides |
| 2111 | '((1 . t) ; keep the default style | 2076 | '((underline-err red-faint) |
| 2112 | (2 . (background overline)) | 2077 | (underline-warning yellow-faint) |
| 2113 | (t . (rainbow)))) ; style for all other headings | 2078 | (underline-note cyan-faint))) |
| 2114 | 2079 | ||
| 2115 | (setq modus-themes-headings | 2080 | ;; Change the color-coding of the underlines |
| 2116 | '((1 . (background overline)) | 2081 | (setq modus-themes-common-palette-overrides |
| 2117 | (2 . (rainbow semibold)) | 2082 | '((underline-err yellow-intense) |
| 2118 | (t . t))) ; default style for all other levels | 2083 | (underline-warning magenta-intense) |
| 2084 | (underline-note green-intense))) | ||
| 2119 | #+end_src | 2085 | #+end_src |
| 2120 | 2086 | ||
| 2121 | For Org users, the extent of the heading depends on the variable | 2087 | **** Make line numbers use alternative styles |
| 2122 | ~org-fontify-whole-heading-line~. This affects the ~overline~ and | 2088 | :PROPERTIES: |
| 2123 | ~background~ properties. Depending on the version of Org, there may be | 2089 | :CUSTOM_ID: h:b6466f51-cb58-4007-9ebe-53a27af655c7 |
| 2124 | others, such as ~org-fontify-done-headline~. | 2090 | :END: |
| 2125 | |||
| 2126 | ** Option for variable-pitch font in UI elements | ||
| 2127 | :properties: | ||
| 2128 | :alt_title: UI typeface | ||
| 2129 | :description: Toggle the use of variable-pitch across the User Interface | ||
| 2130 | :custom_id: h:16cf666c-5e65-424c-a855-7ea8a4a1fcac | ||
| 2131 | :end: | ||
| 2132 | #+vindex: modus-themes-variable-pitch-ui | ||
| 2133 | |||
| 2134 | Brief: Toggle the use of proportionately spaced (~variable-pitch~) fonts | ||
| 2135 | in the User Interface. | ||
| 2136 | 2091 | ||
| 2137 | Symbol: ~modus-themes-variable-pitch-ui~ (=boolean= type) | 2092 | This is one of our practical examples to override the semantic colors |
| 2093 | of the Modus themes ([[#h:df1199d8-eaba-47db-805d-6b568a577bf3][Stylistic variants using palette overrides]]). In | ||
| 2094 | this section we show how to affect the ~display-line-numbers-mode~. | ||
| 2138 | 2095 | ||
| 2139 | Possible values: | 2096 | #+begin_src emacs-lisp |
| 2097 | ;; These overrides are common to all Modus themes. We also provide | ||
| 2098 | ;; theme-specific options, such as `modus-operandi-palette-overrides'. | ||
| 2099 | ;; | ||
| 2100 | ;; In general, the theme-specific overrides are better for overriding | ||
| 2101 | ;; color values, such as redefining what `blue-faint' looks like. The | ||
| 2102 | ;; common overrides are best used for changes to semantic color | ||
| 2103 | ;; mappings, as we show below. | ||
| 2140 | 2104 | ||
| 2141 | 1. ~nil~ (default) | ||
| 2142 | 2. ~t~ | ||
| 2143 | 2105 | ||
| 2144 | This option concerns User Interface elements that are under the direct | 2106 | ;; Make line numbers less intense |
| 2145 | control of Emacs. In particular: the mode line, header line, tab bar, | 2107 | (setq modus-themes-common-palette-overrides |
| 2146 | and tab line. | 2108 | '((fg-line-number-inactive "gray50") |
| 2109 | (fg-line-number-active fg-main) | ||
| 2110 | (bg-line-number-inactive unspecified) | ||
| 2111 | (bg-line-number-active unspecified))) | ||
| 2147 | 2112 | ||
| 2148 | The default is to use the same font as the rest of Emacs, which usually | 2113 | ;; Like the above, but use a shade of red for the current line number |
| 2149 | is a monospaced family. | 2114 | (setq modus-themes-common-palette-overrides |
| 2150 | 2115 | '((fg-line-number-inactive "gray50") | |
| 2151 | With a non-~nil~ value (~t~) apply a proportionately spaced typeface. This | 2116 | (fg-line-number-active red-cooler) |
| 2152 | is done by assigning the ~variable-pitch~ face to the relevant items. | 2117 | (bg-line-number-inactive unspecified) |
| 2118 | (bg-line-number-active unspecified))) | ||
| 2153 | 2119 | ||
| 2154 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. | 2120 | ;; Make all numbers more intense, use a more pronounce gray |
| 2121 | ;; background, and make the current line have a colored background | ||
| 2122 | (setq modus-themes-common-palette-overrides | ||
| 2123 | '((fg-line-number-inactive fg-main) | ||
| 2124 | (fg-line-number-active fg-main) | ||
| 2125 | (bg-line-number-inactive bg-inactive) | ||
| 2126 | (bg-line-number-active bg-cyan-intense))) | ||
| 2127 | #+end_src | ||
| 2155 | 2128 | ||
| 2156 | * Advanced customization | 2129 | * Advanced customization |
| 2157 | :properties: | 2130 | :properties: |
| @@ -2220,7 +2193,7 @@ the background). It thus falls back to the closest approximation, which | |||
| 2220 | seldom is appropriate for the purposes of the Modus themes. | 2193 | seldom is appropriate for the purposes of the Modus themes. |
| 2221 | 2194 | ||
| 2222 | In such a case, the user is expected to update their terminal's color | 2195 | In such a case, the user is expected to update their terminal's color |
| 2223 | palette such as by adapting these resources: | 2196 | palette such as by adapting these resources ([[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Preview theme colors]]): |
| 2224 | 2197 | ||
| 2225 | #+begin_src emacs-lisp | 2198 | #+begin_src emacs-lisp |
| 2226 | ! Theme: modus-operandi | 2199 | ! Theme: modus-operandi |
| @@ -2268,27 +2241,43 @@ xterm*color14: #6ae4b9 | |||
| 2268 | xterm*color15: #ffffff | 2241 | xterm*color15: #ffffff |
| 2269 | #+end_src | 2242 | #+end_src |
| 2270 | 2243 | ||
| 2271 | ** Visualize the active Modus theme's palette | 2244 | ** Preview theme colors |
| 2272 | :properties: | 2245 | :properties: |
| 2273 | :custom_id: h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d | 2246 | :custom_id: h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d |
| 2274 | :end: | 2247 | :end: |
| 2248 | #+cindex: Preview named colors or semantic color mappings | ||
| 2249 | |||
| 2275 | #+findex: modus-themes-list-colors | 2250 | #+findex: modus-themes-list-colors |
| 2276 | #+findex: modus-themes-list-colors-current | 2251 | #+findex: modus-themes-list-colors-current |
| 2277 | #+cindex: Preview color values | ||
| 2278 | |||
| 2279 | The command ~modus-themes-list-colors~ prompts for a choice between | 2252 | The command ~modus-themes-list-colors~ prompts for a choice between |
| 2280 | =modus-operandi= and =modus-vivendi= to produce a help buffer that shows a | 2253 | =modus-operandi= and =modus-vivendi= to produce a help buffer that |
| 2281 | preview of each variable in the given theme's color palette. The | 2254 | shows a preview of the named colors in the given theme's palette. The |
| 2282 | command ~modus-themes-list-colors-current~ skips the prompt, using the | 2255 | command ~modus-themes-list-colors-current~ skips the prompt, using the |
| 2283 | current Modus theme. | 2256 | current Modus theme. |
| 2284 | 2257 | ||
| 2258 | When called with a prefix argument (=C-u= with the default key | ||
| 2259 | bindings), these commands will show a preview of the palette's | ||
| 2260 | semantic color mappings instead of the named colors. | ||
| 2261 | |||
| 2262 | In this context, "named colors" are entries that associate a symbol to | ||
| 2263 | a string color value, such as =(blue-warmer "#354fcf")=. Whereas | ||
| 2264 | "semantic color mappings" associate a named color to a symbol, like | ||
| 2265 | =(string blue-warmer)=, thus making the theme render all string | ||
| 2266 | constructs in the =blue-warmer= color value ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). | ||
| 2267 | |||
| 2268 | #+findex: modus-themes-preview-colors | ||
| 2269 | #+findex: modus-themes-preview-colors-current | ||
| 2270 | Aliases for those commands are ~modus-themes-preview-colors~ and | ||
| 2271 | ~modus-themes-preview-colors-current~. | ||
| 2272 | |||
| 2285 | Each row shows a foreground and background coloration using the | 2273 | Each row shows a foreground and background coloration using the |
| 2286 | underlying value it references. For example a line with =#a60000= (a | 2274 | underlying value it references. For example a line with =#a60000= (a |
| 2287 | shade of red) will show red text followed by a stripe with that same | 2275 | shade of red) will show red text followed by a stripe with that same |
| 2288 | color as a backdrop. | 2276 | color as a backdrop. |
| 2289 | 2277 | ||
| 2290 | The name of the buffer describes the given Modus theme. It is thus | 2278 | The name of the buffer describes the given Modus theme and what the |
| 2291 | called =*modus-operandi-list-colors*= or =*modus-vivendi-list-colors*=. | 2279 | contents are, such as =*modus-operandi-list-colors*= for named colors |
| 2280 | and ==*modus-operandi-list-mappings*= for the semantic color mappings. | ||
| 2292 | 2281 | ||
| 2293 | ** Per-theme customization settings | 2282 | ** Per-theme customization settings |
| 2294 | :properties: | 2283 | :properties: |
| @@ -2306,12 +2295,12 @@ other). | |||
| 2306 | (defun my-demo-modus-operandi () | 2295 | (defun my-demo-modus-operandi () |
| 2307 | (interactive) | 2296 | (interactive) |
| 2308 | (setq modus-themes-bold-constructs t) ; ENABLE bold | 2297 | (setq modus-themes-bold-constructs t) ; ENABLE bold |
| 2309 | (modus-themes-load-operandi)) | 2298 | (modus-themes-load-theme 'modus-operandi)) |
| 2310 | 2299 | ||
| 2311 | (defun my-demo-modus-vivendi () | 2300 | (defun my-demo-modus-vivendi () |
| 2312 | (interactive) | 2301 | (interactive) |
| 2313 | (setq modus-themes-bold-constructs nil) ; DISABLE bold | 2302 | (setq modus-themes-bold-constructs nil) ; DISABLE bold |
| 2314 | (modus-themes-load-vivendi)) | 2303 | (modus-themes-load-theme 'modus-vivendi)) |
| 2315 | 2304 | ||
| 2316 | (defun my-demo-modus-themes-toggle () | 2305 | (defun my-demo-modus-themes-toggle () |
| 2317 | (if (eq (car custom-enabled-themes) 'modus-operandi) | 2306 | (if (eq (car custom-enabled-themes) 'modus-operandi) |
| @@ -2325,231 +2314,103 @@ equivalent the themes provide. | |||
| 2325 | For a more elaborate design, it is better to inspect the source code of | 2314 | For a more elaborate design, it is better to inspect the source code of |
| 2326 | ~modus-themes-toggle~ and relevant functions. | 2315 | ~modus-themes-toggle~ and relevant functions. |
| 2327 | 2316 | ||
| 2328 | ** Case-by-case face specs using the themes' palette | 2317 | ** Use theme colors in code with modus-themes-with-colors |
| 2329 | :properties: | 2318 | :properties: |
| 2330 | :custom_id: h:1487c631-f4fe-490d-8d58-d72ffa3bd474 | 2319 | :custom_id: h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae |
| 2331 | :end: | 2320 | :end: |
| 2332 | #+findex: modus-themes-color | 2321 | #+cindex: Use colors from the palette anywhere |
| 2333 | #+findex: modus-themes-color-alts | ||
| 2334 | #+cindex: Extracting individual colors | ||
| 2335 | 2322 | ||
| 2336 | This section is about tweaking individual faces. If you plan to do | 2323 | Note that users most probably do not need the following. Just rely on |
| 2337 | things at scale, consult the next section: [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Set multiple faces]]. | 2324 | the comprehensive overrides we provide ([[#h:34c7a691-19bb-4037-8d2f-67a07edab150][Option for palette overrides]]). |
| 2338 | 2325 | ||
| 2339 | We already covered in previous sections how to toggle between the themes | 2326 | #+findex: modus-themes-with-colors |
| 2340 | and how to configure options prior to loading. We also explained that | 2327 | Advanced users may want to apply colors from the palette of the active |
| 2341 | some of the functions made available to users will fire up a hook that | 2328 | Modus theme in their custom code. The ~modus-themes-with-colors~ |
| 2342 | can be used to pass tweaks in the post-theme-load phase. | 2329 | macro supplies those to any form called inside of it. For example: |
| 2343 | |||
| 2344 | Now assume you wish to change a single face, say, the ~cursor~. And you | ||
| 2345 | would like to get the standard "blue" color value of the active Modus | ||
| 2346 | theme, whether it is Modus Operandi or Modus Vivendi. To do that, you | ||
| 2347 | can use the ~modus-themes-color~ function. It accepts a symbol that is | ||
| 2348 | associated with a color in ~modus-themes-operandi-colors~ and | ||
| 2349 | ~modus-themes-vivendi-colors~. Like this: | ||
| 2350 | 2330 | ||
| 2351 | #+begin_src emacs-lisp | 2331 | #+begin_src emacs-lisp |
| 2352 | (modus-themes-color 'blue) | 2332 | (modus-themes-with-colors |
| 2333 | (list blue-warmer magenta-cooler fg-added warning variable fg-heading-4)) | ||
| 2334 | ;; => ("#354fcf" "#531ab6" "#005000" "#884900" "#005e8b" "#721045") | ||
| 2353 | #+end_src | 2335 | #+end_src |
| 2354 | 2336 | ||
| 2355 | The function always extracts the color value of the active Modus theme. | 2337 | The above return value is for ~modus-operandi~ when that is the active |
| 2338 | theme. Switching to another theme and evaluating this code anew will | ||
| 2339 | give us the relevant results for that theme (remember that since | ||
| 2340 | version 4, the Modus themes consist of six items ([[#h:f0f3dbcb-602d-40cf-b918-8f929c441baf][Overview]])). The | ||
| 2341 | same with ~modus-vivendi~ as the active theme: | ||
| 2356 | 2342 | ||
| 2357 | #+begin_src emacs-lisp | 2343 | #+begin_src emacs-lisp |
| 2358 | (progn | 2344 | (modus-themes-with-colors |
| 2359 | (load-theme 'modus-operandi t) | 2345 | (list blue-warmer magenta-cooler fg-added warning variable fg-heading-4)) |
| 2360 | (modus-themes-color 'blue)) ; "#0031a9" for `modus-operandi' | 2346 | ;; => ("#79a8ff" "#b6a0ff" "#a0e0a0" "#fec43f" "#00d3d0" "#feacd0") |
| 2361 | |||
| 2362 | (progn | ||
| 2363 | (load-theme 'modus-vivendi t) | ||
| 2364 | (modus-themes-color 'blue)) ; "#2fafff" for `modus-vivendi' | ||
| 2365 | #+end_src | 2347 | #+end_src |
| 2366 | 2348 | ||
| 2367 | Do {{{kbd(C-h v)}}} on the aforementioned variables to check all the available | 2349 | The ~modus-themes-with-colors~ has access to the whole palette of the |
| 2368 | symbols that can be passed to this function. Or simply invoke the | 2350 | active theme, meaning that it can instantiate both (i) named colors |
| 2369 | command ~modus-themes-list-colors~ to produce a buffer with a preview of | 2351 | like =blue-warmer= and (ii) semantic color mappings like =warning=. |
| 2370 | each entry in the palette. | 2352 | We provide commands to inspect those ([[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Preview theme colors]]). |
| 2371 | 2353 | ||
| 2372 | [[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Visualize the active Modus theme's palette]]. | 2354 | Others sections in this manual show how to use the aforementioned |
| 2373 | 2355 | macro ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]). | |
| 2374 | With that granted, let us expand the example to actually change the | ||
| 2375 | ~cursor~ face's background property. We employ the built-in function of | ||
| 2376 | ~set-face-attribute~: | ||
| 2377 | 2356 | ||
| 2378 | #+begin_src emacs-lisp | 2357 | ** Add padding to mode line |
| 2379 | (set-face-attribute 'cursor nil :background (modus-themes-color 'blue)) | 2358 | :PROPERTIES: |
| 2380 | #+end_src | 2359 | :CUSTOM_ID: h:5a0c58cc-f97f-429c-be08-927b9fbb0a9c |
| 2360 | :END: | ||
| 2381 | 2361 | ||
| 2382 | If you evaluate this form, your cursor will become blue. But if you | 2362 | Emacs faces do not have a concept of "padding" for the space between |
| 2383 | change themes, such as with ~modus-themes-toggle~, your edits will be | 2363 | the text and its box boundaries. We can approximate the effect by |
| 2384 | lost, because the newly loaded theme will override the ~:background~ | 2364 | adding a =:box= attribute, making its border several pixels thick, and |
| 2385 | attribute you had assigned to that face. | 2365 | using the mode line's background color for it. This way the thick |
| 2366 | border will not stand out and will appear as a continuation of the | ||
| 2367 | mode line. | ||
| 2386 | 2368 | ||
| 2387 | For such changes to persist, we need to make them after loading the | 2369 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 2388 | theme. So we rely on ~modus-themes-after-load-theme-hook~, which gets | ||
| 2389 | called from ~modus-themes-load-operandi~, ~modus-themes-load-vivendi~, as | ||
| 2390 | well as the command ~modus-themes-toggle~. Here is a sample function that | ||
| 2391 | tweaks two faces and then gets added to the hook: | ||
| 2392 | 2370 | ||
| 2393 | #+begin_src emacs-lisp | 2371 | #+begin_src emacs-lisp |
| 2394 | (defun my-modus-themes-custom-faces () | 2372 | (defun my-modus-themes-custom-faces () |
| 2395 | (set-face-attribute 'cursor nil :background (modus-themes-color 'blue)) | 2373 | (modus-themes-with-colors |
| 2396 | (set-face-attribute 'font-lock-type-face nil :foreground (modus-themes-color 'magenta-alt))) | 2374 | (custom-set-faces |
| 2375 | ;; Add "padding" to the mode lines | ||
| 2376 | `(mode-line ((,c :box (:line-width 10 :color ,bg-mode-line-active)))) | ||
| 2377 | `(mode-line-inactive ((,c :box (:line-width 10 :color ,bg-mode-line-inactive))))))) | ||
| 2397 | 2378 | ||
| 2398 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | 2379 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) |
| 2399 | #+end_src | 2380 | #+end_src |
| 2400 | 2381 | ||
| 2401 | [[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]. | 2382 | The above has the effect of removing the border around the mode lines. |
| 2402 | 2383 | In older versions of the themes, we provided the option for a padded | |
| 2403 | Using this principle, it is possible to override the styles of faces | 2384 | mode line which could also have borders around it. Those were not |
| 2404 | without having to find color values for each case. | 2385 | real border, however, but an underline and an overline. Adjusting the |
| 2405 | 2386 | above: | |
| 2406 | Another application is to control the precise weight for bold | ||
| 2407 | constructs. This is particularly useful if your typeface has several | ||
| 2408 | variants such as "heavy", "extrabold", "semibold". All you have to do | ||
| 2409 | is edit the ~bold~ face. For example: | ||
| 2410 | |||
| 2411 | #+begin_src emacs-lisp | ||
| 2412 | (set-face-attribute 'bold nil :weight 'semibold) | ||
| 2413 | #+end_src | ||
| 2414 | |||
| 2415 | Remember to use the custom function and hook combo we demonstrated | ||
| 2416 | above. Because the themes do not hard-wire a specific weight, this | ||
| 2417 | simple form is enough to change the weight of all bold constructs | ||
| 2418 | throughout the interface. | ||
| 2419 | |||
| 2420 | Finally, there are cases where you want to tweak colors though wish to | ||
| 2421 | apply different ones to each theme, say, a blue hue for Modus Operandi | ||
| 2422 | and a shade of red for Modus Vivendi. To this end, we provide | ||
| 2423 | ~modus-themes-color-alts~ as a convenience function to save you from the | ||
| 2424 | trouble of writing separate wrappers for each theme. It still returns a | ||
| 2425 | single value by querying either of ~modus-themes-operandi-colors~ and | ||
| 2426 | ~modus-themes-vivendi-colors~, only here you pass the two keys you want, | ||
| 2427 | first for ~modus-operandi~ then ~modus-vivendi~. | ||
| 2428 | |||
| 2429 | Take the previous example with the ~cursor~ face: | ||
| 2430 | |||
| 2431 | #+begin_src emacs-lisp | ||
| 2432 | ;; Blue for `modus-operandi' and red for `modus-vivendi' | ||
| 2433 | (set-face-attribute 'cursor nil :background (modus-themes-color-alts 'blue 'red)) | ||
| 2434 | #+end_src | ||
| 2435 | |||
| 2436 | ** Face specs at scale using the themes' palette | ||
| 2437 | :properties: | ||
| 2438 | :custom_id: h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae | ||
| 2439 | :end: | ||
| 2440 | #+findex: modus-themes-with-colors | ||
| 2441 | #+cindex: Extracting colors en masse | ||
| 2442 | |||
| 2443 | The examples here are for large scale operations. For simple, one-off | ||
| 2444 | tweaks, you may prefer the approach documented in the previous section | ||
| 2445 | ([[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Case-by-case face specs using the themes' palette]]). | ||
| 2446 | |||
| 2447 | The ~modus-themes-with-colors~ macro lets you retrieve multiple color | ||
| 2448 | values by employing the backquote/backtick and comma notation. The | ||
| 2449 | values are stored in the alists ~modus-themes-operandi-colors~ and | ||
| 2450 | ~modus-themes-vivendi-colors~, while the macro always queries that of the | ||
| 2451 | active Modus theme (preview the current palette with the command | ||
| 2452 | ~modus-themes-list-colors~). | ||
| 2453 | |||
| 2454 | [[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Visualize the active Modus theme's palette]]. | ||
| 2455 | |||
| 2456 | Here is an abstract example that just returns a list of color values | ||
| 2457 | while ~modus-operandi~ is enabled: | ||
| 2458 | |||
| 2459 | #+begin_src emacs-lisp | ||
| 2460 | (modus-themes-with-colors | ||
| 2461 | (list fg-main | ||
| 2462 | blue-faint | ||
| 2463 | magenta | ||
| 2464 | magenta-alt-other | ||
| 2465 | cyan-alt-other | ||
| 2466 | fg-special-cold | ||
| 2467 | blue-alt | ||
| 2468 | magenta-faint | ||
| 2469 | cyan | ||
| 2470 | fg-main | ||
| 2471 | green-faint | ||
| 2472 | red-alt-faint | ||
| 2473 | blue-alt-faint | ||
| 2474 | fg-special-warm | ||
| 2475 | cyan-alt | ||
| 2476 | blue)) | ||
| 2477 | ;; => | ||
| 2478 | ;; ("#000000" "#002f88" "#721045" "#5317ac" | ||
| 2479 | ;; "#005a5f" "#093060" "#2544bb" "#752f50" | ||
| 2480 | ;; "#00538b" "#000000" "#104410" "#702f00" | ||
| 2481 | ;; "#003f78" "#5d3026" "#30517f" "#0031a9") | ||
| 2482 | #+end_src | ||
| 2483 | |||
| 2484 | Getting a list of colors may have its applications, though what you are | ||
| 2485 | most likely interested in is how to use those variables to configure | ||
| 2486 | several faces at once. To do so we can rely on the built-in | ||
| 2487 | ~custom-set-faces~ function, which sets face specifications for the | ||
| 2488 | special ~user~ theme. That "theme" gets applied on top of regular themes | ||
| 2489 | like ~modus-operandi~ and ~modus-vivendi~. | ||
| 2490 | |||
| 2491 | This is how it works: | ||
| 2492 | |||
| 2493 | #+begin_src emacs-lisp | ||
| 2494 | (modus-themes-with-colors | ||
| 2495 | (custom-set-faces | ||
| 2496 | `(cursor ((,class :background ,blue))) | ||
| 2497 | `(mode-line ((,class :background ,yellow-nuanced-bg | ||
| 2498 | :foreground ,yellow-nuanced-fg))) | ||
| 2499 | `(mode-line-inactive ((,class :background ,blue-nuanced-bg | ||
| 2500 | :foreground ,blue-nuanced-fg))))) | ||
| 2501 | #+end_src | ||
| 2502 | |||
| 2503 | The above snippet will immediately refashion the faces it names once it | ||
| 2504 | is evaluated. However, if you switch between the Modus themes, say, | ||
| 2505 | from ~modus-operandi~ to ~modus-vivendi~, the colors will not get updated to | ||
| 2506 | match those of the new theme. To make things work across the themes, we | ||
| 2507 | need to employ the same technique we discussed in the previous section, | ||
| 2508 | namely, to pass our changes at the post-theme-load phase via a hook. | ||
| 2509 | |||
| 2510 | The themes provide the ~modus-themes-after-load-theme-hook~, which gets | ||
| 2511 | called from ~modus-themes-load-operandi~, ~modus-themes-load-vivendi~, as | ||
| 2512 | well as the command ~modus-themes-toggle~. With this knowledge, you can | ||
| 2513 | wrap the macro in a function and then assign that function to the hook. | ||
| 2514 | Thus: | ||
| 2515 | 2387 | ||
| 2516 | #+begin_src emacs-lisp | 2388 | #+begin_src emacs-lisp |
| 2517 | (defun my-modus-themes-custom-faces () | 2389 | (defun my-modus-themes-custom-faces () |
| 2518 | (modus-themes-with-colors | 2390 | (modus-themes-with-colors |
| 2519 | (custom-set-faces | 2391 | (custom-set-faces |
| 2520 | `(cursor ((,class :background ,blue))) | 2392 | ;; Add "padding" to the mode lines |
| 2521 | `(mode-line ((,class :background ,yellow-nuanced-bg | 2393 | `(mode-line ((,c :underline ,border-mode-line-active |
| 2522 | :foreground ,yellow-nuanced-fg))) | 2394 | :overline ,border-mode-line-active |
| 2523 | `(mode-line-inactive ((,class :background ,blue-nuanced-bg | 2395 | :box (:line-width 10 :color ,bg-mode-line-active)))) |
| 2524 | :foreground ,blue-nuanced-fg)))))) | 2396 | `(mode-line-inactive ((,c :underline ,border-mode-line-inactive |
| 2397 | :overline ,border-mode-line-inactive | ||
| 2398 | :box (:line-width 10 :color ,bg-mode-line-inactive))))))) | ||
| 2399 | |||
| 2400 | ;; ESSENTIAL to make the underline move to the bottom of the box: | ||
| 2401 | (setq x-underline-at-descent-line t) | ||
| 2525 | 2402 | ||
| 2526 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | 2403 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) |
| 2527 | #+end_src | 2404 | #+end_src |
| 2528 | 2405 | ||
| 2529 | [[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]. | 2406 | The reason we no longer provide this option is because it depends on a |
| 2530 | 2407 | non-nil value for ~x-underline-at-descent-line~. That variable | |
| 2531 | To discover the faces defined by all loaded libraries, you may do | 2408 | affects ALL underlines, including those of links. The effect is |
| 2532 | {{{kbd(M-x list-faces-display)}}}. Be warned that when you ~:inherit~ a face | 2409 | intrusive and looks awkard in prose. |
| 2533 | you are introducing an implicit dependency, so try to avoid doing so for | ||
| 2534 | libraries other than the built-in {{{file(faces.el)}}} (or at least understand | ||
| 2535 | that things may break if you inherit from a yet-to-be-loaded face). | ||
| 2536 | 2410 | ||
| 2537 | Also bear in mind that these examples are meant to work with the Modus | 2411 | As such, the Modus themes no longer provide that option but instead |
| 2538 | themes. If you are cycling between multiple themes you may encounter | 2412 | offer this piece of documentation to make the user fully aware of the |
| 2539 | unforeseen issues, such as the colors of the Modus themes being applied | 2413 | state of affairs. |
| 2540 | to a non-Modus item. | ||
| 2541 | |||
| 2542 | Finally, note that you can still use other functions where those make | ||
| 2543 | sense. For example, the ~modus-themes-color-alts~ that was discussed in | ||
| 2544 | the previous section. Adapt the above example like this: | ||
| 2545 | |||
| 2546 | #+begin_src emacs-lisp | ||
| 2547 | ... | ||
| 2548 | (modus-themes-with-colors | ||
| 2549 | (custom-set-faces | ||
| 2550 | `(cursor ((,class :background ,(modus-themes-color-alts 'blue 'green)))) | ||
| 2551 | ...)) | ||
| 2552 | #+end_src | ||
| 2553 | 2414 | ||
| 2554 | ** Remap face with local value | 2415 | ** Remap face with local value |
| 2555 | :properties: | 2416 | :properties: |
| @@ -2564,7 +2425,7 @@ activates ~hl-line-mode~, but we wish to keep it distinct from other | |||
| 2564 | buffers. This is where ~face-remap-add-relative~ can be applied and may | 2425 | buffers. This is where ~face-remap-add-relative~ can be applied and may |
| 2565 | be combined with ~modus-themes-with-colors~ to deliver consistent results. | 2426 | be combined with ~modus-themes-with-colors~ to deliver consistent results. |
| 2566 | 2427 | ||
| 2567 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | 2428 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 2568 | 2429 | ||
| 2569 | In this example we will write a simple interactive function that adjusts | 2430 | In this example we will write a simple interactive function that adjusts |
| 2570 | the background color of the ~region~ face. This is the sample code: | 2431 | the background color of the ~region~ face. This is the sample code: |
| @@ -2572,12 +2433,12 @@ the background color of the ~region~ face. This is the sample code: | |||
| 2572 | #+begin_src emacs-lisp | 2433 | #+begin_src emacs-lisp |
| 2573 | (defvar my-rainbow-region-colors | 2434 | (defvar my-rainbow-region-colors |
| 2574 | (modus-themes-with-colors | 2435 | (modus-themes-with-colors |
| 2575 | `((red . ,red-subtle-bg) | 2436 | `((red . ,bg-red-subtle) |
| 2576 | (green . ,green-subtle-bg) | 2437 | (green . ,bg-green-subtle) |
| 2577 | (yellow . ,yellow-subtle-bg) | 2438 | (yellow . ,bg-yellow-subtle) |
| 2578 | (blue . ,blue-subtle-bg) | 2439 | (blue . ,bg-blue-subtle) |
| 2579 | (magenta . ,magenta-subtle-bg) | 2440 | (magenta . ,bg-magenta-subtle) |
| 2580 | (cyan . ,cyan-subtle-bg))) | 2441 | (cyan . ,bg-cyan-subtle))) |
| 2581 | "Sample list of color values for `my-rainbow-region'.") | 2442 | "Sample list of color values for `my-rainbow-region'.") |
| 2582 | 2443 | ||
| 2583 | (defun my-rainbow-region (color) | 2444 | (defun my-rainbow-region (color) |
| @@ -2613,768 +2474,6 @@ Perhaps you may wish to generalize those findings in to a set of | |||
| 2613 | functions that also accept an arbitrary face. We shall leave the | 2474 | functions that also accept an arbitrary face. We shall leave the |
| 2614 | experimentation up to you. | 2475 | experimentation up to you. |
| 2615 | 2476 | ||
| 2616 | ** Cycle through arbitrary colors | ||
| 2617 | :properties: | ||
| 2618 | :custom_id: h:77dc4a30-b96a-4849-85a8-fee3c2995305 | ||
| 2619 | :end: | ||
| 2620 | #+cindex: Cycle colors | ||
| 2621 | |||
| 2622 | Users may opt to customize individual faces of the themes to accommodate | ||
| 2623 | their particular needs. One such case is with the color intensity of | ||
| 2624 | comments, specifically the foreground of ~font-lock-comment-face~. The | ||
| 2625 | Modus themes set that to a readable value, in accordance with their | ||
| 2626 | accessibility objective, though users may prefer to lower the overall | ||
| 2627 | contrast on an on-demand basis. | ||
| 2628 | |||
| 2629 | One way to achieve this is to design a command that cycles through three | ||
| 2630 | distinct levels of intensity, though the following can be adapted to any | ||
| 2631 | kind of cyclic behavior, such as to switch between red, green, and blue. | ||
| 2632 | |||
| 2633 | In the following example, we employ the ~modus-themes-color~ function | ||
| 2634 | which reads a symbol that represents an entry in the active theme's | ||
| 2635 | color palette ([[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Case-by-case face specs using the themes' palette]]). | ||
| 2636 | Those are stored in ~my-modus-themes-comment-colors~. | ||
| 2637 | |||
| 2638 | #+begin_src emacs-lisp | ||
| 2639 | (defvar my-modus-themes-comment-colors | ||
| 2640 | ;; We are abusing the palette here, as those colors have their own | ||
| 2641 | ;; purpose in the palette, so please ignore the semantics of their | ||
| 2642 | ;; names. | ||
| 2643 | '((low . bg-region) | ||
| 2644 | (medium . bg-tab-inactive-alt) | ||
| 2645 | (high . fg-alt)) | ||
| 2646 | "Alist of levels of intensity mapped to color palette entries. | ||
| 2647 | The entries are found in `modus-themes-operandi-colors' or | ||
| 2648 | `modus-themes-vivendi-colors'.") | ||
| 2649 | |||
| 2650 | (defvar my-modus-themes--adjust-comment-color-state nil | ||
| 2651 | "The cyclic state of `my-modus-themes-adjust-comment-color'. | ||
| 2652 | For internal use.") | ||
| 2653 | |||
| 2654 | (defun my-modus-themes--comment-foreground (degree state) | ||
| 2655 | "Set `font-lock-comment-face' foreground. | ||
| 2656 | Use `my-modus-themes-comment-colors' to extract the color value | ||
| 2657 | for each level of intensity. | ||
| 2658 | |||
| 2659 | This is complementary to `my-modus-themes-adjust-comment-color'." | ||
| 2660 | (let ((palette-colors my-modus-themes-comment-colors)) | ||
| 2661 | (set-face-foreground | ||
| 2662 | 'font-lock-comment-face | ||
| 2663 | (modus-themes-color (alist-get degree palette-colors))) | ||
| 2664 | (setq my-modus-themes--adjust-comment-color-state state) | ||
| 2665 | (message "Comments are set to %s contrast" degree))) | ||
| 2666 | |||
| 2667 | (defun my-modus-themes-adjust-comment-color () | ||
| 2668 | "Cycle through levels of intensity for comments. | ||
| 2669 | The levels are determined by `my-modus-themes-comment-colors'." | ||
| 2670 | (interactive) | ||
| 2671 | (pcase my-modus-themes--adjust-comment-color-state | ||
| 2672 | ('nil | ||
| 2673 | (my-modus-themes--comment-foreground 'low 1)) | ||
| 2674 | (1 | ||
| 2675 | (my-modus-themes--comment-foreground 'medium 2)) | ||
| 2676 | (_ | ||
| 2677 | (my-modus-themes--comment-foreground 'high nil)))) | ||
| 2678 | #+end_src | ||
| 2679 | |||
| 2680 | With the above, {{{kbd(M-x my-modus-themes-adjust-comment-color)}}} will cycle | ||
| 2681 | through the three levels of intensity that have been specified. | ||
| 2682 | |||
| 2683 | Another approach is to not read from the active theme's color palette | ||
| 2684 | and instead provide explicit color values, either in hexadecimal RGB | ||
| 2685 | notation (like =#123456=) or as the names that are displayed in the output | ||
| 2686 | of {{{kbd(M-x list-colors-display)}}}. In this case, the alist with the | ||
| 2687 | colors will have to account for the active theme, so as to set the | ||
| 2688 | appropriate colors. While this introduces a bit more complexity, it | ||
| 2689 | ultimately offers greater flexibility on the choice of colors for such a | ||
| 2690 | niche functionality (so there is no need to abuse the palette of the | ||
| 2691 | active Modus theme): | ||
| 2692 | |||
| 2693 | #+begin_src emacs-lisp | ||
| 2694 | (defvar my-modus-themes-comment-colors | ||
| 2695 | '((light . ((low . "gray75") | ||
| 2696 | (medium . "gray50") | ||
| 2697 | (high . "#505050"))) ; the default for `modus-operandi' | ||
| 2698 | |||
| 2699 | (dark . ((low . "gray25") | ||
| 2700 | (medium . "gray50") | ||
| 2701 | (high . "#a8a8a8")))) ; the default for `modus-vivendi' | ||
| 2702 | "Alist of levels of intensity mapped to color values. | ||
| 2703 | For such colors, consult the command `list-colors-display'. Pass | ||
| 2704 | the name of a color or its hex value.") | ||
| 2705 | |||
| 2706 | (defvar my-modus-themes--adjust-comment-color-state nil | ||
| 2707 | "The cyclic state of `my-modus-themes-adjust-comment-color'. | ||
| 2708 | For internal use.") | ||
| 2709 | |||
| 2710 | (defun my-modus-themes--comment-foreground (degree state) | ||
| 2711 | "Set `font-lock-comment-face' foreground. | ||
| 2712 | Use `my-modus-themes-comment-colors' to extract the color value | ||
| 2713 | for each level of intensity. | ||
| 2714 | |||
| 2715 | This is complementary to `my-modus-themes-adjust-comment-color'." | ||
| 2716 | (let* ((colors my-modus-themes-comment-colors) | ||
| 2717 | (levels (pcase (car custom-enabled-themes) | ||
| 2718 | ('modus-operandi (alist-get 'light colors)) | ||
| 2719 | ('modus-vivendi (alist-get 'dark colors))))) | ||
| 2720 | (set-face-foreground | ||
| 2721 | 'font-lock-comment-face | ||
| 2722 | (alist-get degree levels)) | ||
| 2723 | (setq my-modus-themes--adjust-comment-color-state state) | ||
| 2724 | (message "Comments are set to %s contrast" degree))) | ||
| 2725 | |||
| 2726 | (defun my-modus-themes-adjust-comment-color () | ||
| 2727 | "Cycle through levels of intensity for comments. | ||
| 2728 | The levels are determined by `my-modus-themes-comment-colors'." | ||
| 2729 | (interactive) | ||
| 2730 | (pcase my-modus-themes--adjust-comment-color-state | ||
| 2731 | ('nil | ||
| 2732 | (my-modus-themes--comment-foreground 'low 1)) | ||
| 2733 | (1 | ||
| 2734 | (my-modus-themes--comment-foreground 'medium 2)) | ||
| 2735 | (_ | ||
| 2736 | (my-modus-themes--comment-foreground 'high nil)))) | ||
| 2737 | #+end_src | ||
| 2738 | |||
| 2739 | The effect of the above configurations on ~font-lock-comment-face~ is | ||
| 2740 | global. To make it buffer-local, one must tweak the code to employ the | ||
| 2741 | function ~face-remap-add-relative~ ([[#h:7a93cb6f-4eca-4d56-a85c-9dcd813d6b0f][Remap face with local value]]). | ||
| 2742 | |||
| 2743 | So this form in ~my-modus-themes--comment-foreground~: | ||
| 2744 | |||
| 2745 | #+begin_src emacs-lisp | ||
| 2746 | ;; example 1 | ||
| 2747 | (... | ||
| 2748 | (set-face-foreground | ||
| 2749 | 'font-lock-comment-face | ||
| 2750 | (modus-themes-color (alist-get degree palette-colors))) | ||
| 2751 | ...) | ||
| 2752 | |||
| 2753 | ;; example 2 | ||
| 2754 | (... | ||
| 2755 | (set-face-foreground | ||
| 2756 | 'font-lock-comment-face | ||
| 2757 | (alist-get degree levels)) | ||
| 2758 | ...) | ||
| 2759 | #+end_src | ||
| 2760 | |||
| 2761 | Must become this: | ||
| 2762 | |||
| 2763 | #+begin_src emacs-lisp | ||
| 2764 | ;; example 1 | ||
| 2765 | (... | ||
| 2766 | (face-remap-add-relative | ||
| 2767 | 'font-lock-comment-face | ||
| 2768 | `(:foreground ,(modus-themes-color (alist-get degree palette-colors)))) | ||
| 2769 | ...) | ||
| 2770 | |||
| 2771 | ;; example 2 | ||
| 2772 | (... | ||
| 2773 | (face-remap-add-relative | ||
| 2774 | 'font-lock-comment-face | ||
| 2775 | `(:foreground ,(alist-get degree levels))) | ||
| 2776 | ...) | ||
| 2777 | #+end_src | ||
| 2778 | |||
| 2779 | ** Override colors | ||
| 2780 | :properties: | ||
| 2781 | :custom_id: h:307d95dd-8dbd-4ece-a543-10ae86f155a6 | ||
| 2782 | :end: | ||
| 2783 | #+vindex: modus-themes-operandi-color-overrides | ||
| 2784 | #+vindex: modus-themes-vivendi-color-overrides | ||
| 2785 | #+cindex: Change a theme's colors | ||
| 2786 | |||
| 2787 | The themes provide a mechanism for overriding their color values. This | ||
| 2788 | is controlled by the variables ~modus-themes-operandi-color-overrides~ and | ||
| 2789 | ~modus-themes-vivendi-color-overrides~, which are alists that should | ||
| 2790 | mirror a subset of the associations in ~modus-themes-operandi-colors~ and | ||
| 2791 | ~modus-themes-vivendi-colors~ respectively. As with all customizations, | ||
| 2792 | overriding must be done before loading the affected theme. | ||
| 2793 | |||
| 2794 | [[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Visualize the active Modus theme's palette]]. | ||
| 2795 | |||
| 2796 | Let us approach the present topic one step at a time. Here is a | ||
| 2797 | simplified excerpt of the default palette for Modus Operandi with some | ||
| 2798 | basic background values that apply to buffers and the mode line | ||
| 2799 | (remember to inspect the actual value to find out all the associations | ||
| 2800 | that can be overridden): | ||
| 2801 | |||
| 2802 | #+begin_src emacs-lisp | ||
| 2803 | (defconst modus-themes-operandi-colors | ||
| 2804 | '((bg-main . "#ffffff") | ||
| 2805 | (bg-dim . "#f8f8f8") | ||
| 2806 | (bg-alt . "#f0f0f0") | ||
| 2807 | (bg-active . "#d7d7d7") | ||
| 2808 | (bg-inactive . "#efefef"))) | ||
| 2809 | #+end_src | ||
| 2810 | |||
| 2811 | As one can tell, we bind a key to a hexadecimal RGB color value. Now | ||
| 2812 | say we wish to override those specific values and have our changes | ||
| 2813 | propagate to all faces that use those keys. We could write something | ||
| 2814 | like this, which adds a subtle ochre tint: | ||
| 2815 | |||
| 2816 | #+begin_src emacs-lisp | ||
| 2817 | (setq modus-themes-operandi-color-overrides | ||
| 2818 | '((bg-main . "#fefcf4") | ||
| 2819 | (bg-dim . "#faf6ef") | ||
| 2820 | (bg-alt . "#f7efe5") | ||
| 2821 | (bg-active . "#e8dfd1") | ||
| 2822 | (bg-inactive . "#f6ece5"))) | ||
| 2823 | #+end_src | ||
| 2824 | |||
| 2825 | Once this is evaluated, any subsequent loading of ~modus-operandi~ will | ||
| 2826 | use those values instead of the defaults. No further intervention is | ||
| 2827 | required. | ||
| 2828 | |||
| 2829 | To reset the changes, we apply this and reload the theme: | ||
| 2830 | |||
| 2831 | #+begin_src emacs-lisp | ||
| 2832 | (setq modus-themes-operandi-color-overrides nil) | ||
| 2833 | #+end_src | ||
| 2834 | |||
| 2835 | Users who wish to leverage such a mechanism can opt to implement it | ||
| 2836 | on-demand by means of a global minor mode. The following snippet covers | ||
| 2837 | both themes and expands to some more associations in the palette: | ||
| 2838 | |||
| 2839 | #+begin_src emacs-lisp | ||
| 2840 | (define-minor-mode my-modus-themes-tinted | ||
| 2841 | "Tweak some Modus themes colors." | ||
| 2842 | :init-value nil | ||
| 2843 | :global t | ||
| 2844 | (if my-modus-themes-tinted | ||
| 2845 | (setq modus-themes-operandi-color-overrides | ||
| 2846 | '((bg-main . "#fefcf4") | ||
| 2847 | (bg-dim . "#faf6ef") | ||
| 2848 | (bg-alt . "#f7efe5") | ||
| 2849 | (bg-hl-line . "#f4f0e3") | ||
| 2850 | (bg-active . "#e8dfd1") | ||
| 2851 | (bg-inactive . "#f6ece5") | ||
| 2852 | (bg-region . "#c6bab1") | ||
| 2853 | (bg-header . "#ede3e0") | ||
| 2854 | (bg-tab-active . "#fdf6eb") | ||
| 2855 | (bg-tab-inactive . "#c8bab8")) | ||
| 2856 | modus-themes-vivendi-color-overrides | ||
| 2857 | '((bg-main . "#100b17") | ||
| 2858 | (bg-dim . "#161129") | ||
| 2859 | (bg-alt . "#181732") | ||
| 2860 | (bg-hl-line . "#191628") | ||
| 2861 | (bg-active . "#282e46") | ||
| 2862 | (bg-inactive . "#1a1e39") | ||
| 2863 | (bg-region . "#393a53") | ||
| 2864 | (bg-header . "#202037") | ||
| 2865 | (bg-tab-active . "#120f18") | ||
| 2866 | (bg-tab-inactive . "#3a3a5a"))) | ||
| 2867 | (setq modus-themes-operandi-color-overrides nil | ||
| 2868 | modus-themes-vivendi-color-overrides nil))) | ||
| 2869 | #+end_src | ||
| 2870 | |||
| 2871 | A more neutral style for ~modus-themes-operandi-color-overrides~ can | ||
| 2872 | look like this: | ||
| 2873 | |||
| 2874 | #+begin_src emacs-lisp | ||
| 2875 | '((bg-main . "#f7f7f7") | ||
| 2876 | (bg-dim . "#f2f2f2") | ||
| 2877 | (bg-alt . "#e8e8e8") | ||
| 2878 | (bg-hl-line . "#eaeaef") | ||
| 2879 | (bg-active . "#e0e0e0") | ||
| 2880 | (bg-inactive . "#e6e6e6") | ||
| 2881 | (bg-region . "#b5b5b5") | ||
| 2882 | (bg-header . "#e4e4e4") | ||
| 2883 | (bg-tab-active . "#f5f5f5") | ||
| 2884 | (bg-tab-inactive . "#c0c0c0")) | ||
| 2885 | #+end_src | ||
| 2886 | |||
| 2887 | With those in place, one can use {{{kbd(M-x my-modus-themes-tinted)}}} | ||
| 2888 | and then load the Modus theme of their choice. The new palette subset | ||
| 2889 | will come into effect: subtle ochre tints (or shades of gray) for Modus | ||
| 2890 | Operandi and night sky blue shades for Modus Vivendi. Switching between | ||
| 2891 | the two themes, such as with {{{kbd(M-x modus-themes-toggle)}}} will | ||
| 2892 | also use the overrides. | ||
| 2893 | |||
| 2894 | Given that this is a user-level customization, one is free to implement | ||
| 2895 | whatever color values they desire, even if the possible combinations | ||
| 2896 | fall below the minimum 7:1 contrast ratio that governs the design of the | ||
| 2897 | themes (the WCAG AAA legibility standard). Alternatively, this can also | ||
| 2898 | be done programmatically ([[#h:4589acdc-2505-41fc-9f5e-699cfc45ab00][Override color saturation]]). | ||
| 2899 | |||
| 2900 | The above are expanded into a fully fledged derivative elsewhere in this | ||
| 2901 | document ([[#h:736c0ff5-8c9c-4565-82cf-989e57d07d4a][Override colors completely]]). | ||
| 2902 | |||
| 2903 | For manual interventions it is advised to inspect the source code of | ||
| 2904 | ~modus-themes-operandi-colors~ and ~modus-themes-vivendi-colors~ for the | ||
| 2905 | inline commentary: it explains what the intended use of each palette | ||
| 2906 | subset is. | ||
| 2907 | |||
| 2908 | Furthermore, users may benefit from the ~modus-themes-contrast~ function | ||
| 2909 | that we provide: [[#h:02e25930-e71a-493d-828a-8907fc80f874][test color combinations]]. It measures the contrast | ||
| 2910 | ratio between two color values, so it can help in overriding the palette | ||
| 2911 | (or a subset thereof) without making the end result inaccessible. | ||
| 2912 | |||
| 2913 | ** Override color saturation | ||
| 2914 | :properties: | ||
| 2915 | :custom_id: h:4589acdc-2505-41fc-9f5e-699cfc45ab00 | ||
| 2916 | :end: | ||
| 2917 | #+cindex: Change a theme's color saturation | ||
| 2918 | |||
| 2919 | In the previous section we documented how one can override color values | ||
| 2920 | manually ([[#h:307d95dd-8dbd-4ece-a543-10ae86f155a6][Override colors]]). Here we use a programmatic approach which | ||
| 2921 | leverages the built-in ~color-saturate-name~ function to adjust the | ||
| 2922 | saturation of all color values used by the active Modus theme. Our goal | ||
| 2923 | is to prepare a counterpart of the active theme's palette that holds | ||
| 2924 | modified color values, adjusted for a percent change in saturation. A | ||
| 2925 | positive number amplifies the effect, while a negative one will move | ||
| 2926 | towards a grayscale spectrum. | ||
| 2927 | |||
| 2928 | We start with a function that can be either called from Lisp or invoked | ||
| 2929 | interactively. In the former scenario, we pass to it the rate of change | ||
| 2930 | we want. While in the latter, a minibuffer prompt asks for a number to | ||
| 2931 | apply the desired effect. In either case, we intend to assign anew the | ||
| 2932 | value of ~modus-themes-operandi-color-overrides~ (light theme) and the | ||
| 2933 | same for ~modus-themes-vivendi-color-overrides~ (dark theme). | ||
| 2934 | |||
| 2935 | #+begin_src emacs-lisp | ||
| 2936 | (defun my-modus-themes-saturate (percent) | ||
| 2937 | "Saturate current Modus theme palette overrides by PERCENT." | ||
| 2938 | (interactive | ||
| 2939 | (list (read-number "Saturation by percent: "))) | ||
| 2940 | (let* ((theme (modus-themes--current-theme)) | ||
| 2941 | (palette (pcase theme | ||
| 2942 | ('modus-operandi modus-themes-operandi-colors) | ||
| 2943 | ('modus-vivendi modus-themes-vivendi-colors) | ||
| 2944 | (_ (error "No Modus theme is active")))) | ||
| 2945 | (overrides (pcase theme | ||
| 2946 | ('modus-operandi 'modus-themes-operandi-color-overrides) | ||
| 2947 | ('modus-vivendi 'modus-themes-vivendi-color-overrides) | ||
| 2948 | (_ (error "No Modus theme is active"))))) | ||
| 2949 | (let (name cons colors) | ||
| 2950 | (dolist (cons palette) | ||
| 2951 | (setq name (color-saturate-name (cdr cons) percent)) | ||
| 2952 | (setq name (format "%s" name)) | ||
| 2953 | (setq cons `(,(car cons) . ,name)) | ||
| 2954 | (push cons colors)) | ||
| 2955 | (set overrides colors)) | ||
| 2956 | (pcase theme | ||
| 2957 | ('modus-operandi (modus-themes-load-operandi)) | ||
| 2958 | ('modus-vivendi (modus-themes-load-vivendi))))) | ||
| 2959 | |||
| 2960 | ;; sample Elisp calls (or call `my-modus-themes-saturate' interactively) | ||
| 2961 | (my-modus-themes-saturate 50) | ||
| 2962 | (my-modus-themes-saturate -75) | ||
| 2963 | #+end_src | ||
| 2964 | |||
| 2965 | Using the above has an immediate effect, as it reloads the active Modus | ||
| 2966 | theme. | ||
| 2967 | |||
| 2968 | The =my-modus-themes-saturate= function stores new color values in the | ||
| 2969 | variables ~modus-themes-operandi-color-overrides~ and | ||
| 2970 | ~modus-themes-vivendi-color-overrides~, meaning that it undoes changes | ||
| 2971 | implemented by the user on individual colors. To have both automatic | ||
| 2972 | saturation adjustment across the board and retain per-case edits to the | ||
| 2973 | palette, some tweaks to the above function are required. For example: | ||
| 2974 | |||
| 2975 | #+begin_src emacs-lisp | ||
| 2976 | (defvar my-modus-themes-vivendi-extra-color-overrides | ||
| 2977 | '((fg-main . "#ead0c0") | ||
| 2978 | (bg-main . "#050515")) | ||
| 2979 | "My bespoke colors for `modus-vivendi'.") | ||
| 2980 | |||
| 2981 | (defvar my-modus-themes-operandi-extra-color-overrides | ||
| 2982 | '((fg-main . "#1a1a1a") | ||
| 2983 | (bg-main . "#fefcf4")) | ||
| 2984 | "My bespoke colors for `modus-operandi'.") | ||
| 2985 | |||
| 2986 | (defun my-modus-themes-saturate (percent) | ||
| 2987 | "Saturate current Modus theme palette overrides by PERCENT. | ||
| 2988 | Preserve the color values stored in | ||
| 2989 | `my-modus-themes-operandi-extra-color-overrides', | ||
| 2990 | `my-modus-themes-vivendi-extra-color-overrides'." | ||
| 2991 | (interactive | ||
| 2992 | (list (read-number "Saturation by percent: "))) | ||
| 2993 | (let* ((theme (modus-themes--current-theme)) | ||
| 2994 | (palette (pcase theme | ||
| 2995 | ('modus-operandi modus-themes-operandi-colors) | ||
| 2996 | ('modus-vivendi modus-themes-vivendi-colors) | ||
| 2997 | (_ (error "No Modus theme is active")))) | ||
| 2998 | (overrides (pcase theme | ||
| 2999 | ('modus-operandi 'modus-themes-operandi-color-overrides) | ||
| 3000 | ('modus-vivendi 'modus-themes-vivendi-color-overrides) | ||
| 3001 | (_ (error "No Modus theme is active")))) | ||
| 3002 | (extra-overrides (pcase theme | ||
| 3003 | ('modus-operandi my-modus-themes-operandi-extra-color-overrides) | ||
| 3004 | ('modus-vivendi my-modus-themes-vivendi-extra-color-overrides) | ||
| 3005 | (_ (error "No Modus theme is active"))))) | ||
| 3006 | (let (name cons colors) | ||
| 3007 | (dolist (cons palette) | ||
| 3008 | (setq name (color-saturate-name (cdr cons) percent)) | ||
| 3009 | (setq name (format "%s" name)) | ||
| 3010 | (setq cons `(,(car cons) . ,name)) | ||
| 3011 | (push cons colors)) | ||
| 3012 | (set overrides (append extra-overrides colors))) | ||
| 3013 | (pcase theme | ||
| 3014 | ('modus-operandi (modus-themes-load-operandi)) | ||
| 3015 | ('modus-vivendi (modus-themes-load-vivendi))))) | ||
| 3016 | #+end_src | ||
| 3017 | |||
| 3018 | To disable the effect, one must reset the aforementioned variables of | ||
| 3019 | the themes to ~nil~. Or specify a command for it, such as by taking | ||
| 3020 | inspiration from the ~modus-themes-toggle~ we already provide: | ||
| 3021 | |||
| 3022 | #+begin_src emacs-lisp | ||
| 3023 | (defun my-modus-themes-revert-overrides () | ||
| 3024 | "Reset palette overrides and reload active Modus theme." | ||
| 3025 | (interactive) | ||
| 3026 | (setq modus-themes-operandi-color-overrides nil | ||
| 3027 | modus-themes-vivendi-color-overrides nil) | ||
| 3028 | (pcase (modus-themes--current-theme) | ||
| 3029 | ('modus-operandi (modus-themes-load-operandi)) | ||
| 3030 | ('modus-vivendi (modus-themes-load-vivendi)))) | ||
| 3031 | #+end_src | ||
| 3032 | |||
| 3033 | ** Override colors through blending | ||
| 3034 | :properties: | ||
| 3035 | :custom_id: h:80c326bf-fe32-47b2-8c59-58022256fd6e | ||
| 3036 | :end: | ||
| 3037 | #+cindex: Change theme colors through blending | ||
| 3038 | |||
| 3039 | This is yet another method of overriding color values. | ||
| 3040 | |||
| 3041 | [[#h:307d95dd-8dbd-4ece-a543-10ae86f155a6][Override colors]]. | ||
| 3042 | |||
| 3043 | [[#h:4589acdc-2505-41fc-9f5e-699cfc45ab00][Override color saturation]]. | ||
| 3044 | |||
| 3045 | Building on ideas and concepts from the previous sections, this method | ||
| 3046 | blends the entire palette at once with the chosen colors. The function | ||
| 3047 | ~my-modus-themes-interpolate~ blends two colors, taking a value from the | ||
| 3048 | themes and mixing it with a user-defined color to arrive at a midpoint. | ||
| 3049 | This scales to all background and foreground colors with the help of the | ||
| 3050 | ~my-modus-themes-tint-palette~ function. | ||
| 3051 | |||
| 3052 | #+begin_src emacs-lisp | ||
| 3053 | (setq my-modus-operandi-bg-blend "#fbf1c7" | ||
| 3054 | my-modus-operandi-fg-blend "#3a6084" | ||
| 3055 | my-modus-vivendi-bg-blend "#3a4042" | ||
| 3056 | my-modus-vivendi-fg-blend "#d7b765") | ||
| 3057 | |||
| 3058 | ;; Adapted from the `kurecolor-interpolate' function of kurecolor.el | ||
| 3059 | (defun my-modus-themes-interpolate (color1 color2) | ||
| 3060 | (cl-destructuring-bind (r g b) | ||
| 3061 | (mapcar #'(lambda (n) (* (/ n 2) 255.0)) | ||
| 3062 | (cl-mapcar '+ (color-name-to-rgb color1) (color-name-to-rgb color2))) | ||
| 3063 | (format "#%02X%02X%02X" r g b))) | ||
| 3064 | |||
| 3065 | (defun my-modus-themes-tint-palette (palette bg-blend fg-blend) | ||
| 3066 | "Modify Modus PALETTE programmatically and return a new palette. | ||
| 3067 | Blend background colors with BG-BLEND and foreground colors with FG-BLEND." | ||
| 3068 | (let (name cons colors) | ||
| 3069 | (dolist (cons palette) | ||
| 3070 | (let ((blend (if (string-match "bg" (symbol-name (car cons))) | ||
| 3071 | bg-blend | ||
| 3072 | fg-blend))) | ||
| 3073 | (setq name (my-modus-themes-interpolate (cdr cons) blend))) | ||
| 3074 | (setq name (format "%s" name)) | ||
| 3075 | (setq cons `(,(car cons) . ,name)) | ||
| 3076 | (push cons colors)) | ||
| 3077 | colors)) | ||
| 3078 | |||
| 3079 | (define-minor-mode modus-themes-tinted-mode | ||
| 3080 | "Tweak some Modus themes colors." | ||
| 3081 | :init-value nil | ||
| 3082 | :global t | ||
| 3083 | (if modus-themes-tinted-mode | ||
| 3084 | (setq modus-themes-operandi-color-overrides | ||
| 3085 | (my-modus-themes-tint-palette modus-themes-operandi-colors | ||
| 3086 | my-modus-operandi-bg-blend | ||
| 3087 | my-modus-operandi-fg-blend) | ||
| 3088 | modus-themes-vivendi-color-overrides | ||
| 3089 | (my-modus-themes-tint-palette modus-themes-vivendi-colors | ||
| 3090 | my-modus-vivendi-bg-blend | ||
| 3091 | my-modus-vivendi-fg-blend)) | ||
| 3092 | (setq modus-themes-operandi-color-overrides nil | ||
| 3093 | modus-themes-vivendi-color-overrides nil))) | ||
| 3094 | |||
| 3095 | (modus-themes-tinted-mode 1) | ||
| 3096 | #+end_src | ||
| 3097 | |||
| 3098 | ** Override colors completely | ||
| 3099 | :PROPERTIES: | ||
| 3100 | :CUSTOM_ID: h:736c0ff5-8c9c-4565-82cf-989e57d07d4a | ||
| 3101 | :END: | ||
| 3102 | |||
| 3103 | Based on the ideas we have already covered in these sections, the | ||
| 3104 | following code block provides a complete, bespoke pair of color palettes | ||
| 3105 | which override the defaults. They are implemented as a minor mode, as | ||
| 3106 | explained before ([[#h:307d95dd-8dbd-4ece-a543-10ae86f155a6][Override colors]]). We call them "Summertime" for | ||
| 3107 | convenience. | ||
| 3108 | |||
| 3109 | #+begin_src emacs-lisp | ||
| 3110 | ;; Read the relevant blog post: | ||
| 3111 | ;; <https://protesilaos.com/codelog/2022-07-26-modus-themes-color-override-demo/> | ||
| 3112 | (define-minor-mode modus-themes-summertime | ||
| 3113 | "Refashion the Modus themes by overriding their colors. | ||
| 3114 | |||
| 3115 | This is a complete technology demonstration to show how to | ||
| 3116 | manually override the colors of the Modus themes. I have taken | ||
| 3117 | good care of those overrides to make them work as a fully fledged | ||
| 3118 | color scheme that is compatible with all user options of the | ||
| 3119 | Modus themes. | ||
| 3120 | |||
| 3121 | These overrides are usable by those who (i) like something more | ||
| 3122 | fancy than the comparatively austere looks of the Modus themes, | ||
| 3123 | and (ii) can cope with a lower contrast ratio. | ||
| 3124 | |||
| 3125 | The overrides are set up as a minor mode, so that the user can | ||
| 3126 | activate the effect on demand. Those who want to load the | ||
| 3127 | overrides at all times can either add them directly to their | ||
| 3128 | configuration or enable `modus-themes-summertime' BEFORE loading | ||
| 3129 | either of the Modus themes (if the overrides are evaluated after | ||
| 3130 | the theme, the theme must be reloaded). | ||
| 3131 | |||
| 3132 | Remember that all changes to theme-related variables require a | ||
| 3133 | reload of the theme to take effect (the Modus themes have lots of | ||
| 3134 | user options, apart from those overrides). | ||
| 3135 | |||
| 3136 | The `modus-themes-summertime' IS NOT an official extension to the | ||
| 3137 | Modus themes and DOES NOT comply with its lofty accessibility | ||
| 3138 | standards. It is included in the official manual as guidance for | ||
| 3139 | those who want to make use of the color overriding facility we | ||
| 3140 | provide." | ||
| 3141 | :init-value nil | ||
| 3142 | :global t | ||
| 3143 | (if modus-themes-summertime | ||
| 3144 | (setq modus-themes-operandi-color-overrides | ||
| 3145 | '((bg-main . "#fff0f2") | ||
| 3146 | (bg-dim . "#fbe6ef") | ||
| 3147 | (bg-alt . "#f5dae6") | ||
| 3148 | (bg-hl-line . "#fad8e3") | ||
| 3149 | (bg-active . "#efcadf") | ||
| 3150 | (bg-inactive . "#f3ddef") | ||
| 3151 | (bg-active-accent . "#ffbbef") | ||
| 3152 | (bg-region . "#dfc5d1") | ||
| 3153 | (bg-region-accent . "#efbfef") | ||
| 3154 | (bg-region-accent-subtle . "#ffd6ef") | ||
| 3155 | (bg-header . "#edd3e0") | ||
| 3156 | (bg-tab-active . "#ffeff2") | ||
| 3157 | (bg-tab-inactive . "#f8d3ef") | ||
| 3158 | (bg-tab-inactive-accent . "#ffd9f5") | ||
| 3159 | (bg-tab-inactive-alt . "#e5c0d5") | ||
| 3160 | (bg-tab-inactive-alt-accent . "#f3cce0") | ||
| 3161 | (fg-main . "#543f78") | ||
| 3162 | (fg-dim . "#5f476f") | ||
| 3163 | (fg-alt . "#7f6f99") | ||
| 3164 | (fg-unfocused . "#8f6f9f") | ||
| 3165 | (fg-active . "#563068") | ||
| 3166 | (fg-inactive . "#8a5698") | ||
| 3167 | (fg-docstring . "#5f5fa7") | ||
| 3168 | (fg-comment-yellow . "#a9534f") | ||
| 3169 | (fg-escape-char-construct . "#8b207f") | ||
| 3170 | (fg-escape-char-backslash . "#a06d00") | ||
| 3171 | (bg-special-cold . "#d3e0f4") | ||
| 3172 | (bg-special-faint-cold . "#e0efff") | ||
| 3173 | (bg-special-mild . "#c4ede0") | ||
| 3174 | (bg-special-faint-mild . "#e0f0ea") | ||
| 3175 | (bg-special-warm . "#efd0c4") | ||
| 3176 | (bg-special-faint-warm . "#ffe4da") | ||
| 3177 | (bg-special-calm . "#f0d3ea") | ||
| 3178 | (bg-special-faint-calm . "#fadff9") | ||
| 3179 | (fg-special-cold . "#405fb8") | ||
| 3180 | (fg-special-mild . "#407f74") | ||
| 3181 | (fg-special-warm . "#9d6f4f") | ||
| 3182 | (fg-special-calm . "#af509f") | ||
| 3183 | (bg-completion . "#ffc5e5") | ||
| 3184 | (bg-completion-subtle . "#f7cfef") | ||
| 3185 | (red . "#ed2f44") | ||
| 3186 | (red-alt . "#e0403d") | ||
| 3187 | (red-alt-other . "#e04059") | ||
| 3188 | (red-faint . "#ed4f44") | ||
| 3189 | (red-alt-faint . "#e0603d") | ||
| 3190 | (red-alt-other-faint . "#e06059") | ||
| 3191 | (green . "#217a3c") | ||
| 3192 | (green-alt . "#417a1c") | ||
| 3193 | (green-alt-other . "#006f3c") | ||
| 3194 | (green-faint . "#318a4c") | ||
| 3195 | (green-alt-faint . "#518a2c") | ||
| 3196 | (green-alt-other-faint . "#20885c") | ||
| 3197 | (yellow . "#b06202") | ||
| 3198 | (yellow-alt . "#a95642") | ||
| 3199 | (yellow-alt-other . "#a06f42") | ||
| 3200 | (yellow-faint . "#b07232") | ||
| 3201 | (yellow-alt-faint . "#a96642") | ||
| 3202 | (yellow-alt-other-faint . "#a08042") | ||
| 3203 | (blue . "#275ccf") | ||
| 3204 | (blue-alt . "#475cc0") | ||
| 3205 | (blue-alt-other . "#3340ef") | ||
| 3206 | (blue-faint . "#476ce0") | ||
| 3207 | (blue-alt-faint . "#575ccf") | ||
| 3208 | (blue-alt-other-faint . "#3f60d7") | ||
| 3209 | (magenta . "#bf317f") | ||
| 3210 | (magenta-alt . "#d033c0") | ||
| 3211 | (magenta-alt-other . "#844fe4") | ||
| 3212 | (magenta-faint . "#bf517f") | ||
| 3213 | (magenta-alt-faint . "#d053c0") | ||
| 3214 | (magenta-alt-other-faint . "#846fe4") | ||
| 3215 | (cyan . "#007a9f") | ||
| 3216 | (cyan-alt . "#3f709f") | ||
| 3217 | (cyan-alt-other . "#107f7f") | ||
| 3218 | (cyan-faint . "#108aaf") | ||
| 3219 | (cyan-alt-faint . "#3f80af") | ||
| 3220 | (cyan-alt-other-faint . "#3088af") | ||
| 3221 | (red-active . "#cd2f44") | ||
| 3222 | (green-active . "#116a6c") | ||
| 3223 | (yellow-active . "#993602") | ||
| 3224 | (blue-active . "#475ccf") | ||
| 3225 | (magenta-active . "#7f2ccf") | ||
| 3226 | (cyan-active . "#007a8f") | ||
| 3227 | (red-nuanced-bg . "#ffdbd0") | ||
| 3228 | (red-nuanced-fg . "#ed6f74") | ||
| 3229 | (green-nuanced-bg . "#dcf0dd") | ||
| 3230 | (green-nuanced-fg . "#3f9a4c") | ||
| 3231 | (yellow-nuanced-bg . "#fff3aa") | ||
| 3232 | (yellow-nuanced-fg . "#b47232") | ||
| 3233 | (blue-nuanced-bg . "#e3e3ff") | ||
| 3234 | (blue-nuanced-fg . "#201f6f") | ||
| 3235 | (magenta-nuanced-bg . "#fdd0ff") | ||
| 3236 | (magenta-nuanced-fg . "#c0527f") | ||
| 3237 | (cyan-nuanced-bg . "#dbefff") | ||
| 3238 | (cyan-nuanced-fg . "#0f3f60") | ||
| 3239 | (bg-diff-heading . "#b7cfe0") | ||
| 3240 | (fg-diff-heading . "#041645") | ||
| 3241 | (bg-diff-added . "#d6f0d6") | ||
| 3242 | (fg-diff-added . "#004520") | ||
| 3243 | (bg-diff-changed . "#fcefcf") | ||
| 3244 | (fg-diff-changed . "#524200") | ||
| 3245 | (bg-diff-removed . "#ffe0ef") | ||
| 3246 | (fg-diff-removed . "#891626") | ||
| 3247 | (bg-diff-refine-added . "#84cfa4") | ||
| 3248 | (fg-diff-refine-added . "#002a00") | ||
| 3249 | (bg-diff-refine-changed . "#cccf8f") | ||
| 3250 | (fg-diff-refine-changed . "#302010") | ||
| 3251 | (bg-diff-refine-removed . "#da92b0") | ||
| 3252 | (fg-diff-refine-removed . "#500010") | ||
| 3253 | (bg-diff-focus-added . "#a6e5c6") | ||
| 3254 | (fg-diff-focus-added . "#002c00") | ||
| 3255 | (bg-diff-focus-changed . "#ecdfbf") | ||
| 3256 | (fg-diff-focus-changed . "#392900") | ||
| 3257 | (bg-diff-focus-removed . "#efbbcf") | ||
| 3258 | (fg-diff-focus-removed . "#5a0010")) | ||
| 3259 | modus-themes-vivendi-color-overrides | ||
| 3260 | '((bg-main . "#25152a") | ||
| 3261 | (bg-dim . "#2a1930") | ||
| 3262 | (bg-alt . "#382443") | ||
| 3263 | (bg-hl-line . "#332650") | ||
| 3264 | (bg-active . "#463358") | ||
| 3265 | (bg-inactive . "#2d1f3a") | ||
| 3266 | (bg-active-accent . "#50308f") | ||
| 3267 | (bg-region . "#5d4a67") | ||
| 3268 | (bg-region-accent . "#60509f") | ||
| 3269 | (bg-region-accent-subtle . "#3f285f") | ||
| 3270 | (bg-header . "#3a2543") | ||
| 3271 | (bg-tab-active . "#26162f") | ||
| 3272 | (bg-tab-inactive . "#362647") | ||
| 3273 | (bg-tab-inactive-accent . "#36265a") | ||
| 3274 | (bg-tab-inactive-alt . "#3e2f5a") | ||
| 3275 | (bg-tab-inactive-alt-accent . "#3e2f6f") | ||
| 3276 | (fg-main . "#debfe0") | ||
| 3277 | (fg-dim . "#d0b0da") | ||
| 3278 | (fg-alt . "#ae85af") | ||
| 3279 | (fg-unfocused . "#8e7f9f") | ||
| 3280 | (fg-active . "#cfbfef") | ||
| 3281 | (fg-inactive . "#b0a0c0") | ||
| 3282 | (fg-docstring . "#c8d9f7") | ||
| 3283 | (fg-comment-yellow . "#cf9a70") | ||
| 3284 | (fg-escape-char-construct . "#ff75aa") | ||
| 3285 | (fg-escape-char-backslash . "#dbab40") | ||
| 3286 | (bg-special-cold . "#2a3f58") | ||
| 3287 | (bg-special-faint-cold . "#1e283f") | ||
| 3288 | (bg-special-mild . "#0f3f31") | ||
| 3289 | (bg-special-faint-mild . "#0f281f") | ||
| 3290 | (bg-special-warm . "#44331f") | ||
| 3291 | (bg-special-faint-warm . "#372213") | ||
| 3292 | (bg-special-calm . "#4a314f") | ||
| 3293 | (bg-special-faint-calm . "#3a223f") | ||
| 3294 | (fg-special-cold . "#c0b0ff") | ||
| 3295 | (fg-special-mild . "#bfe0cf") | ||
| 3296 | (fg-special-warm . "#edc0a6") | ||
| 3297 | (fg-special-calm . "#ff9fdf") | ||
| 3298 | (bg-completion . "#502d70") | ||
| 3299 | (bg-completion-subtle . "#451d65") | ||
| 3300 | (red . "#ff5f6f") | ||
| 3301 | (red-alt . "#ff8f6d") | ||
| 3302 | (red-alt-other . "#ff6f9d") | ||
| 3303 | (red-faint . "#ffa0a0") | ||
| 3304 | (red-alt-faint . "#f5aa80") | ||
| 3305 | (red-alt-other-faint . "#ff9fbf") | ||
| 3306 | (green . "#51ca5c") | ||
| 3307 | (green-alt . "#71ca3c") | ||
| 3308 | (green-alt-other . "#51ca9c") | ||
| 3309 | (green-faint . "#78bf78") | ||
| 3310 | (green-alt-faint . "#99b56f") | ||
| 3311 | (green-alt-other-faint . "#88bf99") | ||
| 3312 | (yellow . "#f0b262") | ||
| 3313 | (yellow-alt . "#f0e242") | ||
| 3314 | (yellow-alt-other . "#d0a272") | ||
| 3315 | (yellow-faint . "#d2b580") | ||
| 3316 | (yellow-alt-faint . "#cabf77") | ||
| 3317 | (yellow-alt-other-faint . "#d0ba95") | ||
| 3318 | (blue . "#778cff") | ||
| 3319 | (blue-alt . "#8f90ff") | ||
| 3320 | (blue-alt-other . "#8380ff") | ||
| 3321 | (blue-faint . "#82b0ec") | ||
| 3322 | (blue-alt-faint . "#a0acef") | ||
| 3323 | (blue-alt-other-faint . "#80b2f0") | ||
| 3324 | (magenta . "#ff70cf") | ||
| 3325 | (magenta-alt . "#ff77f0") | ||
| 3326 | (magenta-alt-other . "#ca7fff") | ||
| 3327 | (magenta-faint . "#e0b2d6") | ||
| 3328 | (magenta-alt-faint . "#ef9fe4") | ||
| 3329 | (magenta-alt-other-faint . "#cfa6ff") | ||
| 3330 | (cyan . "#30cacf") | ||
| 3331 | (cyan-alt . "#60caff") | ||
| 3332 | (cyan-alt-other . "#40b79f") | ||
| 3333 | (cyan-faint . "#90c4ed") | ||
| 3334 | (cyan-alt-faint . "#a0bfdf") | ||
| 3335 | (cyan-alt-other-faint . "#a4d0bb") | ||
| 3336 | (red-active . "#ff6059") | ||
| 3337 | (green-active . "#64dc64") | ||
| 3338 | (yellow-active . "#ffac80") | ||
| 3339 | (blue-active . "#4fafff") | ||
| 3340 | (magenta-active . "#cf88ff") | ||
| 3341 | (cyan-active . "#50d3d0") | ||
| 3342 | (red-nuanced-bg . "#440a1f") | ||
| 3343 | (red-nuanced-fg . "#ffcccc") | ||
| 3344 | (green-nuanced-bg . "#002904") | ||
| 3345 | (green-nuanced-fg . "#b8e2b8") | ||
| 3346 | (yellow-nuanced-bg . "#422000") | ||
| 3347 | (yellow-nuanced-fg . "#dfdfb0") | ||
| 3348 | (blue-nuanced-bg . "#1f1f5f") | ||
| 3349 | (blue-nuanced-fg . "#bfd9ff") | ||
| 3350 | (magenta-nuanced-bg . "#431641") | ||
| 3351 | (magenta-nuanced-fg . "#e5cfef") | ||
| 3352 | (cyan-nuanced-bg . "#042f49") | ||
| 3353 | (cyan-nuanced-fg . "#a8e5e5") | ||
| 3354 | (bg-diff-heading . "#304466") | ||
| 3355 | (fg-diff-heading . "#dae7ff") | ||
| 3356 | (bg-diff-added . "#0a383a") | ||
| 3357 | (fg-diff-added . "#94ba94") | ||
| 3358 | (bg-diff-changed . "#2a2000") | ||
| 3359 | (fg-diff-changed . "#b0ba9f") | ||
| 3360 | (bg-diff-removed . "#50163f") | ||
| 3361 | (fg-diff-removed . "#c6adaa") | ||
| 3362 | (bg-diff-refine-added . "#006a46") | ||
| 3363 | (fg-diff-refine-added . "#e0f6e0") | ||
| 3364 | (bg-diff-refine-changed . "#585800") | ||
| 3365 | (fg-diff-refine-changed . "#ffffcc") | ||
| 3366 | (bg-diff-refine-removed . "#952838") | ||
| 3367 | (fg-diff-refine-removed . "#ffd9eb") | ||
| 3368 | (bg-diff-focus-added . "#1d4c3f") | ||
| 3369 | (fg-diff-focus-added . "#b4dfb4") | ||
| 3370 | (bg-diff-focus-changed . "#424200") | ||
| 3371 | (fg-diff-focus-changed . "#d0daaf") | ||
| 3372 | (bg-diff-focus-removed . "#6f0f39") | ||
| 3373 | (fg-diff-focus-removed . "#eebdba"))) | ||
| 3374 | (setq modus-themes-operandi-color-overrides nil | ||
| 3375 | modus-themes-vivendi-color-overrides nil))) | ||
| 3376 | #+end_src | ||
| 3377 | |||
| 3378 | ** Font configurations for Org and others | 2477 | ** Font configurations for Org and others |
| 3379 | :properties: | 2478 | :properties: |
| 3380 | :custom_id: h:defcf4fc-8fa8-4c29-b12e-7119582cc929 | 2479 | :custom_id: h:defcf4fc-8fa8-4c29-b12e-7119582cc929 |
| @@ -3400,8 +2499,8 @@ the ~variable-pitch~ (proportional spacing) and ~fixed-pitch~ (monospaced) | |||
| 3400 | faces respectively. It may also be convenient to set your main typeface | 2499 | faces respectively. It may also be convenient to set your main typeface |
| 3401 | by configuring the ~default~ face the same way. | 2500 | by configuring the ~default~ face the same way. |
| 3402 | 2501 | ||
| 3403 | [ The =fontaine= package on GNU ELPA (by the author of the modus-themes) | 2502 | [ The ~fontaine~ package on GNU ELPA (by Protesilaos) is designed to |
| 3404 | is designed to handle this case. ] | 2503 | handle this case. ] |
| 3405 | 2504 | ||
| 3406 | Put something like this in your initialization file (also consider | 2505 | Put something like this in your initialization file (also consider |
| 3407 | reading the doc string of ~set-face-attribute~): | 2506 | reading the doc string of ~set-face-attribute~): |
| @@ -3537,7 +2636,7 @@ of the themes, which can make it easier to redefine faces in bulk). | |||
| 3537 | (add-hook 'modus-themes-after-load-theme-hook #'my-modes-themes-bold-italic-faces) | 2636 | (add-hook 'modus-themes-after-load-theme-hook #'my-modes-themes-bold-italic-faces) |
| 3538 | #+end_src | 2637 | #+end_src |
| 3539 | 2638 | ||
| 3540 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | 2639 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 3541 | 2640 | ||
| 3542 | ** Custom Org todo keyword and priority faces | 2641 | ** Custom Org todo keyword and priority faces |
| 3543 | :properties: | 2642 | :properties: |
| @@ -3623,8 +2722,6 @@ Their documentation strings will offer you further guidance. | |||
| 3623 | Recall that the themes let you retrieve a color from their palette. Do | 2722 | Recall that the themes let you retrieve a color from their palette. Do |
| 3624 | it if you plan to control face attributes. | 2723 | it if you plan to control face attributes. |
| 3625 | 2724 | ||
| 3626 | [[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Custom face specs using the themes' palette]]. | ||
| 3627 | |||
| 3628 | [[#h:02e25930-e71a-493d-828a-8907fc80f874][Check color combinations]]. | 2725 | [[#h:02e25930-e71a-493d-828a-8907fc80f874][Check color combinations]]. |
| 3629 | 2726 | ||
| 3630 | ** Custom Org emphasis faces | 2727 | ** Custom Org emphasis faces |
| @@ -3649,7 +2746,7 @@ specification of that variable looks like this: | |||
| 3649 | 2746 | ||
| 3650 | With the exception of ~org-verbatim~ and ~org-code~ faces, everything else | 2747 | With the exception of ~org-verbatim~ and ~org-code~ faces, everything else |
| 3651 | uses the corresponding type of emphasis: a bold typographic weight, or | 2748 | uses the corresponding type of emphasis: a bold typographic weight, or |
| 3652 | italicized, underlined, and struck through text. | 2749 | italicised, underlined, and struck through text. |
| 3653 | 2750 | ||
| 3654 | The best way for users to add some extra attributes, such as a | 2751 | The best way for users to add some extra attributes, such as a |
| 3655 | foreground color, is to define their own faces and assign them to the | 2752 | foreground color, is to define their own faces and assign them to the |
| @@ -3872,8 +2969,8 @@ palette in large part because certain colors are only meant to be used | |||
| 3872 | in combination with some others. Consult the source code for the | 2969 | in combination with some others. Consult the source code for the |
| 3873 | minutia and relevant commentary. | 2970 | minutia and relevant commentary. |
| 3874 | 2971 | ||
| 3875 | Such knowledge may prove valuable while attempting to override some of | 2972 | Such knowledge may prove valuable while attempting to customize the |
| 3876 | the themes' colors: [[#h:307d95dd-8dbd-4ece-a543-10ae86f155a6][Override colors]]. | 2973 | theme's color palette. |
| 3877 | 2974 | ||
| 3878 | ** Load theme depending on time of day | 2975 | ** Load theme depending on time of day |
| 3879 | :properties: | 2976 | :properties: |
| @@ -3972,101 +3069,6 @@ With those in place, PDFs have a distinct backdrop for their page, while | |||
| 3972 | buffers with major-mode as ~pdf-view-mode~ automatically switches to dark | 3069 | buffers with major-mode as ~pdf-view-mode~ automatically switches to dark |
| 3973 | mode when ~modus-themes-toggle~ is called. | 3070 | mode when ~modus-themes-toggle~ is called. |
| 3974 | 3071 | ||
| 3975 | ** Decrease mode line height | ||
| 3976 | :properties: | ||
| 3977 | :custom_id: h:03be4438-dae1-4961-9596-60a307c070b5 | ||
| 3978 | :end: | ||
| 3979 | #+cindex: Decrease mode line height | ||
| 3980 | |||
| 3981 | By default, the mode line of the Modus themes is set to 1 pixel width | ||
| 3982 | for its =:box= attribute. In contrast, the mode line of stock Emacs is -1 | ||
| 3983 | pixel. This small difference is considered necessary for the purposes | ||
| 3984 | of accessibility as our out-of-the-box design has a prominent color | ||
| 3985 | around the mode line (a border) to make its boundaries clear. With a | ||
| 3986 | negative width the border and the text on the mode line can feel a bit | ||
| 3987 | more difficult to read under certain scenaria. | ||
| 3988 | |||
| 3989 | Furthermore, the user option ~modus-themes-mode-line~ ([[#h:27943af6-d950-42d0-bc23-106e43f50a24][Mode line]]) does not | ||
| 3990 | allow for such a negative value because there are many edge cases that | ||
| 3991 | simply make for a counter-intuitive set of possibilities, such as a =0= | ||
| 3992 | value not being acceptable by the underlying face infrastructure, and | ||
| 3993 | negative values greater than =-2= not being particularly usable. | ||
| 3994 | |||
| 3995 | For these reasons, users who wish to decrease the overall height of the | ||
| 3996 | mode line must handle things on their own by implementing the methods | ||
| 3997 | for face customization documented herein. | ||
| 3998 | |||
| 3999 | [[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Basic face customization]]. | ||
| 4000 | |||
| 4001 | One such method is to create a function that configures the desired | ||
| 4002 | faces and hook it to ~modus-themes-after-load-theme-hook~ so that it | ||
| 4003 | persists while switching between the Modus themes with the command | ||
| 4004 | ~modus-themes-toggle~. | ||
| 4005 | |||
| 4006 | This one simply disables the box altogether, which will reduce the | ||
| 4007 | height of the mode lines, but also remove their border: | ||
| 4008 | |||
| 4009 | #+begin_src emacs-lisp | ||
| 4010 | (defun my-modus-themes-custom-faces () | ||
| 4011 | (set-face-attribute 'mode-line nil :box nil) | ||
| 4012 | (set-face-attribute 'mode-line-inactive nil :box nil)) | ||
| 4013 | |||
| 4014 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | ||
| 4015 | #+end_src | ||
| 4016 | |||
| 4017 | The above relies on the ~set-face-attribute~ function, though users who | ||
| 4018 | plan to re-use colors from the theme and do so at scale are better off | ||
| 4019 | with the more streamlined combination of the ~modus-themes-with-colors~ | ||
| 4020 | macro and ~custom-set-faces~. | ||
| 4021 | |||
| 4022 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face customization at scale]]. | ||
| 4023 | |||
| 4024 | As explained before in this document, this approach has a syntax that is | ||
| 4025 | consistent with the source code of the themes, so it probably is easier | ||
| 4026 | to re-use parts of the design. | ||
| 4027 | |||
| 4028 | The following emulates the stock Emacs style, while still using the | ||
| 4029 | colors of the Modus themes (whichever attribute is not explicitly stated | ||
| 4030 | is inherited from the underlying theme): | ||
| 4031 | |||
| 4032 | #+begin_src emacs-lisp | ||
| 4033 | (defun my-modus-themes-custom-faces () | ||
| 4034 | (modus-themes-with-colors | ||
| 4035 | (custom-set-faces | ||
| 4036 | `(mode-line ((,class :box (:line-width -1 :style released-button)))) | ||
| 4037 | `(mode-line-inactive ((,class :box (:line-width -1 :color ,bg-region))))))) | ||
| 4038 | |||
| 4039 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | ||
| 4040 | #+end_src | ||
| 4041 | |||
| 4042 | And this one is like the out-of-the-box style of the Modus themes, but | ||
| 4043 | with the -1 height instead of 1: | ||
| 4044 | |||
| 4045 | #+begin_src emacs-lisp | ||
| 4046 | (defun my-modus-themes-custom-faces () | ||
| 4047 | (modus-themes-with-colors | ||
| 4048 | (custom-set-faces | ||
| 4049 | `(mode-line ((,class :box (:line-width -1 :color ,fg-alt)))) | ||
| 4050 | `(mode-line-inactive ((,class :box (:line-width -1 :color ,bg-region))))))) | ||
| 4051 | |||
| 4052 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | ||
| 4053 | #+end_src | ||
| 4054 | |||
| 4055 | Finally, to also change the background color of the active mode line, | ||
| 4056 | such as that it looks like the "accented" variant which is possible via | ||
| 4057 | the user option ~modus-themes-mode-line~, the =:background= attribute needs | ||
| 4058 | to be specified as well: | ||
| 4059 | |||
| 4060 | #+begin_src emacs-lisp | ||
| 4061 | (defun my-modus-themes-custom-faces () | ||
| 4062 | (modus-themes-with-colors | ||
| 4063 | (custom-set-faces | ||
| 4064 | `(mode-line ((,class :box (:line-width -1 :color ,fg-alt) :background ,bg-active-accent))) | ||
| 4065 | `(mode-line-inactive ((,class :box (:line-width -1 :color ,bg-region))))))) | ||
| 4066 | |||
| 4067 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | ||
| 4068 | #+end_src | ||
| 4069 | |||
| 4070 | ** Toggle themes without reloading them | 3072 | ** Toggle themes without reloading them |
| 4071 | :properties: | 3073 | :properties: |
| 4072 | :custom_id: h:b40aca50-a3b2-4c43-be58-2c26fcd14237 | 3074 | :custom_id: h:b40aca50-a3b2-4c43-be58-2c26fcd14237 |
| @@ -4106,13 +3108,13 @@ varying skill levels, from beginners to experts. This means that we try | |||
| 4106 | to make things easier by not expecting anyone reading this document to | 3108 | to make things easier by not expecting anyone reading this document to |
| 4107 | be proficient in Emacs Lisp or programming in general. | 3109 | be proficient in Emacs Lisp or programming in general. |
| 4108 | 3110 | ||
| 4109 | Such a case is with the use of the ~modus-themes-after-load-theme-hook~, | 3111 | Such a case is with the use of ~modus-themes-after-load-theme-hook~, |
| 4110 | which runs after ~modus-themes-toggle~, ~modus-themes-load-operandi~, or | 3112 | which runs after the ~modus-themes-load-theme~ function (used by the |
| 4111 | ~modus-themes-load-vivendi~ is evaluated. We recommend using that hook | 3113 | command ~modus-themes-toggle~). We recommend using that hook for |
| 4112 | for advanced customizations, because (1) we know for sure that it is | 3114 | advanced customizations, because (1) we know for sure that it is |
| 4113 | available once the themes are loaded, and (2) anyone consulting this | 3115 | available once the themes are loaded, and (2) anyone consulting this |
| 4114 | manual, especially the sections on enabling and loading the themes, will | 3116 | manual, especially the sections on enabling and loading the themes, |
| 4115 | be in a good position to benefit from that hook. | 3117 | will be in a good position to benefit from that hook. |
| 4116 | 3118 | ||
| 4117 | Advanced users who have a need to switch between the Modus themes and | 3119 | Advanced users who have a need to switch between the Modus themes and |
| 4118 | other items will find that such a hook does not meet their requirements: | 3120 | other items will find that such a hook does not meet their requirements: |
| @@ -4138,235 +3140,14 @@ also has the benefit that it does not depend on functions such as | |||
| 4138 | ~modus-themes-toggle~ and the others mentioned above. ~enable-theme~ is | 3140 | ~modus-themes-toggle~ and the others mentioned above. ~enable-theme~ is |
| 4139 | called internally by ~load-theme~, so the hook works everywhere. | 3141 | called internally by ~load-theme~, so the hook works everywhere. |
| 4140 | 3142 | ||
| 4141 | Now this specific piece of Elisp may be simple for experienced users, | 3143 | The downside of the theme-agnostic hook is that any functions added to |
| 4142 | but it is not easy to read for newcomers, including the author of the | 3144 | it will likely not be able to benefit from macro calls that read the |
| 4143 | Modus themes for the first several months of their time as an Emacs | 3145 | active theme, such as ~modus-themes-with-colors~. Not all Emacs |
| 4144 | user. Hence our hesitation to recommend it as part of the standard | 3146 | themes have the same capabilities. |
| 4145 | setup of the Modus themes (it is generally a good idea to understand | ||
| 4146 | what the implications are of advising a function). | ||
| 4147 | |||
| 4148 | ** Diffs with only the foreground | ||
| 4149 | :properties: | ||
| 4150 | :custom_id: h:e2aed9eb-5e1e-45ec-bbd7-bc4faeab3236 | ||
| 4151 | :end: | ||
| 4152 | #+cindex: Foreground-only diffs | ||
| 4153 | |||
| 4154 | Buffers that show differences between versions of a file or buffer, such | ||
| 4155 | as in ~diff-mode~ and ~ediff~ always use color-coded background and | ||
| 4156 | foreground combinations. | ||
| 4157 | |||
| 4158 | [[#h:ea7ac54f-5827-49bd-b09f-62424b3b6427][Option for diff buffer looks]]. | ||
| 4159 | |||
| 4160 | User may, however, prefer a style that removes the color-coded | ||
| 4161 | backgrounds from regular changes while keeping them for word-wise (aka | ||
| 4162 | "refined") changes---backgrounds for word-wise diffs are helpful in | ||
| 4163 | context. To make this happen, one can use the ~modus-themes-with-colors~ | ||
| 4164 | macro ([[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]): | ||
| 4165 | |||
| 4166 | #+begin_src emacs-lisp | ||
| 4167 | (defun my-modus-themes-custom-faces () | ||
| 4168 | (modus-themes-with-colors | ||
| 4169 | (custom-set-faces | ||
| 4170 | `(modus-themes-diff-added ((,class :background unspecified :foreground ,green))) ; OR ,blue for deuteranopia | ||
| 4171 | `(modus-themes-diff-changed ((,class :background unspecified :foreground ,yellow))) | ||
| 4172 | `(modus-themes-diff-removed ((,class :background unspecified :foreground ,red))) | ||
| 4173 | |||
| 4174 | `(modus-themes-diff-refine-added ((,class :background ,bg-diff-added :foreground ,fg-diff-added))) | ||
| 4175 | ;; `(modus-themes-diff-refine-added ((,class :background ,bg-diff-added-deuteran :foreground ,fg-diff-added-deuteran))) | ||
| 4176 | `(modus-themes-diff-refine-changed ((,class :background ,bg-diff-changed :foreground ,fg-diff-changed))) | ||
| 4177 | `(modus-themes-diff-refine-removed ((,class :background ,bg-diff-removed :foreground ,fg-diff-removed))) | ||
| 4178 | |||
| 4179 | `(modus-themes-diff-focus-added ((,class :background ,bg-dim :foreground ,green))) ; OR ,blue for deuteranopia | ||
| 4180 | `(modus-themes-diff-focus-changed ((,class :background ,bg-dim :foreground ,yellow))) | ||
| 4181 | `(modus-themes-diff-focus-removed ((,class :background ,bg-dim :foreground ,red))) | ||
| 4182 | |||
| 4183 | `(modus-themes-diff-heading ((,class :background ,bg-alt :foreground ,fg-main))) | ||
| 4184 | |||
| 4185 | `(diff-indicator-added ((,class :foreground ,green))) ; OR ,blue for deuteranopia | ||
| 4186 | `(diff-indicator-changed ((,class :foreground ,yellow))) | ||
| 4187 | `(diff-indicator-removed ((,class :foreground ,red))) | ||
| 4188 | |||
| 4189 | `(magit-diff-added ((,class :background unspecified :foreground ,green-faint))) | ||
| 4190 | `(magit-diff-changed ((,class :background unspecified :foreground ,yellow-faint))) | ||
| 4191 | `(magit-diff-removed ((,class :background unspecified :foreground ,red-faint))) | ||
| 4192 | `(magit-diff-context-highlight ((,class :background ,bg-dim :foreground ,fg-dim)))))) | ||
| 4193 | |||
| 4194 | ;; This is so that the changes persist when switching between | ||
| 4195 | ;; `modus-operandi' and `modus-vivendi'. | ||
| 4196 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | ||
| 4197 | #+end_src | ||
| 4198 | |||
| 4199 | This used to be an optional style of ~modus-themes-diffs~, but has been | ||
| 4200 | removed since version =2.0.0= to ensure that the accessibility standard | ||
| 4201 | and aesthetic quality of the themes is not compromised. | ||
| 4202 | |||
| 4203 | ** Ediff without diff color-coding | ||
| 4204 | :properties: | ||
| 4205 | :custom_id: h:b0b31802-0216-427e-b071-1a47adcfe608 | ||
| 4206 | :end: | ||
| 4207 | |||
| 4208 | Ediff uses the same color-coding as ordinary diffs in ~diff-mode~, Magit, | ||
| 4209 | etc. ([[#h:ea7ac54f-5827-49bd-b09f-62424b3b6427][Option for diff buffer looks]]). This is consistent with the | ||
| 4210 | principle of least surprise. | ||
| 4211 | |||
| 4212 | Users may, however, prefer to treat Ediff differently on the premise | ||
| 4213 | that it does not need any particular color-coding to show added or | ||
| 4214 | removed lines/words: it does not use the =+= or =-= markers, after all. | ||
| 4215 | |||
| 4216 | This can be achieved by customizing the Ediff faces with color | ||
| 4217 | combinations that do not carry the same connotations as those of diffs. | ||
| 4218 | Consider this example, which leverages the ~modus-themes-with-colors~ | ||
| 4219 | macro ([[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]): | ||
| 4220 | |||
| 4221 | #+begin_src emacs-lisp | ||
| 4222 | (defun my-modus-themes-custom-faces () | ||
| 4223 | (modus-themes-with-colors | ||
| 4224 | (custom-set-faces | ||
| 4225 | `(ediff-current-diff-A ((,class :inherit unspecified :background ,bg-special-faint-cold :foreground ,fg-special-cold))) | ||
| 4226 | `(ediff-current-diff-B ((,class :inherit unspecified :background ,bg-special-faint-warm :foreground ,fg-special-warm))) | ||
| 4227 | `(ediff-current-diff-C ((,class :inherit unspecified :background ,bg-special-faint-calm :foreground ,fg-special-calm))) | ||
| 4228 | `(ediff-fine-diff-A ((,class :inherit unspecified :background ,bg-special-cold :foreground ,fg-special-cold))) | ||
| 4229 | `(ediff-fine-diff-B ((,class :inherit unspecified :background ,bg-special-warm :foreground ,fg-special-warm))) | ||
| 4230 | `(ediff-fine-diff-C ((,class :inherit unspecified :background ,bg-special-calm :foreground ,fg-special-calm)))))) | ||
| 4231 | |||
| 4232 | ;; This is so that the changes persist when switching between | ||
| 4233 | ;; `modus-operandi' and `modus-vivendi'. | ||
| 4234 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | ||
| 4235 | #+end_src | ||
| 4236 | |||
| 4237 | Remove the =:foreground= and its value to preserve the underlying | ||
| 4238 | coloration. | ||
| 4239 | 3147 | ||
| 4240 | [[#h:f4d4b71b-2ca5-4c3d-b0b4-9bfd7aa7fb4d][Visualize the active Modus theme's palette]]. | 3148 | In this document, we cover ~modus-themes-after-load-theme-hook~ though |
| 4241 | 3149 | the user can replace it with ~after-enable-theme-hook~ should they | |
| 4242 | ** Near-monochrome syntax highlighting | 3150 | need to (provided they understand the implications). |
| 4243 | :properties: | ||
| 4244 | :custom_id: h:c1f3fa8e-7a63-4a6f-baf3-a7febc0661f0 | ||
| 4245 | :end: | ||
| 4246 | #+cindex: Monochrome code syntax | ||
| 4247 | |||
| 4248 | While the Modus themes do provide a user option to control the overall | ||
| 4249 | style of syntax highlighting in programming major modes, they do not | ||
| 4250 | cover the possibility of a monochromatic or near-monochromatic design | ||
| 4251 | ([[#h:c119d7b2-fcd4-4e44-890e-5e25733d5e52][Option for syntax highlighting]]). This is due to the multitude of | ||
| 4252 | preferences involved: one may like comments to be styled with an accent | ||
| 4253 | value, another may want certain constructs to be bold, a third may apply | ||
| 4254 | italics to doc strings but not comments... The possibilities are | ||
| 4255 | virtually endless. As such, this sort of design is best handled at the | ||
| 4256 | user level in accordance with the information furnished elsewhere in | ||
| 4257 | this manual. | ||
| 4258 | |||
| 4259 | [[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Case-by-case face specs using the themes' palette]]. | ||
| 4260 | |||
| 4261 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | ||
| 4262 | |||
| 4263 | The gist is that we want to override the font-lock faces. For our | ||
| 4264 | changes to persist while switching between ~modus-operandi~ and | ||
| 4265 | ~modus-vivendi~ we wrap our face overrides in a function that we hook to | ||
| 4266 | ~modus-themes-after-load-theme-hook~. | ||
| 4267 | |||
| 4268 | Users who want to replicate the structure of the themes' source code are | ||
| 4269 | advised to use the examples with ~custom-set-faces~. Those who prefer a | ||
| 4270 | different approach can use the snippets which call ~set-face-attribute~. | ||
| 4271 | Below are the code blocks. | ||
| 4272 | |||
| 4273 | The following uses a yellow accent value for comments and green hues for | ||
| 4274 | strings. Regexp grouping constructs have color values that work in the | ||
| 4275 | context of a green string. All other elements use the main foreground | ||
| 4276 | color, except warnings such as the ~user-error~ function in Elisp | ||
| 4277 | buffers which gets a subtle red tint (not to be confused with the | ||
| 4278 | ~warning~ face which is used for genuine warnings). Furthermore, notice | ||
| 4279 | the ~modus-themes-bold~ and ~modus-themes-slant~ which apply the | ||
| 4280 | preference set in the user options ~modus-themes-bold-constructs~ and | ||
| 4281 | ~modus-themes-italic-constructs~, respectively. Users who do not want | ||
| 4282 | this conditionally must replace these faces with ~bold~ and ~italic~ | ||
| 4283 | respectively (or ~unspecified~ to disable the effect altogether). | ||
| 4284 | |||
| 4285 | #+begin_src emacs-lisp | ||
| 4286 | ;; This is the hook. It will not be replicated across all code samples. | ||
| 4287 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-subtle-syntax) | ||
| 4288 | |||
| 4289 | (defun my-modus-themes-subtle-syntax () | ||
| 4290 | (modus-themes-with-colors | ||
| 4291 | (custom-set-faces | ||
| 4292 | `(font-lock-builtin-face ((,class :inherit modus-themes-bold :foreground unspecified))) | ||
| 4293 | `(font-lock-comment-delimiter-face ((,class :inherit font-lock-comment-face))) | ||
| 4294 | `(font-lock-comment-face ((,class :inherit unspecified :foreground ,fg-comment-yellow))) | ||
| 4295 | `(font-lock-constant-face ((,class :foreground unspecified))) | ||
| 4296 | `(font-lock-doc-face ((,class :inherit modus-themes-slant :foreground ,fg-special-mild))) | ||
| 4297 | `(font-lock-function-name-face ((,class :foreground unspecified))) | ||
| 4298 | `(font-lock-keyword-face ((,class :inherit modus-themes-bold :foreground unspecified))) | ||
| 4299 | `(font-lock-negation-char-face ((,class :inherit modus-themes-bold :foreground unspecified))) | ||
| 4300 | `(font-lock-preprocessor-face ((,class :foreground unspecified))) | ||
| 4301 | `(font-lock-regexp-grouping-backslash ((,class :inherit bold :foreground ,yellow))) | ||
| 4302 | `(font-lock-regexp-grouping-construct ((,class :inherit bold :foreground ,blue-alt-other))) | ||
| 4303 | `(font-lock-string-face ((,class :foreground ,green-alt-other))) | ||
| 4304 | `(font-lock-type-face ((,class :inherit modus-themes-bold :foreground unspecified))) | ||
| 4305 | `(font-lock-variable-name-face ((,class :foreground unspecified))) | ||
| 4306 | `(font-lock-warning-face ((,class :inherit modus-themes-bold :foreground ,red-nuanced-fg)))))) | ||
| 4307 | |||
| 4308 | ;; Same as above with `set-face-attribute' instead of `custom-set-faces' | ||
| 4309 | (defun my-modus-themes-subtle-syntax () | ||
| 4310 | (modus-themes-with-colors | ||
| 4311 | (set-face-attribute 'font-lock-builtin-face nil :inherit 'modus-themes-bold :foreground 'unspecified) | ||
| 4312 | (set-face-attribute 'font-lock-comment-delimiter-face nil :inherit 'font-lock-comment-face) | ||
| 4313 | (set-face-attribute 'font-lock-comment-face nil :inherit 'unspecified :foreground fg-comment-yellow) | ||
| 4314 | (set-face-attribute 'font-lock-constant-face nil :foreground 'unspecified) | ||
| 4315 | (set-face-attribute 'font-lock-doc-face nil :inherit 'modus-themes-slant :foreground fg-special-mild) | ||
| 4316 | (set-face-attribute 'font-lock-function-name-face nil :foreground 'unspecified) | ||
| 4317 | (set-face-attribute 'font-lock-keyword-face nil :inherit 'modus-themes-bold :foreground 'unspecified) | ||
| 4318 | (set-face-attribute 'font-lock-negation-char-face nil :inherit 'modus-themes-bold :foreground 'unspecified) | ||
| 4319 | (set-face-attribute 'font-lock-preprocessor-face nil :foreground 'unspecified) | ||
| 4320 | (set-face-attribute 'font-lock-regexp-grouping-backslash nil :inherit 'bold :foreground yellow) | ||
| 4321 | (set-face-attribute 'font-lock-regexp-grouping-construct nil :inherit 'bold :foreground blue-alt-other) | ||
| 4322 | (set-face-attribute 'font-lock-string-face nil :foreground green-alt-other) | ||
| 4323 | (set-face-attribute 'font-lock-type-face nil :inherit 'modus-themes-bold :foreground 'unspecified) | ||
| 4324 | (set-face-attribute 'font-lock-variable-name-face nil :foreground 'unspecified) | ||
| 4325 | (set-face-attribute 'font-lock-warning-face nil :inherit 'modus-themes-bold :foreground red-nuanced-fg))) | ||
| 4326 | #+end_src | ||
| 4327 | |||
| 4328 | The following sample is the same as above, except strings are blue and | ||
| 4329 | comments are gray. Regexp constructs are adapted accordingly. | ||
| 4330 | |||
| 4331 | #+begin_src emacs-lisp | ||
| 4332 | (defun my-modus-themes-subtle-syntax () | ||
| 4333 | (modus-themes-with-colors | ||
| 4334 | (custom-set-faces | ||
| 4335 | `(font-lock-builtin-face ((,class :inherit modus-themes-bold :foreground unspecified))) | ||
| 4336 | `(font-lock-comment-delimiter-face ((,class :inherit font-lock-comment-face))) | ||
| 4337 | `(font-lock-comment-face ((,class :inherit unspecified :foreground ,fg-alt))) | ||
| 4338 | `(font-lock-constant-face ((,class :foreground unspecified))) | ||
| 4339 | `(font-lock-doc-face ((,class :inherit modus-themes-slant :foreground ,fg-docstring))) | ||
| 4340 | `(font-lock-function-name-face ((,class :foreground unspecified))) | ||
| 4341 | `(font-lock-keyword-face ((,class :inherit modus-themes-bold :foreground unspecified))) | ||
| 4342 | `(font-lock-negation-char-face ((,class :inherit modus-themes-bold :foreground unspecified))) | ||
| 4343 | `(font-lock-preprocessor-face ((,class :foreground unspecified))) | ||
| 4344 | `(font-lock-regexp-grouping-backslash ((,class :inherit bold :foreground ,fg-escape-char-backslash))) | ||
| 4345 | `(font-lock-regexp-grouping-construct ((,class :inherit bold :foreground ,fg-escape-char-construct))) | ||
| 4346 | `(font-lock-string-face ((,class :foreground ,blue-alt))) | ||
| 4347 | `(font-lock-type-face ((,class :inherit modus-themes-bold :foreground unspecified))) | ||
| 4348 | `(font-lock-variable-name-face ((,class :foreground unspecified))) | ||
| 4349 | `(font-lock-warning-face ((,class :inherit modus-themes-bold :foreground ,red-nuanced-fg)))))) | ||
| 4350 | |||
| 4351 | ;; Same as above with `set-face-attribute' instead of `custom-set-faces' | ||
| 4352 | (defun my-modus-themes-subtle-syntax () | ||
| 4353 | (modus-themes-with-colors | ||
| 4354 | (set-face-attribute 'font-lock-builtin-face nil :inherit 'modus-themes-bold :foreground 'unspecified) | ||
| 4355 | (set-face-attribute 'font-lock-comment-delimiter-face nil :inherit 'font-lock-comment-face) | ||
| 4356 | (set-face-attribute 'font-lock-comment-face nil :inherit 'unspecified :foreground fg-alt) | ||
| 4357 | (set-face-attribute 'font-lock-constant-face nil :foreground 'unspecified) | ||
| 4358 | (set-face-attribute 'font-lock-doc-face nil :inherit 'modus-themes-slant :foreground fg-docstring) | ||
| 4359 | (set-face-attribute 'font-lock-function-name-face nil :foreground 'unspecified) | ||
| 4360 | (set-face-attribute 'font-lock-keyword-face nil :inherit 'modus-themes-bold :foreground 'unspecified) | ||
| 4361 | (set-face-attribute 'font-lock-negation-char-face nil :inherit 'modus-themes-bold :foreground 'unspecified) | ||
| 4362 | (set-face-attribute 'font-lock-preprocessor-face nil :foreground 'unspecified) | ||
| 4363 | (set-face-attribute 'font-lock-regexp-grouping-backslash nil :inherit 'bold :foreground fg-escape-char-backslash) | ||
| 4364 | (set-face-attribute 'font-lock-regexp-grouping-construct nil :inherit 'bold :foreground fg-escape-char-construct) | ||
| 4365 | (set-face-attribute 'font-lock-string-face nil :foreground blue-alt) | ||
| 4366 | (set-face-attribute 'font-lock-type-face nil :inherit 'modus-themes-bold :foreground 'unspecified) | ||
| 4367 | (set-face-attribute 'font-lock-variable-name-face nil :foreground 'unspecified) | ||
| 4368 | (set-face-attribute 'font-lock-warning-face nil :inherit 'modus-themes-bold :foreground red-nuanced-fg))) | ||
| 4369 | #+end_src | ||
| 4370 | 3151 | ||
| 4371 | ** Custom hl-todo colors | 3152 | ** Custom hl-todo colors |
| 4372 | :PROPERTIES: | 3153 | :PROPERTIES: |
| @@ -4448,16 +3229,16 @@ on what we cover at length elsewhere in this manual: | |||
| 4448 | 3229 | ||
| 4449 | [[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]. | 3230 | [[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]. |
| 4450 | 3231 | ||
| 4451 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | 3232 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 4452 | 3233 | ||
| 4453 | #+begin_src emacs-lisp | 3234 | #+begin_src emacs-lisp |
| 4454 | (defun my-modus-themes-custom-faces () | 3235 | (defun my-modus-themes-custom-faces () |
| 4455 | (modus-themes-with-colors | 3236 | (modus-themes-with-colors |
| 4456 | (custom-set-faces | 3237 | (custom-set-faces |
| 4457 | `(solaire-default-face ((,class :inherit default :background ,bg-alt :foreground ,fg-dim))) | 3238 | `(solaire-default-face ((,c :inherit default :background ,bg-dim :foreground ,fg-dim))) |
| 4458 | `(solaire-line-number-face ((,class :inherit solaire-default-face :foreground ,fg-unfocused))) | 3239 | `(solaire-line-number-face ((,c :inherit solaire-default-face :foreground ,fg-unfocused))) |
| 4459 | `(solaire-hl-line-face ((,class :background ,bg-active))) | 3240 | `(solaire-hl-line-face ((,c :background ,bg-active))) |
| 4460 | `(solaire-org-hide-face ((,class :background ,bg-alt :foreground ,bg-alt)))))) | 3241 | `(solaire-org-hide-face ((,c :background ,bg-dim :foreground ,bg-dim)))))) |
| 4461 | 3242 | ||
| 4462 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | 3243 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) |
| 4463 | #+end_src | 3244 | #+end_src |
| @@ -4487,65 +3268,50 @@ affected face groups. The items with an appended asterisk =*= tend to | |||
| 4487 | have lots of extensions, so the "full support" may not be 100% true… | 3268 | have lots of extensions, so the "full support" may not be 100% true… |
| 4488 | 3269 | ||
| 4489 | + ace-window | 3270 | + ace-window |
| 4490 | + alert | 3271 | + agda2-mode |
| 4491 | + all-the-icons | 3272 | + all-the-icons |
| 4492 | + all-the-icons-dired | 3273 | + all-the-icons-dired |
| 4493 | + all-the-icons-ibuffer | 3274 | + all-the-icons-ibuffer |
| 4494 | + annotate | 3275 | + annotate |
| 4495 | + ansi-color | 3276 | + ansi-color |
| 4496 | + anzu | 3277 | + anzu |
| 4497 | + apropos | ||
| 4498 | + artbollocks-mode | ||
| 4499 | + auctex and TeX | 3278 | + auctex and TeX |
| 4500 | + auto-dim-other-buffers | 3279 | + auto-dim-other-buffers |
| 4501 | + avy | 3280 | + avy |
| 4502 | + awesome-tray | ||
| 4503 | + bbdb | 3281 | + bbdb |
| 4504 | + binder | 3282 | + binder |
| 4505 | + bm | ||
| 4506 | + bongo | 3283 | + bongo |
| 4507 | + boon | 3284 | + boon |
| 4508 | + bookmark | 3285 | + bookmark |
| 4509 | + breakpoint (provided by the built-in {{{file(gdb-mi.el)}}} library) | ||
| 4510 | + calendar and diary | 3286 | + calendar and diary |
| 4511 | + calfw | ||
| 4512 | + calibredb | ||
| 4513 | + centaur-tabs | 3287 | + centaur-tabs |
| 4514 | + cfrs | ||
| 4515 | + change-log and log-view (such as ~vc-print-log~, ~vc-print-root-log~) | 3288 | + change-log and log-view (such as ~vc-print-log~, ~vc-print-root-log~) |
| 4516 | + chart | 3289 | + chart |
| 4517 | + cider | 3290 | + cider |
| 4518 | + circe | 3291 | + circe |
| 4519 | + citar | 3292 | + citar |
| 4520 | + color-rg | 3293 | + clojure-mode |
| 4521 | + column-enforce-mode | 3294 | + column-enforce-mode |
| 4522 | + company-mode* | 3295 | + company-mode* |
| 4523 | + company-posframe | ||
| 4524 | + compilation-mode | 3296 | + compilation-mode |
| 4525 | + completions | 3297 | + completions |
| 4526 | + consult | 3298 | + consult |
| 4527 | + corfu | 3299 | + corfu |
| 4528 | + corfu-quick | 3300 | + corfu-quick |
| 4529 | + counsel* | 3301 | + counsel* |
| 4530 | + counsel-css | ||
| 4531 | + cov | ||
| 4532 | + cperl-mode | 3302 | + cperl-mode |
| 4533 | + crontab-mode | 3303 | + crontab-mode |
| 4534 | + css-mode | 3304 | + css-mode |
| 4535 | + csv-mode | 3305 | + csv-mode |
| 4536 | + ctrlf | 3306 | + ctrlf |
| 4537 | + custom (what you get with {{{kbd(M-x customize)}}}) | 3307 | + custom (what you get with {{{kbd(M-x customize)}}}) |
| 4538 | + dap-mode | ||
| 4539 | + deadgrep | 3308 | + deadgrep |
| 4540 | + debbugs | ||
| 4541 | + deft | 3309 | + deft |
| 4542 | + denote | ||
| 4543 | + devdocs | 3310 | + devdocs |
| 4544 | + dictionary | 3311 | + dictionary |
| 4545 | + diff-hl | 3312 | + diff-hl |
| 4546 | + diff-mode | 3313 | + diff-mode |
| 4547 | + dim-autoload | 3314 | + dim-autoload |
| 4548 | + dir-treeview | ||
| 4549 | + dired | 3315 | + dired |
| 4550 | + dired-async | 3316 | + dired-async |
| 4551 | + dired-git | 3317 | + dired-git |
| @@ -4553,11 +3319,8 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4553 | + dired-narrow | 3319 | + dired-narrow |
| 4554 | + dired-subtree | 3320 | + dired-subtree |
| 4555 | + diredfl | 3321 | + diredfl |
| 4556 | + diredp (dired+) | ||
| 4557 | + display-fill-column-indicator-mode | 3322 | + display-fill-column-indicator-mode |
| 4558 | + doom-modeline | 3323 | + doom-modeline |
| 4559 | + easy-jekyll | ||
| 4560 | + ebdb | ||
| 4561 | + ediff | 3324 | + ediff |
| 4562 | + ein (Emacs IPython Notebook) | 3325 | + ein (Emacs IPython Notebook) |
| 4563 | + eglot | 3326 | + eglot |
| @@ -4571,36 +3334,23 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4571 | + emms | 3334 | + emms |
| 4572 | + enh-ruby-mode (enhanced-ruby-mode) | 3335 | + enh-ruby-mode (enhanced-ruby-mode) |
| 4573 | + epa | 3336 | + epa |
| 4574 | + equake | ||
| 4575 | + erc | 3337 | + erc |
| 4576 | + eros | ||
| 4577 | + ert | 3338 | + ert |
| 4578 | + eshell | 3339 | + eshell |
| 4579 | + eshell-fringe-status | 3340 | + eshell-fringe-status |
| 4580 | + eshell-git-prompt | ||
| 4581 | + eshell-prompt-extras (epe) | ||
| 4582 | + eshell-syntax-highlighting | ||
| 4583 | + evil* (evil-mode) | 3341 | + evil* (evil-mode) |
| 4584 | + evil-goggles | ||
| 4585 | + evil-snipe | ||
| 4586 | + evil-visual-mark-mode | ||
| 4587 | + eww | 3342 | + eww |
| 4588 | + exwm | 3343 | + exwm |
| 4589 | + eyebrowse | 3344 | + eyebrowse |
| 4590 | + fancy-dabbrev | ||
| 4591 | + flycheck | 3345 | + flycheck |
| 4592 | + flycheck-color-mode-line | 3346 | + flycheck-color-mode-line |
| 4593 | + flycheck-indicator | 3347 | + flycheck-indicator |
| 4594 | + flycheck-posframe | ||
| 4595 | + flymake | 3348 | + flymake |
| 4596 | + flyspell | 3349 | + flyspell |
| 4597 | + flx | 3350 | + flx |
| 4598 | + freeze-it | ||
| 4599 | + focus | 3351 | + focus |
| 4600 | + fold-this | 3352 | + fold-this |
| 4601 | + font-lock (generic syntax highlighting) | 3353 | + font-lock (generic syntax highlighting) |
| 4602 | + forge | ||
| 4603 | + fountain (fountain-mode) | ||
| 4604 | + geiser | 3354 | + geiser |
| 4605 | + git-commit | 3355 | + git-commit |
| 4606 | + git-gutter (and variants) | 3356 | + git-gutter (and variants) |
| @@ -4609,23 +3359,16 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4609 | + gnus | 3359 | + gnus |
| 4610 | + gotest | 3360 | + gotest |
| 4611 | + golden-ratio-scroll-screen | 3361 | + golden-ratio-scroll-screen |
| 4612 | + helm* | ||
| 4613 | + helm-ls-git | ||
| 4614 | + helm-switch-shell | ||
| 4615 | + helm-xref | ||
| 4616 | + helpful | 3362 | + helpful |
| 4617 | + highlight-indentation | ||
| 4618 | + highlight-numbers | 3363 | + highlight-numbers |
| 4619 | + highlight-parentheses ([[#h:24bab397-dcb2-421d-aa6e-ec5bd622b913][Note on highlight-parentheses.el]]) | 3364 | + highlight-parentheses ([[#h:24bab397-dcb2-421d-aa6e-ec5bd622b913][Note on highlight-parentheses.el]]) |
| 4620 | + highlight-thing | 3365 | + highlight-thing |
| 4621 | + hl-defined | ||
| 4622 | + hl-fill-column | 3366 | + hl-fill-column |
| 4623 | + hl-line-mode | 3367 | + hl-line-mode |
| 4624 | + hl-todo | 3368 | + hl-todo |
| 4625 | + hydra | 3369 | + hydra |
| 4626 | + ibuffer | 3370 | + ibuffer |
| 4627 | + icomplete | 3371 | + icomplete |
| 4628 | + icomplete-vertical | ||
| 4629 | + ido-mode | 3372 | + ido-mode |
| 4630 | + iedit | 3373 | + iedit |
| 4631 | + iflipb | 3374 | + iflipb |
| @@ -4635,7 +3378,6 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4635 | + info | 3378 | + info |
| 4636 | + info+ (info-plus) | 3379 | + info+ (info-plus) |
| 4637 | + info-colors | 3380 | + info-colors |
| 4638 | + interaction-log | ||
| 4639 | + ioccur | 3381 | + ioccur |
| 4640 | + isearch, occur, etc. | 3382 | + isearch, occur, etc. |
| 4641 | + ivy* | 3383 | + ivy* |
| @@ -4644,34 +3386,25 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4644 | + journalctl-mode | 3386 | + journalctl-mode |
| 4645 | + js2-mode | 3387 | + js2-mode |
| 4646 | + julia | 3388 | + julia |
| 4647 | + jupyter | ||
| 4648 | + kaocha-runner | 3389 | + kaocha-runner |
| 4649 | + keycast | 3390 | + keycast |
| 4650 | + ledger-mode | 3391 | + ledger-mode |
| 4651 | + leerzeichen | 3392 | + leerzeichen |
| 4652 | + line numbers (~display-line-numbers-mode~ and global variant) | 3393 | + line numbers (~display-line-numbers-mode~ and global variant) |
| 4653 | + lsp-mode | ||
| 4654 | + lsp-ui | ||
| 4655 | + macrostep | ||
| 4656 | + magit | 3394 | + magit |
| 4657 | + magit-imerge | ||
| 4658 | + make-mode | 3395 | + make-mode |
| 4659 | + man | 3396 | + man |
| 4660 | + marginalia | 3397 | + marginalia |
| 4661 | + markdown-mode | 3398 | + markdown-mode |
| 4662 | + markup-faces (~adoc-mode~) | 3399 | + markup-faces (~adoc-mode~) |
| 4663 | + mentor | ||
| 4664 | + messages | 3400 | + messages |
| 4665 | + mini-modeline | ||
| 4666 | + minimap | 3401 | + minimap |
| 4667 | + mmm-mode | ||
| 4668 | + mode-line | 3402 | + mode-line |
| 4669 | + mood-line | 3403 | + mood-line |
| 4670 | + moody | 3404 | + moody |
| 4671 | + mpdel | 3405 | + mpdel |
| 4672 | + mu4e | 3406 | + mu4e |
| 4673 | + multiple-cursors | 3407 | + multiple-cursors |
| 4674 | + nano-modeline | ||
| 4675 | + neotree | 3408 | + neotree |
| 4676 | + notmuch | 3409 | + notmuch |
| 4677 | + num3-mode | 3410 | + num3-mode |
| @@ -4698,11 +3431,8 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4698 | + pdf-tools | 3431 | + pdf-tools |
| 4699 | + persp-mode | 3432 | + persp-mode |
| 4700 | + perspective | 3433 | + perspective |
| 4701 | + phi-grep | ||
| 4702 | + pomidor | ||
| 4703 | + popup | 3434 | + popup |
| 4704 | + powerline | 3435 | + powerline |
| 4705 | + powerline-evil | ||
| 4706 | + prism ([[#h:a94272e0-99da-4149-9e80-11a7e67a2cf2][Note for prism.el]]) | 3436 | + prism ([[#h:a94272e0-99da-4149-9e80-11a7e67a2cf2][Note for prism.el]]) |
| 4707 | + prescient | 3437 | + prescient |
| 4708 | + proced | 3438 | + proced |
| @@ -4710,19 +3440,15 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4710 | + pulse | 3440 | + pulse |
| 4711 | + pyim | 3441 | + pyim |
| 4712 | + quick-peek | 3442 | + quick-peek |
| 4713 | + racket-mode | ||
| 4714 | + rainbow-blocks | ||
| 4715 | + rainbow-delimiters | 3443 | + rainbow-delimiters |
| 4716 | + rcirc | 3444 | + rcirc |
| 3445 | + rcirc-color | ||
| 4717 | + recursion-indicator | 3446 | + recursion-indicator |
| 4718 | + regexp-builder (also known as ~re-builder~) | 3447 | + regexp-builder (also known as ~re-builder~) |
| 4719 | + rg (rg.el) | 3448 | + rg (rg.el) |
| 4720 | + ripgrep | 3449 | + ripgrep |
| 4721 | + rmail | 3450 | + rmail |
| 4722 | + ruler-mode | 3451 | + ruler-mode |
| 4723 | + selectrum | ||
| 4724 | + selectrum-prescient | ||
| 4725 | + semantic | ||
| 4726 | + sesman | 3452 | + sesman |
| 4727 | + shell-script-mode | 3453 | + shell-script-mode |
| 4728 | + shortdoc | 3454 | + shortdoc |
| @@ -4734,9 +3460,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4734 | + slime (slbd) | 3460 | + slime (slbd) |
| 4735 | + sly | 3461 | + sly |
| 4736 | + smart-mode-line | 3462 | + smart-mode-line |
| 4737 | + smartparens | ||
| 4738 | + smerge | 3463 | + smerge |
| 4739 | + spaceline | ||
| 4740 | + speedbar | 3464 | + speedbar |
| 4741 | + spell-fu | 3465 | + spell-fu |
| 4742 | + stripes | 3466 | + stripes |
| @@ -4746,20 +3470,16 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4746 | + sx | 3470 | + sx |
| 4747 | + symbol-overlay | 3471 | + symbol-overlay |
| 4748 | + syslog-mode | 3472 | + syslog-mode |
| 4749 | + tab-bar-groups | ||
| 4750 | + tab-bar-mode | 3473 | + tab-bar-mode |
| 4751 | + tab-line-mode | 3474 | + tab-line-mode |
| 4752 | + table (built-in {{{file(table.el)}}}) | 3475 | + table (built-in {{{file(table.el)}}}) |
| 4753 | + telega | 3476 | + telega |
| 4754 | + telephone-line | ||
| 4755 | + terraform-mode | 3477 | + terraform-mode |
| 4756 | + term | 3478 | + term |
| 4757 | + textsec | 3479 | + textsec |
| 4758 | + tomatinho | ||
| 4759 | + transient (pop-up windows such as Magit's) | 3480 | + transient (pop-up windows such as Magit's) |
| 4760 | + trashed | 3481 | + trashed |
| 4761 | + tree-sitter | 3482 | + tree-sitter |
| 4762 | + treemacs | ||
| 4763 | + tty-menu | 3483 | + tty-menu |
| 4764 | + tuareg | 3484 | + tuareg |
| 4765 | + typescript | 3485 | + typescript |
| @@ -4779,15 +3499,12 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 4779 | + which-key | 3499 | + which-key |
| 4780 | + whitespace-mode | 3500 | + whitespace-mode |
| 4781 | + window-divider-mode | 3501 | + window-divider-mode |
| 4782 | + winum | ||
| 4783 | + writegood-mode | 3502 | + writegood-mode |
| 4784 | + woman | 3503 | + woman |
| 4785 | + xah-elisp-mode | 3504 | + xah-elisp-mode |
| 4786 | + xref | ||
| 4787 | + xterm-color (and ansi-colors) | 3505 | + xterm-color (and ansi-colors) |
| 4788 | + yaml-mode | 3506 | + yaml-mode |
| 4789 | + yasnippet | 3507 | + yasnippet |
| 4790 | + ztree | ||
| 4791 | 3508 | ||
| 4792 | Plus many other miscellaneous faces that are provided by Emacs. | 3509 | Plus many other miscellaneous faces that are provided by Emacs. |
| 4793 | 3510 | ||
| @@ -4802,34 +3519,45 @@ inherit from some basic faces or their dependencies which are directly | |||
| 4802 | supported by the themes. | 3519 | supported by the themes. |
| 4803 | 3520 | ||
| 4804 | + ag | 3521 | + ag |
| 3522 | + apropos | ||
| 4805 | + apt-sources-list | 3523 | + apt-sources-list |
| 3524 | + bbdb | ||
| 3525 | + bm | ||
| 3526 | + breakpoint (provided by the built-in {{{file(gdb-mi.el)}}} library) | ||
| 4806 | + buffer-expose | 3527 | + buffer-expose |
| 4807 | + bufler | 3528 | + bufler |
| 4808 | + counsel-notmuch | 3529 | + counsel-notmuch |
| 4809 | + counsel-org-capture-string | 3530 | + counsel-org-capture-string |
| 4810 | + dashboard (emacs-dashboard) | 3531 | + dashboard (emacs-dashboard) |
| 4811 | + define-word | 3532 | + define-word |
| 3533 | + denote | ||
| 4812 | + disk-usage | 3534 | + disk-usage |
| 4813 | + dtache | 3535 | + dtache |
| 4814 | + dynamic-ruler | 3536 | + dynamic-ruler |
| 4815 | + easy-kill | 3537 | + easy-kill |
| 3538 | + ebdb | ||
| 4816 | + edit-indirect | 3539 | + edit-indirect |
| 4817 | + egerrit | 3540 | + egerrit |
| 4818 | + elfeed-summary | 3541 | + elfeed-summary |
| 4819 | + evil-owl | 3542 | + evil-owl |
| 4820 | + flyspell-correct | 3543 | + flyspell-correct |
| 4821 | + fortran-mode | 3544 | + fortran-mode |
| 3545 | + freeze-it | ||
| 3546 | + forge | ||
| 4822 | + git-walktree | 3547 | + git-walktree |
| 4823 | + goggles | 3548 | + goggles |
| 4824 | + highlight-defined | 3549 | + highlight-defined |
| 4825 | + highlight-escape-sequences (~hes-mode~) | 3550 | + highlight-escape-sequences (~hes-mode~) |
| 3551 | + icomplete-vertical | ||
| 4826 | + i3wm-config-mode | 3552 | + i3wm-config-mode |
| 3553 | + lin | ||
| 4827 | + minibuffer-line | 3554 | + minibuffer-line |
| 4828 | + no-emoji | 3555 | + no-emoji |
| 4829 | + org-remark | 3556 | + org-remark |
| 4830 | + parrot | 3557 | + parrot |
| 4831 | + perl-mode | 3558 | + perl-mode |
| 4832 | + php-mode | 3559 | + php-mode |
| 3560 | + pulsar | ||
| 4833 | + rjsx-mode | 3561 | + rjsx-mode |
| 4834 | + side-hustle | 3562 | + side-hustle |
| 4835 | + spell-fu | 3563 | + spell-fu |
| @@ -4840,6 +3568,7 @@ supported by the themes. | |||
| 4840 | + vdiff | 3568 | + vdiff |
| 4841 | + vertico-indexed | 3569 | + vertico-indexed |
| 4842 | + vertico-mouse | 3570 | + vertico-mouse |
| 3571 | + xref | ||
| 4843 | 3572 | ||
| 4844 | * Notes on individual packages | 3573 | * Notes on individual packages |
| 4845 | :properties: | 3574 | :properties: |
| @@ -4895,16 +3624,21 @@ length elsewhere in this manual: | |||
| 4895 | 3624 | ||
| 4896 | [[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]. | 3625 | [[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]. |
| 4897 | 3626 | ||
| 4898 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | 3627 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 4899 | 3628 | ||
| 4900 | #+begin_src emacs-lisp | 3629 | #+begin_src emacs-lisp |
| 4901 | (defun my-modus-themes-custom-faces () | 3630 | (defun my-modus-themes-custom-faces () |
| 4902 | (modus-themes-with-colors | 3631 | (modus-themes-with-colors |
| 4903 | (custom-set-faces | 3632 | (custom-set-faces |
| 4904 | ;; Replace green with blue if you use `modus-themes-deuteranopia'. | 3633 | ;; Make foreground the same as background for a uniform bar on |
| 4905 | `(git-gutter-fr:added ((,class :foreground ,green-fringe-bg))) | 3634 | ;; Doom Emacs. |
| 4906 | `(git-gutter-fr:deleted ((,class :foreground ,red-fringe-bg))) | 3635 | ;; |
| 4907 | `(git-gutter-fr:modified ((,class :foreground ,yellow-fringe-bg)))))) | 3636 | ;; Doom should not be implementing such hacks because themes |
| 3637 | ;; cannot support them: | ||
| 3638 | ;; <https://protesilaos.com/codelog/2022-08-04-doom-git-gutter-modus-themes/>. | ||
| 3639 | `(git-gutter-fr:added ((,c :foreground ,bg-added-intense))) | ||
| 3640 | `(git-gutter-fr:deleted ((,c :foreground ,bg-removed-intense))) | ||
| 3641 | `(git-gutter-fr:modified ((,c :foreground ,bg-changed-intense)))))) | ||
| 4908 | 3642 | ||
| 4909 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | 3643 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) |
| 4910 | #+end_src | 3644 | #+end_src |
| @@ -4917,17 +3651,17 @@ If the above does not work, try this instead: | |||
| 4917 | (after! modus-themes | 3651 | (after! modus-themes |
| 4918 | (modus-themes-with-colors | 3652 | (modus-themes-with-colors |
| 4919 | (custom-set-faces | 3653 | (custom-set-faces |
| 4920 | ;; Replace green with blue if you use `modus-themes-deuteranopia'. | 3654 | ;; Make foreground the same as background for a uniform bar on |
| 4921 | `(git-gutter-fr:added ((,class :foreground ,green-fringe-bg))) | 3655 | ;; Doom Emacs. |
| 4922 | `(git-gutter-fr:deleted ((,class :foreground ,red-fringe-bg))) | 3656 | ;; |
| 4923 | `(git-gutter-fr:modified ((,class :foreground ,yellow-fringe-bg)))))) | 3657 | ;; Doom should not be implementing such hacks because themes |
| 3658 | ;; cannot support them: | ||
| 3659 | ;; <https://protesilaos.com/codelog/2022-08-04-doom-git-gutter-modus-themes/>. | ||
| 3660 | `(git-gutter-fr:added ((,c :foreground ,bg-added-intense))) | ||
| 3661 | `(git-gutter-fr:deleted ((,c :foreground ,bg-removed-intense))) | ||
| 3662 | `(git-gutter-fr:modified ((,c :foreground ,bg-changed-intense)))))) | ||
| 4924 | #+end_src | 3663 | #+end_src |
| 4925 | 3664 | ||
| 4926 | Replace ~green-fringe-bg~ with ~blue-fringe-bg~ if you want to optimize | ||
| 4927 | for red-green color deficiency. | ||
| 4928 | |||
| 4929 | [[#h:3ed03a48-20d8-4ce7-b214-0eb7e4c79abe][Option for red-green color deficiency or deuteranopia]]. | ||
| 4930 | |||
| 4931 | ** Note on php-mode multiline comments | 3665 | ** Note on php-mode multiline comments |
| 4932 | :PROPERTIES: | 3666 | :PROPERTIES: |
| 4933 | :CUSTOM_ID: h:d0a3157b-9c04-46e8-8742-5fb2a7ae8798 | 3667 | :CUSTOM_ID: h:d0a3157b-9c04-46e8-8742-5fb2a7ae8798 |
| @@ -5042,10 +3776,10 @@ elsewhere in this document. For example: | |||
| 5042 | #+begin_src emacs-lisp | 3776 | #+begin_src emacs-lisp |
| 5043 | (modus-themes-with-colors | 3777 | (modus-themes-with-colors |
| 5044 | (custom-set-faces | 3778 | (custom-set-faces |
| 5045 | `(fill-column-indicator ((,class :foreground ,bg-active))))) | 3779 | `(fill-column-indicator ((,c :foreground ,bg-active))))) |
| 5046 | #+end_src | 3780 | #+end_src |
| 5047 | 3781 | ||
| 5048 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | 3782 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 5049 | 3783 | ||
| 5050 | To make the line thicker, set the height to be equal to the base font | 3784 | To make the line thicker, set the height to be equal to the base font |
| 5051 | size instead of the one pixel we use. This is done by specifying a rate | 3785 | size instead of the one pixel we use. This is done by specifying a rate |
| @@ -5055,7 +3789,7 @@ For example: | |||
| 5055 | #+begin_src emacs-lisp | 3789 | #+begin_src emacs-lisp |
| 5056 | (modus-themes-with-colors | 3790 | (modus-themes-with-colors |
| 5057 | (custom-set-faces | 3791 | (custom-set-faces |
| 5058 | `(fill-column-indicator ((,class :height 1.0 :background ,bg-inactive :foreground ,bg-inactive))))) | 3792 | `(fill-column-indicator ((,c :height 1.0 :background ,bg-inactive :foreground ,bg-inactive))))) |
| 5059 | #+end_src | 3793 | #+end_src |
| 5060 | 3794 | ||
| 5061 | ** Note on highlight-parentheses.el | 3795 | ** Note on highlight-parentheses.el |
| @@ -5113,14 +3847,14 @@ found): | |||
| 5113 | 3847 | ||
| 5114 | ;; Here we set color combinations that involve both a background | 3848 | ;; Here we set color combinations that involve both a background |
| 5115 | ;; and a foreground value. | 3849 | ;; and a foreground value. |
| 5116 | (setq highlight-parentheses-background-colors (list cyan-refine-bg | 3850 | (setq highlight-parentheses-background-colors (list bg-cyan-intense |
| 5117 | magenta-refine-bg | 3851 | bg-magenta-intense |
| 5118 | green-refine-bg | 3852 | bg-green-intense |
| 5119 | yellow-refine-bg) | 3853 | bg-yellow-intense) |
| 5120 | highlight-parentheses-colors (list cyan-refine-fg | 3854 | highlight-parentheses-colors (list cyan |
| 5121 | magenta-refine-fg | 3855 | magenta |
| 5122 | green-refine-fg | 3856 | green |
| 5123 | yellow-refine-fg)) | 3857 | yellow)) |
| 5124 | 3858 | ||
| 5125 | ;; And here we pass only foreground colors while disabling any | 3859 | ;; And here we pass only foreground colors while disabling any |
| 5126 | ;; backgrounds. | 3860 | ;; backgrounds. |
| @@ -5160,14 +3894,14 @@ implementation: | |||
| 5160 | 3894 | ||
| 5161 | ;; Here we set color combinations that involve both a background | 3895 | ;; Here we set color combinations that involve both a background |
| 5162 | ;; and a foreground value. | 3896 | ;; and a foreground value. |
| 5163 | (setq highlight-parentheses-background-colors (list cyan-refine-bg | 3897 | (setq highlight-parentheses-background-colors (list bg-cyan-intense |
| 5164 | magenta-refine-bg | 3898 | bg-magenta-intense |
| 5165 | green-refine-bg | 3899 | bg-green-intense |
| 5166 | yellow-refine-bg) | 3900 | bg-yellow-intense) |
| 5167 | highlight-parentheses-colors (list cyan-refine-fg | 3901 | highlight-parentheses-colors (list cyan |
| 5168 | magenta-refine-fg | 3902 | magenta |
| 5169 | green-refine-fg | 3903 | green |
| 5170 | yellow-refine-fg)) | 3904 | yellow)) |
| 5171 | 3905 | ||
| 5172 | ;; And here we pass only foreground colors while disabling any | 3906 | ;; And here we pass only foreground colors while disabling any |
| 5173 | ;; backgrounds. | 3907 | ;; backgrounds. |
| @@ -5221,7 +3955,7 @@ Users who might prefer to fall below the minimum 7:1 contrast ratio in | |||
| 5221 | relative luminance (the accessibility target we conform with), can opt | 3955 | relative luminance (the accessibility target we conform with), can opt |
| 5222 | to configure the relevant faces on their own. | 3956 | to configure the relevant faces on their own. |
| 5223 | 3957 | ||
| 5224 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | 3958 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 5225 | 3959 | ||
| 5226 | This example uses more vivid background colors, though it comes at the | 3960 | This example uses more vivid background colors, though it comes at the |
| 5227 | very high cost of degraded legibility. | 3961 | very high cost of degraded legibility. |
| @@ -5229,14 +3963,14 @@ very high cost of degraded legibility. | |||
| 5229 | #+begin_src emacs-lisp | 3963 | #+begin_src emacs-lisp |
| 5230 | (modus-themes-with-colors | 3964 | (modus-themes-with-colors |
| 5231 | (custom-set-faces | 3965 | (custom-set-faces |
| 5232 | `(mmm-cleanup-submode-face ((,class :background ,yellow-refine-bg))) | 3966 | `(mmm-cleanup-submode-face ((,c :background ,bg-yellow-intense))) |
| 5233 | `(mmm-code-submode-face ((,class :background ,bg-active))) | 3967 | `(mmm-code-submode-face ((,c :background ,bg-inactive))) |
| 5234 | `(mmm-comment-submode-face ((,class :background ,blue-refine-bg))) | 3968 | `(mmm-comment-submode-face ((,c :background ,bg-blue-intense))) |
| 5235 | `(mmm-declaration-submode-face ((,class :background ,cyan-refine-bg))) | 3969 | `(mmm-declaration-submode-face ((,c :background ,bg-cyan-intense))) |
| 5236 | `(mmm-default-submode-face ((,class :background ,bg-alt))) | 3970 | `(mmm-default-submode-face ((,c :background ,bg-dim))) |
| 5237 | `(mmm-init-submode-face ((,class :background ,magenta-refine-bg))) | 3971 | `(mmm-init-submode-face ((,c :background ,bg-magenta-intense))) |
| 5238 | `(mmm-output-submode-face ((,class :background ,red-refine-bg))) | 3972 | `(mmm-output-submode-face ((,c :background ,bg-red-intense))) |
| 5239 | `(mmm-special-submode-face ((,class :background ,green-refine-bg))))) | 3973 | `(mmm-special-submode-face ((,c :background ,bg-green-intense))))) |
| 5240 | #+end_src | 3974 | #+end_src |
| 5241 | 3975 | ||
| 5242 | ** Note on prism.el | 3976 | ** Note on prism.el |
| @@ -5250,13 +3984,13 @@ implements an alternative to the typical coloration of code. Instead of | |||
| 5250 | highlighting the syntactic constructs, it applies color to different | 3984 | highlighting the syntactic constructs, it applies color to different |
| 5251 | levels of depth in the code structure. | 3985 | levels of depth in the code structure. |
| 5252 | 3986 | ||
| 5253 | As {{{file(prism.el)}}} offers a broad range of customizations, we cannot | 3987 | As =prism.el= offers a broad range of customizations, we cannot style |
| 5254 | style it directly at the theme level: that would run contrary to the | 3988 | it directly at the theme level: that would run contrary to the spirit |
| 5255 | spirit of the package. Instead, we may offer preset color schemes. | 3989 | of the package. Instead, we may offer preset color schemes. Those |
| 5256 | Those should offer a starting point for users to adapt to their needs. | 3990 | should offer a starting point for users to adapt to their needs. |
| 5257 | 3991 | ||
| 5258 | In the following code snippets, we employ the ~modus-themes-with-colors~ | 3992 | In the following code snippets, we employ the ~modus-themes-with-colors~ |
| 5259 | macro: [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | 3993 | macro: [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Use theme colors in code with modus-themes-with-colors]]. |
| 5260 | 3994 | ||
| 5261 | These are the minimum recommended settings with 16 colors: | 3995 | These are the minimum recommended settings with 16 colors: |
| 5262 | 3996 | ||
| @@ -5269,20 +4003,20 @@ These are the minimum recommended settings with 16 colors: | |||
| 5269 | :colors (modus-themes-with-colors | 4003 | :colors (modus-themes-with-colors |
| 5270 | (list fg-main | 4004 | (list fg-main |
| 5271 | magenta | 4005 | magenta |
| 5272 | cyan-alt-other | 4006 | cyan-cooler |
| 5273 | magenta-alt-other | 4007 | magenta-cooler |
| 5274 | blue | 4008 | blue |
| 5275 | magenta-alt | 4009 | magenta-warmer |
| 5276 | cyan-alt | 4010 | cyan-warmer |
| 5277 | red-alt-other | 4011 | red-cooler |
| 5278 | green | 4012 | green |
| 5279 | fg-main | 4013 | fg-main |
| 5280 | cyan | 4014 | cyan |
| 5281 | yellow | 4015 | yellow |
| 5282 | blue-alt | 4016 | blue-warmer |
| 5283 | red-alt | 4017 | red-warmer |
| 5284 | green-alt-other | 4018 | green-cooler |
| 5285 | fg-special-warm))) | 4019 | yellow-faint))) |
| 5286 | #+end_src | 4020 | #+end_src |
| 5287 | 4021 | ||
| 5288 | With 8 colors: | 4022 | With 8 colors: |
| @@ -5296,11 +4030,11 @@ With 8 colors: | |||
| 5296 | :colors (modus-themes-with-colors | 4030 | :colors (modus-themes-with-colors |
| 5297 | (list blue | 4031 | (list blue |
| 5298 | magenta | 4032 | magenta |
| 5299 | magenta-alt-other | 4033 | magenta-cooler |
| 5300 | cyan-alt-other | 4034 | cyan-cooler |
| 5301 | fg-main | 4035 | fg-main |
| 5302 | blue-alt | 4036 | blue-warmer |
| 5303 | red-alt-other | 4037 | red-cooler |
| 5304 | cyan))) | 4038 | cyan))) |
| 5305 | #+end_src | 4039 | #+end_src |
| 5306 | 4040 | ||
| @@ -5316,8 +4050,8 @@ to the themes' default aesthetic: | |||
| 5316 | :colors (modus-themes-with-colors | 4050 | :colors (modus-themes-with-colors |
| 5317 | (list blue | 4051 | (list blue |
| 5318 | magenta | 4052 | magenta |
| 5319 | magenta-alt-other | 4053 | magenta-cooler |
| 5320 | green-alt))) | 4054 | green-warmer))) |
| 5321 | #+end_src | 4055 | #+end_src |
| 5322 | 4056 | ||
| 5323 | If you need to apply desaturation and lightening, you can use what the | 4057 | If you need to apply desaturation and lightening, you can use what the |
| @@ -5330,47 +4064,11 @@ examples with the 4, 8, 16 colors): | |||
| 5330 | :lightens (cl-loop for i from 0 below 16 collect (* i 2.5)) | 4064 | :lightens (cl-loop for i from 0 below 16 collect (* i 2.5)) |
| 5331 | :colors (modus-themes-with-colors | 4065 | :colors (modus-themes-with-colors |
| 5332 | (list fg-main | 4066 | (list fg-main |
| 5333 | cyan-alt-other | 4067 | cyan-cooler |
| 5334 | magenta-alt-other | 4068 | magenta-cooler |
| 5335 | magenta))) | 4069 | magenta))) |
| 5336 | #+end_src | 4070 | #+end_src |
| 5337 | 4071 | ||
| 5338 | ** Note on god-mode.el | ||
| 5339 | :properties: | ||
| 5340 | :alt_title: Note for god-mode | ||
| 5341 | :custom_id: h:4da1d515-3e05-47ef-9e45-8251fc7e986a | ||
| 5342 | :end: | ||
| 5343 | |||
| 5344 | The ~god-mode~ library does not provide faces that could be configured by | ||
| 5345 | the Modus themes. Users who would like to get some visual feedback on | ||
| 5346 | the status of {{{kbd(M-x god-mode)}}} are instead encouraged by upstream to | ||
| 5347 | set up their own configurations, such as by changing the ~mode-line~ face | ||
| 5348 | ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization]]). This is an adaptation of the approach | ||
| 5349 | followed in the upstream README: | ||
| 5350 | |||
| 5351 | #+begin_src emacs-lisp | ||
| 5352 | (defun my-god-mode-update-mode-line () | ||
| 5353 | "Make `mode-line' blue if God local mode is active." | ||
| 5354 | (modus-themes-with-colors | ||
| 5355 | (if god-local-mode | ||
| 5356 | (set-face-attribute 'mode-line nil | ||
| 5357 | :foreground blue-active | ||
| 5358 | :background bg-active-accent | ||
| 5359 | :box blue) | ||
| 5360 | (set-face-attribute 'mode-line nil | ||
| 5361 | :foreground fg-active | ||
| 5362 | :background bg-active | ||
| 5363 | :box fg-alt)))) | ||
| 5364 | |||
| 5365 | (add-hook 'post-command-hook 'my-god-mode-update-mode-line) | ||
| 5366 | #+end_src | ||
| 5367 | |||
| 5368 | We employ the ~modus-themes-with-colors~ which provides access to color | ||
| 5369 | variables defined by the active theme. Its use is covered elsewhere in | ||
| 5370 | this manual ([[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]). As for the | ||
| 5371 | attributes that can be passed to each face, start by consulting the | ||
| 5372 | documentation string of ~set-face-attribute~. | ||
| 5373 | |||
| 5374 | ** Note on company-mode overlay pop-up | 4072 | ** Note on company-mode overlay pop-up |
| 5375 | :properties: | 4073 | :properties: |
| 5376 | :custom_id: h:20cef8c4-d11f-4053-8b2c-2872925780b1 | 4074 | :custom_id: h:20cef8c4-d11f-4053-8b2c-2872925780b1 |
| @@ -5387,6 +4085,8 @@ instead of overlays.[fn:: | |||
| 5387 | https://github.com/company-mode/company-mode/issues/1010][fn:: | 4085 | https://github.com/company-mode/company-mode/issues/1010][fn:: |
| 5388 | https://github.com/tumashu/company-posframe/] | 4086 | https://github.com/tumashu/company-posframe/] |
| 5389 | 4087 | ||
| 4088 | Also consider the ~corfu~ package. | ||
| 4089 | |||
| 5390 | ** Note on ERC escaped color sequences | 4090 | ** Note on ERC escaped color sequences |
| 5391 | :properties: | 4091 | :properties: |
| 5392 | :custom_id: h:98bdf319-1e32-4469-8a01-771200fba65c | 4092 | :custom_id: h:98bdf319-1e32-4469-8a01-771200fba65c |
| @@ -5500,38 +4200,6 @@ would be a good baseline for many themes and/or user configurations. | |||
| 5500 | Our target is the highest of the sort, though we do not demand that | 4200 | Our target is the highest of the sort, though we do not demand that |
| 5501 | everyone conforms with it. | 4201 | everyone conforms with it. |
| 5502 | 4202 | ||
| 5503 | ** Note on Helm grep | ||
| 5504 | :properties: | ||
| 5505 | :custom_id: h:d28879a2-8e4b-4525-986e-14c0f873d229 | ||
| 5506 | :end: | ||
| 5507 | |||
| 5508 | There is one face from the Helm package that is meant to highlight the | ||
| 5509 | matches of a grep or grep-like command (=ag= or =ripgrep=). It is | ||
| 5510 | ~helm-grep-match~. However, this face can only apply when the user does | ||
| 5511 | not pass =--color=always= as a command-line option for their command. | ||
| 5512 | |||
| 5513 | Here is the docstring for that face, which is defined in the | ||
| 5514 | {{{file(helm-grep.el)}}} library (you can always visit the source code with | ||
| 5515 | {{{kbd(M-x find-library)}}}). | ||
| 5516 | |||
| 5517 | #+begin_quote | ||
| 5518 | Face used to highlight grep matches. Have no effect when grep backend | ||
| 5519 | use "--color=" | ||
| 5520 | #+end_quote | ||
| 5521 | |||
| 5522 | The user must either remove =--color= from the flags passed to the grep | ||
| 5523 | function, or explicitly use =--color=never= (or equivalent). Helm | ||
| 5524 | provides user-facing customization options for controlling the grep | ||
| 5525 | function's parameters, such as ~helm-grep-default-command~ and | ||
| 5526 | ~helm-grep-git-grep-command~. | ||
| 5527 | |||
| 5528 | When =--color=always= is in effect, the grep output will use red text in | ||
| 5529 | bold letter forms to present the matching part in the list of | ||
| 5530 | candidates. That style still meets the contrast ratio target of >= 7:1 | ||
| 5531 | (accessibility standard WCAG AAA), because it draws the reference to | ||
| 5532 | ANSI color number 1 (red) from the already-supported array of | ||
| 5533 | ~ansi-color-names-vector~. | ||
| 5534 | |||
| 5535 | ** Note on pdf-tools link hints | 4203 | ** Note on pdf-tools link hints |
| 5536 | :properties: | 4204 | :properties: |
| 5537 | :custom_id: h:2659d13e-b1a5-416c-9a89-7c3ce3a76574 | 4205 | :custom_id: h:2659d13e-b1a5-416c-9a89-7c3ce3a76574 |
| @@ -5849,15 +4517,15 @@ A good theme is one that does so with consistency, though not | |||
| 5849 | uniformity. | 4517 | uniformity. |
| 5850 | 4518 | ||
| 5851 | In practical terms, a color scheme is what one uses when, for example, | 4519 | In practical terms, a color scheme is what one uses when, for example, |
| 5852 | they edit the first sixteen escape sequences of a terminal emulator to | 4520 | they replace the first sixteen escape sequences of a terminal emulator |
| 5853 | the hues of their preference. The terminal offers the option to choose, | 4521 | with color values of their preference. The terminal offers the option |
| 5854 | say, the exact value of what counts as "red", but does not provide the | 4522 | to choose, say, the exact value of what counts as "red", but does not |
| 5855 | means to control where that is mapped to and whether it should also have | 4523 | provide the means to control where that is mapped to and whether it |
| 5856 | other qualities such as a bold weight for the underlying text or an | 4524 | should also have other qualities such as a bold weight for the |
| 5857 | added background color. In contradistinction, Emacs uses constructs | 4525 | underlying text or an added background color. In contradistinction, |
| 5858 | known as "faces" which allow the user/developer to specify where a given | 4526 | Emacs uses constructs known as "faces" which allow the user/developer |
| 5859 | color will be used and whether it should be accompanied by other | 4527 | to specify where a given color will be used and whether it should be |
| 5860 | typographic or stylistic attributes. | 4528 | accompanied by other typographic or stylistic attributes. |
| 5861 | 4529 | ||
| 5862 | By configuring the multitude of faces on offer we thus control both | 4530 | By configuring the multitude of faces on offer we thus control both |
| 5863 | which colors are applied and how they appear in their context. When a | 4531 | which colors are applied and how they appear in their context. When a |
| @@ -5876,9 +4544,7 @@ it is already understood that one must follow the indicator or headline | |||
| 5876 | to view its contents and (ii) underlining everything would make the | 4544 | to view its contents and (ii) underlining everything would make the |
| 5877 | interface virtually unusable. | 4545 | interface virtually unusable. |
| 5878 | 4546 | ||
| 5879 | [[#h:5808be52-361a-4d18-88fd-90129d206f9b][Option for links]]. | 4547 | Again, one must exercise judgement in order to avoid discrimination, |
| 5880 | |||
| 5881 | Again, one must exercise judgment in order to avoid discrimination, | ||
| 5882 | where "discrimination" refers to: | 4548 | where "discrimination" refers to: |
| 5883 | 4549 | ||
| 5884 | + The treatment of substantially different magnitudes as if they were of | 4550 | + The treatment of substantially different magnitudes as if they were of |
| @@ -5888,9 +4554,9 @@ where "discrimination" refers to: | |||
| 5888 | 4554 | ||
| 5889 | (To treat similar things differently; to treat dissimilar things alike.) | 4555 | (To treat similar things differently; to treat dissimilar things alike.) |
| 5890 | 4556 | ||
| 5891 | If, in other words, one was to enforce uniformity without accounting for | 4557 | If, in other words, one is to enforce uniformity without accounting |
| 5892 | the particular requirements of each case---the contextual demands for | 4558 | for the particular requirements of each case---the contextual demands |
| 5893 | usability beyond matters of color---they would be making a | 4559 | for usability beyond matters of color---they are making a |
| 5894 | not-so-obvious error of treating different cases as if they were the | 4560 | not-so-obvious error of treating different cases as if they were the |
| 5895 | same. | 4561 | same. |
| 5896 | 4562 | ||
| @@ -5923,13 +4589,13 @@ doing so would run contrary to how this project is maintained where | |||
| 5923 | details matter greatly. | 4589 | details matter greatly. |
| 5924 | 4590 | ||
| 5925 | Each program has its own requirements so it won't always be | 4591 | Each program has its own requirements so it won't always be |
| 5926 | possible---or indeed desirable---to have 1:1 correspondence between what | 4592 | possible---or indeed desirable---to have 1:1 correspondence between |
| 5927 | applies to Emacs and what should be done elsewhere. No port should ever | 4593 | what applies to Emacs and what should be done elsewhere. No port |
| 5928 | strive to be a faithful copy of the Emacs implementation, as no other | 4594 | should ever strive to be a copy of the Emacs implementation, as no |
| 5929 | program is an Emacs equivalent, but instead try to follow the spirit of | 4595 | other program is an Emacs equivalent, but instead try to follow the |
| 5930 | the design. For example, some of the customization options accept a | 4596 | spirit of the design. For example, some of the customization options |
| 5931 | list as their value, or an alist, which may not be possible to reproduce | 4597 | accept a list as their value, or an alist, which may not be possible |
| 5932 | on other platforms. | 4598 | to reproduce on other platforms. |
| 5933 | 4599 | ||
| 5934 | [[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization options]]. | 4600 | [[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization options]]. |
| 5935 | 4601 | ||
| @@ -5939,10 +4605,10 @@ standards are not compromised and (ii) the overall character of the | |||
| 5939 | themes remains consistent. | 4605 | themes remains consistent. |
| 5940 | 4606 | ||
| 5941 | The former criterion should be crystal clear as it pertains to the | 4607 | The former criterion should be crystal clear as it pertains to the |
| 5942 | scientific foundations of the themes: high legibility and taking care of | 4608 | scientific foundations of the themes: high legibility and taking care |
| 5943 | the needs of users with red-green color deficiency (deuteranopia) by | 4609 | of the needs of users with red-green color deficiency (deuteranopia) |
| 5944 | avoiding red+green color coding paradigms and/or by providing red+blue | 4610 | by avoiding red+green color coding paradigms and/or by providing |
| 5945 | variants. | 4611 | yellow+blue variants ([[#h:f0f3dbcb-602d-40cf-b918-8f929c441baf][Overview]]). |
| 5946 | 4612 | ||
| 5947 | The latter criterion is the "je ne sais quoi" of the artistic aspect of | 4613 | The latter criterion is the "je ne sais quoi" of the artistic aspect of |
| 5948 | the themes, which is partially fleshed out in this manual. | 4614 | the themes, which is partially fleshed out in this manual. |
| @@ -5951,7 +4617,7 @@ the themes, which is partially fleshed out in this manual. | |||
| 5951 | 4617 | ||
| 5952 | With regard to the artistic aspect (where "art" qua skill may amount to | 4618 | With regard to the artistic aspect (where "art" qua skill may amount to |
| 5953 | an imprecise science), there is no hard-and-fast rule in effect as it | 4619 | an imprecise science), there is no hard-and-fast rule in effect as it |
| 5954 | requires one to exercise discretion and make decisions based on | 4620 | requires one to exercize discretion and make decisions based on |
| 5955 | context-dependent information or constraints. As is true with most | 4621 | context-dependent information or constraints. As is true with most |
| 5956 | things in life, when in doubt, do not cling on to the letter of the law | 4622 | things in life, when in doubt, do not cling on to the letter of the law |
| 5957 | but try to understand its spirit. | 4623 | but try to understand its spirit. |
| @@ -5980,13 +4646,17 @@ in which you can contribute to their ongoing development. | |||
| 5980 | :end: | 4646 | :end: |
| 5981 | #+cindex: Sources of the themes | 4647 | #+cindex: Sources of the themes |
| 5982 | 4648 | ||
| 5983 | The ~modus-operandi~ and ~modus-vivendi~ themes are built into Emacs 28. | 4649 | + Package name (GNU ELPA): ~modus-themes~ |
| 5984 | 4650 | + Official manual: <https://protesilaos.com/emacs/modus-themes> | |
| 5985 | The source code of the themes is [[https://git.sr.ht/~protesilaos/modus-themes][available on SourceHut]]. Or check the | 4651 | + Change log: <https://protesilaos.com/emacs/modus-themes-changelog> |
| 5986 | [[https://gitlab.com/protesilaos/modus-themes/][GitLab mirror (former main source)]] and the [[https://github.com/protesilaos/modus-themes/][GitHub mirror]]. | 4652 | + Color palette: <https://protesilaos.com/emacs/modus-themes-colors> |
| 5987 | 4653 | + Sample pictures: <https://protesilaos.com/emacs/modus-themes-pictures> | |
| 5988 | An HTML version of this manual is provided as an extension of the | 4654 | + Git repo on SourceHut: <https://git.sr.ht/~protesilaos/modus-themes> |
| 5989 | [[https://protesilaos.com/emacs/modus-themes/][author's personal website]] (does not rely on any non-free code). | 4655 | - Mirrors: |
| 4656 | + GitHub: <https://github.com/protesilaos/modus-themes> | ||
| 4657 | + GitLab: <https://gitlab.com/protesilaos/modus-themes> | ||
| 4658 | + Mailing list: <https://lists.sr.ht/~protesilaos/modus-themes> | ||
| 4659 | + Backronym: My Old Display Unexpectedly Sharpened ... themes | ||
| 5990 | 4660 | ||
| 5991 | ** Issues you can help with | 4661 | ** Issues you can help with |
| 5992 | :properties: | 4662 | :properties: |
| @@ -5994,10 +4664,8 @@ An HTML version of this manual is provided as an extension of the | |||
| 5994 | :end: | 4664 | :end: |
| 5995 | #+cindex: Contributing | 4665 | #+cindex: Contributing |
| 5996 | 4666 | ||
| 5997 | #+findex: modus-themes-report-bug | ||
| 5998 | A few tasks you can help with by sending an email to the general | 4667 | A few tasks you can help with by sending an email to the general |
| 5999 | [[https://lists.sr.ht/~protesilaos/modus-themes][modus-themes public mailing list]] (or use the command | 4668 | [[https://lists.sr.ht/~protesilaos/modus-themes][modus-themes public mailing list]]. |
| 6000 | ~modus-themes-report-bug~). | ||
| 6001 | 4669 | ||
| 6002 | + Suggest refinements to packages that are covered. | 4670 | + Suggest refinements to packages that are covered. |
| 6003 | + Report packages not covered thus far. | 4671 | + Report packages not covered thus far. |
| @@ -6014,10 +4682,6 @@ It is preferable that your feedback includes some screenshots, GIFs, or | |||
| 6014 | short videos, as well as further instructions to reproduce a given | 4682 | short videos, as well as further instructions to reproduce a given |
| 6015 | setup. Though this is not a requirement. | 4683 | setup. Though this is not a requirement. |
| 6016 | 4684 | ||
| 6017 | #+findex: modus-themes-version | ||
| 6018 | Also consider mentioning the version of the themes you are using, such | ||
| 6019 | as by invoking the command ~modus-themes-version~. | ||
| 6020 | |||
| 6021 | Whatever you do, bear in mind the overarching objective of the Modus | 4685 | Whatever you do, bear in mind the overarching objective of the Modus |
| 6022 | themes: to keep a contrast ratio that is greater or equal to 7:1 between | 4686 | themes: to keep a contrast ratio that is greater or equal to 7:1 between |
| 6023 | background and foreground colors. If a compromise is ever necessary | 4687 | background and foreground colors. If a compromise is ever necessary |
| @@ -6097,45 +4761,48 @@ The Modus themes are a collective effort. Every bit of work matters. | |||
| 6097 | 4761 | ||
| 6098 | + Author/maintainer :: Protesilaos Stavrou. | 4762 | + Author/maintainer :: Protesilaos Stavrou. |
| 6099 | 4763 | ||
| 6100 | + Contributions to code or documentation :: Alex Griffin, Anders | 4764 | + Contributions to code or documentation :: Aleksei Gusev, Alex |
| 6101 | Johansson, Antonio Ruiz, Basil L.{{{space()}}} Contovounesios, Björn | 4765 | Griffin, Anders Johansson, Antonio Ruiz, Basil L.{{{space()}}} |
| 6102 | Lindström, Carlo Zancanaro, Christian Tietze, Daniel Mendler, Eli | 4766 | Contovounesios, Björn Lindström, Carlo Zancanaro, Christian Tietze, |
| 6103 | Zaretskii, Fritz Grabo, Illia Ostapyshyn, Kévin Le Gouguec, Koen van | 4767 | Daniel Mendler, Eli Zaretskii, Fritz Grabo, Illia Ostapyshyn, Kévin |
| 6104 | Greevenbroek, Kostadin Ninev, Madhavan Krishnan, Manuel Giraud, | 4768 | Le Gouguec, Koen van Greevenbroek, Kostadin Ninev, Madhavan |
| 6105 | Markus Beppler, Matthew Stevenson, Mauro Aranda, Nicolas De | 4769 | Krishnan, Manuel Giraud, Markus Beppler, Matthew Stevenson, Mauro |
| 6106 | Jaeghere, Paul David, Philip Kaludercic, Pierre Téchoueyres, Rudolf | 4770 | Aranda, Nicolas De Jaeghere, Paul David, Philip Kaludercic, Pierre |
| 6107 | Adamkovič, Stephen Gildea, Shreyas Ragavan, Stefan Kangas, Utkarsh | 4771 | Téchoueyres, Rudolf Adamkovič, Stephen Gildea, Shreyas Ragavan, |
| 6108 | Singh, Vincent Murphy, Xinglu Chen, Yuanchen Xie, okamsn. | 4772 | Stefan Kangas, Utkarsh Singh, Vincent Murphy, Xinglu Chen, Yuanchen |
| 4773 | Xie, okamsn. | ||
| 6109 | 4774 | ||
| 6110 | + Ideas and user feedback :: Aaron Jensen, Adam Porter, Adam Spiers, | 4775 | + Ideas and user feedback :: Aaron Jensen, Adam Porter, Adam Spiers, |
| 6111 | Adrian Manea, Alex Griffin, Alex Koen, Alex Peitsinis, Alexey | 4776 | Adrian Manea, Aleksei Pirogov, Alex Griffin, Alex Koen, Alex |
| 6112 | Shmalko, Alok Singh, Anders Johansson, André Alexandre Gomes, Andrew | 4777 | Peitsinis, Alexey Shmalko, Alok Singh, Anders Johansson, André |
| 6113 | Tropin, Antonio Hernández Blas, Arif Rezai, Augusto Stoffel, Basil | 4778 | Alexandre Gomes, Andrew Tropin, Antonio Hernández Blas, Arif Rezai, |
| 6114 | L.{{{space()}}} Contovounesios, Burgess Chang, Christian Tietze, | 4779 | Augusto Stoffel, Basil L.{{{space()}}} Contovounesios, Burgess |
| 6115 | Christopher Dimech, Christopher League, Damien Cassou, Daniel | 4780 | Chang, Charlotte Van Petegem, Christian Tietze, Christopher Dimech, |
| 6116 | Mendler, Dario Gjorgjevski, David Edmondson, Davor Rotim, Divan | 4781 | Christopher League, Damien Cassou, Daniel Mendler, Dario |
| 6117 | Santana, Eliraz Kedmi, Emanuele Michele Alberto Monterosso, Farasha | 4782 | Gjorgjevski, David Edmondson, Davor Rotim, Divan Santana, Eliraz |
| 6118 | Euker, Feng Shu, Gautier Ponsinet, Gerry Agbobada, Gianluca Recchia, | 4783 | Kedmi, Emanuele Michele Alberto Monterosso, Farasha Euker, Feng Shu, |
| 6119 | Gonçalo Marrafa, Guilherme Semente, Gustavo Barros, Hörmetjan | 4784 | Gautier Ponsinet, Gerry Agbobada, Gianluca Recchia, Gonçalo Marrafa, |
| 6120 | Yiltiz, Ilja Kocken, Iris Garcia, Ivan Popovych, Jeremy Friesen, | 4785 | Guilherme Semente, Gustavo Barros, Hörmetjan Yiltiz, Ilja Kocken, |
| 6121 | Jerry Zhang, Johannes Grødem, John Haman, Jonas Collberg, Jorge | 4786 | Iris Garcia, Ivan Popovych, James Ferguson, Jeremy Friesen, Jerry |
| 6122 | Morais, Joshua O'Connor, Julio C. Villasante, Kenta Usami, Kevin | 4787 | Zhang, Johannes Grødem, John Haman, Jonas Collberg, Jorge Morais, |
| 6123 | Fleming, Kévin Le Gouguec, Kevin Kainan Li, Kostadin Ninev, Len | 4788 | Joshua O'Connor, Julio C. Villasante, Kenta Usami, Kevin Fleming, |
| 4789 | Kévin Le Gouguec, Kevin Kainan Li, Kostadin Ninev, Laith Bahodi, Len | ||
| 6124 | Trigg, Lennart C. Karssen, Luis Miguel Castañeda, Magne Hov, Manuel | 4790 | Trigg, Lennart C. Karssen, Luis Miguel Castañeda, Magne Hov, Manuel |
| 6125 | Uberti, Mark Bestley, Mark Burton, Mark Simpson, Markus Beppler, | 4791 | Uberti, Mark Bestley, Mark Burton, Mark Simpson, Markus Beppler, |
| 6126 | Matt Armstrong, Matthias Fuchs, Mauro Aranda, Maxime Tréca, Michael | 4792 | Matt Armstrong, Matthias Fuchs, Mattias Engdegård, Mauro Aranda, |
| 6127 | Goldenberg, Morgan Smith, Morgan Willcock, Murilo Pereira, Nicky van | 4793 | Maxime Tréca, Michael Goldenberg, Morgan Smith, Morgan Willcock, |
| 6128 | Foreest, Nicolas De Jaeghere, Pablo Stafforini, Paul Poloskov, | 4794 | Murilo Pereira, Nicky van Foreest, Nicolas De Jaeghere, Pablo |
| 6129 | Pengji Zhang, Pete Kazmier, Peter Wu, Philip Kaludercic, Pierre | 4795 | Stafforini, Paul Poloskov, Pengji Zhang, Pete Kazmier, Peter Wu, |
| 6130 | Téchoueyres, Przemysław Kryger, Robert Hepple, Roman Rudakov, Ryan | 4796 | Philip Kaludercic, Pierre Téchoueyres, Przemysław Kryger, Robert |
| 6131 | Phillips, Rytis Paškauskas, Rudolf Adamkovič, Sam Kleinman, Samuel | 4797 | Hepple, Roman Rudakov, Ryan Phillips, Rytis Paškauskas, Rudolf |
| 6132 | Culpepper, Saša Janiška, Shreyas Ragavan, Simon Pugnet, Tassilo | 4798 | Adamkovič, Sam Kleinman, Samuel Culpepper, Saša Janiška, Shreyas |
| 6133 | Horn, Thibaut Verron, Thomas Heartman, Togan Muftuoglu, Tony Zorman, | 4799 | Ragavan, Simon Pugnet, Tassilo Horn, Thibaut Verron, Thomas |
| 6134 | Trey Merkley, Tomasz Hołubowicz, Toon Claes, Uri Sharf, Utkarsh | 4800 | Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, Tomasz |
| 6135 | Singh, Vincent Foley. As well as users: Ben, CsBigDataHub1, Emacs | 4801 | Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley. As |
| 6136 | Contrib, Eugene, Fourchaux, Fredrik, Moesasji, Nick, Summer Emacs, | 4802 | well as users: Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, |
| 6137 | TheBlob42, Trey, bepolymathe, bit9tream, derek-upham, doolio, | 4803 | Fredrik, Moesasji, Nick, Summer Emacs, TheBlob42, Trey, bepolymathe, |
| 6138 | fleimgruber, gitrj95, iSeeU, jixiuf, okamsn, pRot0ta1p. | 4804 | bit9tream, derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, |
| 4805 | okamsn, pRot0ta1p, soaringbird, tumashu, wakamenod. | ||
| 6139 | 4806 | ||
| 6140 | + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, | 4807 | + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, |
| 6141 | Glenn Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core | 4808 | Glenn Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core |
| @@ -6153,42 +4820,6 @@ themes' design and/or aspects of their functionality. | |||
| 6153 | 4820 | ||
| 6154 | All errors are my own. | 4821 | All errors are my own. |
| 6155 | 4822 | ||
| 6156 | * Other notes about the project | ||
| 6157 | :properties: | ||
| 6158 | :custom_id: h:13752581-4378-478c-af17-165b6e76bc1b | ||
| 6159 | :end: | ||
| 6160 | #+cindex: Development notes | ||
| 6161 | |||
| 6162 | If you are curious about the principles that govern the development of | ||
| 6163 | this project read the essay [[https://protesilaos.com/codelog/2020-03-17-design-modus-themes-emacs/][On the design of the Modus themes]] | ||
| 6164 | (2020-03-17). | ||
| 6165 | |||
| 6166 | Here are some more publications for those interested in the kind of work | ||
| 6167 | that goes into this project (sometimes the commits also include details | ||
| 6168 | of this sort): | ||
| 6169 | |||
| 6170 | + [[https://protesilaos.com/codelog/2020-05-10-modus-operandi-palette-review/][Modus Operandi theme subtle palette review]] (2020-05-10) | ||
| 6171 | + [[https://protesilaos.com/codelog/2020-06-13-modus-vivendi-palette-review/][Modus Vivendi theme subtle palette review]] (2020-06-13) | ||
| 6172 | + [[https://protesilaos.com/codelog/2020-07-04-modus-themes-faint-colours/][Modus themes: new "faint syntax" option]] (2020-07-04) | ||
| 6173 | + [[https://protesilaos.com/codelog/2020-07-08-modus-themes-nuanced-colours/][Modus themes: major review of "nuanced" colours]] (2020-07-08) | ||
| 6174 | + [[https://protesilaos.com/codelog/2020-09-14-modus-themes-review-blues/][Modus themes: review of blue colours]] (2020-09-14) | ||
| 6175 | + [[https://protesilaos.com/codelog/2020-12-27-modus-themes-review-rainbow-delimiters/][Modus themes: review rainbow-delimiters faces]] (2020-12-27) | ||
| 6176 | + [[https://protesilaos.com/codelog/2021-01-11-modus-themes-review-select-faint-colours/][Modus themes: review of select "faint" colours]] (2021-01-11) | ||
| 6177 | + [[https://protesilaos.com/codelog/2021-02-25-modus-themes-diffs-deuteranopia/][The Modus themes now cover deuteranopia in diffs]] (2021-02-25) | ||
| 6178 | + [[https://protesilaos.com/codelog/2021-06-02-modus-themes-org-agenda/][Introducing the variable modus-themes-org-agenda]] (2021-06-02) | ||
| 6179 | + [[https://protesilaos.com/codelog/2022-01-02-review-modus-themes-org-habit-colours/][Modus themes: review of the org-habit graph colours]] (2022-01-02) | ||
| 6180 | + [[https://protesilaos.com/codelog/2022-01-03-modus-themes-port-faq/][Re: VSCode or Vim ports of the Emacs modus-themes?]] (2022-01-03) | ||
| 6181 | + [[https://protesilaos.com/codelog/2022-04-20-modus-themes-case-study-avy/][Modus themes: case study on Avy faces and colour combinations]] (2022-04-20) | ||
| 6182 | + [[https://protesilaos.com/codelog/2022-04-21-modus-themes-colour-theory/][Emacs: colour theory and techniques used in the Modus themes]] (2022-04-21) | ||
| 6183 | |||
| 6184 | And here are the canonical sources of this project: | ||
| 6185 | |||
| 6186 | + Manual :: <https://protesilaos.com/emacs/modus-themes> | ||
| 6187 | + Change Log :: <https://protesilaos.com/emacs/modus-themes-changelog> | ||
| 6188 | + Screenshots :: <https://protesilaos.com/emacs/modus-themes-pictures> | ||
| 6189 | + Git repository :: https://git.sr.ht/~protesilaos/modus-themes | ||
| 6190 | + Mailing list :: https://lists.sr.ht/~protesilaos/modus-themes | ||
| 6191 | |||
| 6192 | * GNU Free Documentation License | 4823 | * GNU Free Documentation License |
| 6193 | :properties: | 4824 | :properties: |
| 6194 | :appendix: t | 4825 | :appendix: t |