Expand 'deftheme' with metadata

This is to support new features in Emacs where themes can specify
the set they belong to, as well as whether they are light or dark.
The built-in command is 'theme-choose-variant'.

This is in response to Emacs bug#65468:
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65468>.  Thanks to
Mauro Aranda for bringing this matter to my attention.
This commit is contained in:
Protesilaos Stavrou 2023-08-25 06:37:18 +03:00
parent ad36c88feb
commit b23c84e6b4
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
8 changed files with 40 additions and 32 deletions

View file

@ -43,6 +43,7 @@
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-operandi-deuteranopia
"Deuteranopia-optimized theme with a white background.
This variant is optimized for users with red-green color
@ -50,7 +51,10 @@ deficiency (deuteranopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard).")
standard)."
:background-mode 'light
:kind 'color-scheme
:family 'modus)
(defconst modus-operandi-deuteranopia-palette
'(
@ -479,7 +483,4 @@ represents."
(provide-theme 'modus-operandi-deuteranopia))
;;;###theme-autoload
(put 'modus-operandi-deuteranopia 'theme-properties '(:background-mode light :kind color-scheme :family modus))
;;; modus-operandi-deuteranopia-theme.el ends here

View file

@ -43,12 +43,16 @@
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-operandi
"Elegant, highly legible theme with a white background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard).")
7:1 (WCAG AAA standard)."
:background-mode 'light
:kind 'color-scheme
:family 'modus)
(defconst modus-operandi-palette
'(
@ -477,7 +481,4 @@ represents."
(provide-theme 'modus-operandi))
;;;###theme-autoload
(put 'modus-operandi 'theme-properties '(:background-mode light :kind color-scheme :family modus))
;;; modus-operandi-theme.el ends here

View file

@ -42,12 +42,16 @@
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-operandi-tinted
"Elegant, highly legible theme with a light ochre background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard).")
7:1 (WCAG AAA standard)."
:background-mode 'light
:kind 'color-scheme
:family 'modus)
(defconst modus-operandi-tinted-palette
'(
@ -476,7 +480,4 @@ represents."
(provide-theme 'modus-operandi-tinted))
;;;###theme-autoload
(put 'modus-operandi-tinted 'theme-properties '(:background-mode light :kind color-scheme :family modus))
;;; modus-operandi-tinted-theme.el ends here

View file

@ -43,6 +43,7 @@
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-operandi-tritanopia
"Tritanopia-optimized theme with a white background.
This variant is optimized for users with blue-yellow color
@ -50,7 +51,10 @@ deficiency (tritanopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard).")
standard)."
:background-mode 'light
:kind 'color-scheme
:family 'modus)
(defconst modus-operandi-tritanopia-palette
'(
@ -479,7 +483,4 @@ represents."
(provide-theme 'modus-operandi-tritanopia))
;;;###theme-autoload
(put 'modus-operandi-tritanopia 'theme-properties '(:background-mode light :kind color-scheme :family modus))
;;; modus-operandi-tritanopia-theme.el ends here

View file

@ -42,6 +42,7 @@
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi-deuteranopia
"Deuteranopia-optimized theme with a black background.
This variant is optimized for users with red-green color
@ -49,7 +50,10 @@ deficiency (deuteranopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard).")
standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-deuteranopia-palette
'(
@ -478,7 +482,4 @@ represents."
(provide-theme 'modus-vivendi-deuteranopia))
;;;###theme-autoload
(put 'modus-vivendi-deuteranopia 'theme-properties '(:background-mode dark :kind color-scheme :family modus))
;;; modus-vivendi-deuteranopia-theme.el ends here

View file

@ -42,12 +42,16 @@
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi
"Elegant, highly legible theme with a black background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard).")
7:1 (WCAG AAA standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-palette
'(
@ -477,7 +481,4 @@ represents."
(provide-theme 'modus-vivendi))
;;;###theme-autoload
(put 'modus-vivendi 'theme-properties '(:background-mode dark :kind color-scheme :family modus))
;;; modus-vivendi-theme.el ends here

View file

@ -42,12 +42,16 @@
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi-tinted
"Elegant, highly legible theme with a night sky background.
Conforms with the highest legibility standard for color contrast
between background and foreground in any given piece of text,
which corresponds to a minimum contrast in relative luminance of
7:1 (WCAG AAA standard).")
7:1 (WCAG AAA standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-tinted-palette
'(
@ -476,7 +480,4 @@ represents."
(provide-theme 'modus-vivendi-tinted))
;;;###theme-autoload
(put 'modus-vivendi-tinted 'theme-properties '(:background-mode dark :kind color-scheme :family modus))
;;; modus-vivendi-tinted-theme.el ends here

View file

@ -43,6 +43,7 @@
(require-theme 'modus-themes t))
(require 'modus-themes))
;;;###theme-autoload
(deftheme modus-vivendi-tritanopia
"Tritanopia-optimized theme with a black background.
This variant is optimized for users with blue-yellow color
@ -50,7 +51,10 @@ deficiency (tritanopia). It conforms with the highest
legibility standard for color contrast between background and
foreground in any given piece of text, which corresponds to a
minimum contrast in relative luminance of 7:1 (WCAG AAA
standard).")
standard)."
:background-mode 'dark
:kind 'color-scheme
:family 'modus)
(defconst modus-vivendi-tritanopia-palette
'(
@ -479,7 +483,4 @@ represents."
(provide-theme 'modus-vivendi-tritanopia))
;;;###theme-autoload
(put 'modus-vivendi-tritanopia 'theme-properties '(:background-mode dark :kind color-scheme :family modus))
;;; modus-vivendi-tritanopia-theme.el ends here