Next: Note on prism.el, Previous: Note on highlight-parentheses.el, Up: Notes on individual packages [Index]
The faces used by mmm-mode.el are expected to have a colorful background, while they should not touch any foreground value. The idea is that they must not interfere with existing fontification. Those background colors need to be distinct from each other, such as an unambiguous red juxtaposed with a clear blue.
While this design may be internally consistent with the raison d’être of that library, it inevitably produces inaccessible color combinations.
There are two competing goals at play:
As the Modus themes are designed with the express purpose of conforming with the first point, we have to forgo the apparent color-coding of the background elements. Instead we use subtle colors that do not undermine the legibility of the affected text while they still offer a sense of added context.
Users who might prefer to fall below the minimum 7:1 contrast ratio in relative luminance (the accessibility target we conform with), can opt to configure the relevant faces on their own.
Use theme colors in code with modus-themes-with-colors.
This example uses more vivid background colors, though it comes at the very high cost of degraded legibility.
(modus-themes-with-colors (custom-set-faces `(mmm-cleanup-submode-face ((,c :background ,bg-yellow-intense))) `(mmm-code-submode-face ((,c :background ,bg-inactive))) `(mmm-comment-submode-face ((,c :background ,bg-blue-intense))) `(mmm-declaration-submode-face ((,c :background ,bg-cyan-intense))) `(mmm-default-submode-face ((,c :background ,bg-dim))) `(mmm-init-submode-face ((,c :background ,bg-magenta-intense))) `(mmm-output-submode-face ((,c :background ,bg-red-intense))) `(mmm-special-submode-face ((,c :background ,bg-green-intense)))))
Next: Note on prism.el, Previous: Note on highlight-parentheses.el, Up: Notes on individual packages [Index]