The themes are built into GNU Emacs 28 (development target).modus-operandi is light. modus-vivendi is dark. ..., check: + https://protesilaos.com/emacs/modus-themes-pictures/ + https://protesilaos.com/code-casts/ https://protesilaos.com/emacs/
Find a file
2019-10-29 17:28:43 +02:00
COPYING Rename LICENSE to the more appropriate COPYING 2019-09-28 08:55:54 +03:00
modus-operandi-theme.el UPGRADE: comprehensive support for HELM 2019-10-29 17:28:43 +02:00
modus-vivendi-theme.el UPGRADE: comprehensive support for HELM 2019-10-29 17:28:43 +02:00
README.org UPGRADE: comprehensive support for HELM 2019-10-29 17:28:43 +02:00

Modus Themes for GNU Emacs

Overview

Accessible themes for GNU Emacs. The contrast ratio between foreground and background values should always be >= 7:1, which conforms with the WCAG AAA accessibility standard. This is the highest standard of its kind.

The Modus project consists of two themes, one where dark text is cast on a light backdrop (Modus Operandi) and another where light text is displayed against a dark background (Modus Vivendi).

Check the Wiki page with the screen shots. Also note that I demo these themes in my Emacs-related screen casts (though older videos contain earlier "alpha" versions).

Installation and configuration

A package for MELPA is in the works. Stay tuned.

Manual method

Download the files ending in *-theme.el and place them in an appropriate directory, such as ~/.emacs.d/themes/. Then to make sure that path is read by Emacs, insert the following in your initialisation file (.emacs or init.el):

(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")

Load automatically

To load the theme of your choice automatically upon Emacs startup add this to your init file, replacing NAME with either operandi or vivendi:

(load-theme 'modus-NAME t)

Face coverage

This list will be updated to reflect the current state of the project. The idea is to offer an overview of the known status of all affected face groups.

Full support

  • all-the-icons
  • anzu
  • avy
  • aw
  • company-mode
  • deadgrep
  • dired-async
  • dired-subtree
  • diredfl
  • elfeed
  • emms
  • eshell
  • eww
  • fancy-dabbrev
  • flyspell
  • git/magit
  • gnus
  • helm*
  • ido-mode
  • info pages
  • isearch, occur, etc.
  • ivy
  • markdown-mode
  • matching parentheses
  • messages
  • modeline
  • mu4e
  • org-mode
  • outline-mode
  • rainbow-delimiters
  • speedbar
  • swiper
  • term
  • treemacs
  • undo-tree
  • visual-regexp
  • which-key
  • whitespace-mode

Covered but not styled explicitly

These do not require any extra styles because they are configured to inherit from some basic faces. Please confirm.

  • calendar
  • change-log
  • comint
  • bongo
  • log-edit
  • package menu
  • rmail

Partially supported (need manual intervention)

This section documents known cases where the Modus themes will not be used to their maximum potential. Solutions are suggested in context.

Ibuffer

The default ibuffer configurations for denoting the mark and delete flags are not good enough. My recommended tweak for those is to let them inherit the styles of Dired. Place something like this in your initialisation file.

(setq ibuffer-deletion-face 'dired-flagged)
(setq ibuffer-marked-face 'dired-marked)

Help needed

These are face groups that I am aware of but do not know how to access or do not actively use. I generally need to see how a face looks in its context before assessing its aesthetics or specific requirements.

Use M-x list-faces-display to get these.

  • diary
  • epa
  • nobreak-{hyphen,space}
  • smerge
  • transient-{argument,key,value}…
  • tty-menu
  • vc-{conflict-state,state-base}…

Note that the themes do provide support for org-mode, but some of these interfaces have been decided based on indirect experience. If you encounter anything that does not "feel right", please let me know.

Contributing

A few tasks you can help me with, sorted from the most probable to the least likely:

  • Suggest refinements to packages that are covered.
  • Report packages not covered thus far.
  • Report bugs, inconsistencies, shortcomings.
  • Help expand the documentation of covered-but-not-styled packages.
  • Suggest refinements to the colour palette.
  • Help expand this document or any other piece of documentation.
  • Help with development (see next section).

It would be great if your feedback also includes some screenshots, GIFs, or short videos. Though this is not a requirement.

Whatever you do, always bear in mind the overarching objective of the Modus themes: to keep a contrast ratio that is greater or equal to 7:1 between background and foreground colours.

Development notes and objectives

To test the contrast ratio between two colour values in hexadecimal RGB notation (of the style #ffffff), you can use the online tool provided by WebAim, or my own clr shell script that implements the same formula (I always use the latter, but am sure that the results are the same).

Now on to some under-the-hood objectives for the longer term maintainability of the project:

  • All faces should be defined in a single file, the template, since the themes use the exact same mappings. The template will avoid the duplication of face coverage/definition across both themes.
  • The theme files, Modus Operandi and Modus Vivendi, should only define their colour palette. That is the only group that differentiates them.
  • Theme files would thus inherit/source/require the template and pass the value of their variables to the relevant constructs.

The design notwithstanding, I would also be interested to improve the quality of the code, in any way that may be.

COPYING

The Modus Themes are distributed under the terms of the GNU General Public License version 3 or, at your choice, any later version. See the COPYING file distributed in the project's Git repository.