summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--themes.el
blob: 26931f51f56b3b86705951195a9d37293d4563c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
;;; -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:


(use-package modus-themes
  :load-path (lambda () (expand-file-name "themes/" data-directory))
  :demand t
  :init
  (load-theme 'modus-vivendi-tinted t)
  :hook
  ((modus-themes-post-load . bd/modus-set-faces))
  :config
  ;; Disable all other themes to avoid awkward blending
  (defun bd/modus-set-faces (&rest _)
    "Blends the modeline with the echo area,
and some other minor face changes."
    (modus-themes-with-colors
      (custom-set-faces
       `(eshell-prompt ((,c :foreground ,fg-main :background ,bg-prose-block-contents :height 1.1 :extend t)))
       `(tab-bar-tab ((,c :box (:line-width 1 :style released-button)))))))
  (setopt modus-themes-to-toggle '(modus-operandi-tinted modus-vivendi-tinted)
	  modus-themes-mixed-fonts t
	  modus-themes-italic-constructs t
	  modus-themes-bold-constructs t
	  modus-themes-variable-pitch-ui t
	  modus-themes-prompts '(bold)
	  modus-themes-headings
	  '((0 variable-pitch regular 1.4)
	    (1 variable-pitch regular 1.4)
	    (2 variable-pitch regular 1.3)
	    (3 variable-pitch regular 1.2)
	    (t variable-pitch regular 1.2))
	  modus-themes-common-palette-overrides
	  '((bg-main "#1a1c20")
	    (bg-active bg-main)
	    (fg-main "#cff0f6")
	    (fg-active fg-main)
	    (fg-mode-line-active "#a6accd")
	    (bg-mode-line-active "#2b2d42")
	    (fg-mode-line-inactive "#676E95")
	    (bg-mode-line-inactive "#181c2d")
	    (border-mode-line-active nil)
	    (border-mode-line-inactive nil)
	    (bg-tab-bar bg-main)
	    (bg-tab-current bg-main)
	    (bg-tab-other "#3b3d62")

	    (fg-heading-0 "#b2ebf2")
	    (fg-heading-1 "#98fb98")
	    (fg-heading-2 "#fa80e6")
	    (fg-heading-3 "#ff7f50")
	    (fg-heading-4 "#ffd700")

	    (fg-prompt "#ca65e3")
	    (bg-prompt unspecified)

	    (bg-region "#3C435E")
	    (fg-region "#fffff0")

	    (fg-line-number-active fg-main)
	    (fg-line-number-inactive "#a9a9a9")
	    (bg-line-number-active unspecified)
	    (bg-line-number-inactive "#292939")
	    (fringe bg-main)
	    (cursor "#b2ebf2")

	    (fg-prose-verbatim "#af9fff")
	    (bg-prose-block-contents "#222b42")
	    (fg-prose-block-delimiter "#7C839E")
	    (bg-prose-block-delimiter bg-prose-block-contents)

	    (keyword "#4dd0e1")
	    (builtin "#a490ff")
	    (comment "#afa7b0")
	    (string "#50f2ca")
	    (fnname "#d8bfd8")
	    (type "#89c6f9")
	    (variable "#98fb98")
	    (docstring "#f0e68c")
	    (constant "#fa80e6"))))
(run-hooks 'modus-themes-post-load-hook)

(defun bd/enable-variable-pitch-exempt ()
  "Text modes to exempt from variable pitch fonts."
  (unless (derived-mode-p 'latex-mode 'mhtml-mode 'nxml-mode 'yaml-mode)
    (variable-pitch-mode 1)))

(defvar bd/enable-variable-pitch-in-hooks
  '(text-mode-hook)
  "List of hook symbols to add `variable-pitch-mode'
to.")

(mapc
 (lambda (hook)
   (add-hook hook #'bd/enable-variable-pitch-exempt))
 bd/enable-variable-pitch-in-hooks)

(set-face-attribute 'variable-pitch nil
                    :family "Dejavu Serif"
                    :height 110)
(set-face-attribute 'fixed-pitch nil
                    :family "Iosevka"
                    :height 120)
(set-face-attribute 'default nil
                    :family "Iosevka"
                    :height 140)
(set-face-attribute 'modus-themes-ui-variable-pitch nil
		    :family "MedievalSharp"
		    :height 130)
(mapc (lambda (x) (set-face-attribute x nil :family "MedievalSharp"))
      '(modus-themes-heading-0
	modus-themes-heading-1
	modus-themes-heading-2
	modus-themes-heading-3
	modus-themes-heading-4
	modus-themes-heading-5
	modus-themes-heading-6
	modus-themes-heading-7
	modus-themes-heading-8))


(provide 'bd--themes)
;;; bd--themes.el ends here