-
Notifications
You must be signed in to change notification settings - Fork 15
/
poet-dark-theme.el
293 lines (274 loc) · 14.8 KB
/
poet-dark-theme.el
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
;;; poet-dark-theme.el --- A dark theme for prose.
;; Copyright 2018-now Kunal Bhalla
;; Author: Kunal Bhalla <[email protected]>
;; URL: https://github.com/kunalb/poet/
;; Version: 2.1
;; Package-Requires: ((emacs "24.1"))
;; Keywords: faces, theme, prose
;;; Commentary:
;; An emacs theme that's well suited for prose: particularly org-mode and
;; markdown-mode; or any mode that works well with `variable-pitch` mode.
;; Emacs has very good support for multiple fonts in a single
;; file. Poet uses this support to make it much more convenient to
;; write prose within Emacs, with particular attention paid to
;; org-mode and markdown-mode. Code blocks, tables, etc are
;; formatted in monospace text with the appropriate backgrounds.
;; Theme Customizations
;; - `poet-theme-variable-headers`
;; Enable / disable different text heights for different faces.
;; - `poet-theme-variable-pitch-multiplier`
;; Relative size for the variable pitch font; modify for a better visual
;; balance.
;; NOTE: poet-variable-headers was renamed to poet-theme-variable-headers.
;; Recommended customizations for using this theme
;;
;; - Set up the base fonts you'd like to use in Emacs before loading Poet
;; (set-face-attribute 'default nil :family "Iosevka" :height 130)
;; (set-face-attribute 'fixed-pitch nil :family "Iosevka")
;; (set-face-attribute 'variable-pitch nil :family "Baskerville")
;; On loading this theme captures the default and treats that for fixed-pitch
;; rendering.
;;
;; - Enable variable pitch mode for editing text
;; (add-hook 'text-mode-hook
;; (lambda ()
;; (variable-pitch-mode 1))
;; This file was generated by tangling metapoet.org, included with the theme.
;;; Code:
(defvar poet-theme-monospace-height
(face-attribute 'fixed-pitch :height nil 'default)
"The original height stored as a defvar to stay constant across reloads.")
(defgroup poet-theme nil
"Customizations to change the behavior of poet"
:group 'faces
:prefix "poet-"
:tag "Poet")
(defcustom poet-theme-variable-pitch-multiplier
1.23
"The size multiplier to use for variable pitch.
Modify this to get a better balance between the monospace and
variable-pitch fonts you're using: a value from ~1.1 to ~1.3
tends to work well."
:group 'poet-theme
:type 'number)
(defcustom poet-theme-variable-headers t
"Use varying sizes for headers in org and markdown"
:group 'poet-theme
:type 'boolean)
(defun poet-theme--height (multiplier)
"Returns the height as MULTIPLIER * variable-pitch height."
(if poet-theme-variable-headers
(truncate (* poet-theme-variable-pitch-multiplier
(* poet-theme-monospace-height multiplier)))
(truncate (* poet-theme-variable-pitch-multiplier
poet-theme-monospace-height))))
(deftheme poet-dark
"A prose friendly dark theme")
(let ((fg "#EDE7dd")
(bg "#111010")
(emph "#eeeeee")
(sep "#444444")
(hlt "#000000")
(bg-hlt "#012c32")
(muted "#aaaaaa")
(meta "#ede7dd")
(link "#ffdba5")
(link-underline "#ffdba5")
(vlink-underline "#ffffff")
(header "#ceb39e")
(button "#aaaaaa")
(glyph "#f7ffd1")
(cursor "#FFD5BE")
(paren-match-bg "#ff1744")
(paren-match-fg "#ffffff")
(search-fg "#ffffff")
(search-bg "#fb6542")
(search-fail-bg "#f8bbd0")
(tooltip-fg "#111111")
(tooltip-bg "#fff176")
(shadow "#999999")
(secondary-bg "#000000")
(trailing-bg "#ff8a65")
(fci "#dedede")
(lazy-hlt-fg "#000000")
(lazy-hlt-bg "#ffffff")
(evil-rep-fg "#ffffff")
(evil-rep-bg "#4e342e")
(mode-line-fg "#edd3c4")
(header-line-bg "#111111")
(mode-line-hlt "#000000")
(mode-line-inactive "#888888")
(error "#df5286")
(builtin "#b85750")
(string "#dddddd")
(function-name "#80bd9e")
(keyword "#c1caa1")
(constant "#90afc5")
(type "#cfa6a8")
(variable "#ffa575")
(org-meta "#c6b6ad")
(org-document-info "#c6b6ad")
(org-table "#171716")
(org-quote-fg "#e6e6fa")
(org-quote-bg "#171716")
(org-date "#c6b6ad")
(org-title "#ee7e38")
(org-title-underline "#ee7e38")
(org-checkbox "#999999")
(org-scheduled "#dddddd")
(org-scheduled-today "#ffffff")
(org-done "#5EE300")
(org-todo "#FF3D00")
(org-tag "#aaaaaa")
(org-block-line "#070706")
(org-block-bg "#171716")
(org-agenda-structure-fg "#aaaaaa")
(org-agenda-structure-bg "#111111")
(org-agenda-today-fg "#dddddd")
(org-agenda-today-bg "#000000")
(org-special-keyword "#777777")
(org-sched-prev "#ffb6c1")
(org-agenda-done "#b9ccb2")
(hl-line "#3d0000")
(linum-hlt "#bbbbbb")
(linum "#555555")
(markdown-markup "#8D6E63")
(markdown-metadata "#777777")
(markdown-language "#BE8CD4")
(markdown-list "#ffffff")
(markdown-code-bg "#171716")
(markdown-pre-bg "#171716")
(markdown-header-delimiter "#8D6E63")
(imenu "#ceb39e"))
(custom-theme-set-faces 'poet-dark
`(variable-pitch ((t (:family ,(face-attribute 'variable-pitch :family) :height (lambda (_x) (poet-theme--height 1))))))
`(default ((t (:background ,bg :foreground ,fg))))
`(italic ((t (:foreground ,emph :slant italic))))
`(highlight ((t (:background ,hlt :overline nil))))
`(region ((t (:background ,bg-hlt))))
`(fringe ((t (:background ,bg))))
`(button ((t (:inherit default :foreground ,button))))
`(escape-glyph ((t (:foreground ,glyph))))
`(link ((t (:underline (:color ,link-underline :style line) :foreground ,link))))
`(link-visited ((t (:inherit link :foreground ,link :underline (:color ,vlink-underline :style line)))))
`(cursor ((t (:background ,cursor))))
`(show-paren-match ((t (:background ,paren-match-fg :foreground ,paren-match-bg))))
`(isearch ((t (:foreground ,search-fg :background ,search-bg))))
`(isearch-fail ((t (:background ,search-fail-bg))))
`(query-replace ((t (:inherit isearch))))
`(tooltip ((t (:inherit default :foreground ,tooltip-fg :background ,tooltip-bg))))
`(shadow ((t (:foreground ,shadow))))
`(secondary-selection ((t (:background ,secondary-bg))))
`(trailing-whitespace ((t (:background ,trailing-bg))))
`(lazy-highlight ((t (:foreground ,lazy-hlt-fg :background ,lazy-hlt-bg))))
`(next-error ((t (:inherit region))))
`(window-divider ((t (:background ,sep :foreground ,sep))))
`(vertical-border ((t (:background ,sep :foreground ,sep))))
`(evil-ex-substitute-replacement ((t (:foreground ,evil-rep-fg :background ,evil-rep-bg :underline nil))))
`(minibuffer-prompt ((t (:inherit fixed-pitch :weight bold :foreground ,meta))))
`(mode-line ((t (:inherit fixed-pitch :foreground ,mode-line-fg :background ,bg :overline ,sep :box (:line-width 3 :color ,bg)))))
`(header-line ((t (:overline nil :background ,header-line-bg :box (:line-width 3 :color ,header-line-bg) :underline ,sep :inherit mode-line))))
`(mode-line-buffer-id ((t (:weight bold))))
`(mode-line-emphasis ((t (:weight bold))))
`(mode-line-highlight ((t (:background ,mode-line-hlt))))
`(mode-line-inactive ((t (:inherit mode-line :background ,bg :foreground ,mode-line-inactive :box (:color ,bg :line-width 3)))))
`(error ((t (:foreground ,error :inherit fixed-pitch))))
`(font-lock-comment-face ((t (:foreground ,muted :inherit fixed-pitch))))
`(font-lock-builtin-face ((t (:foreground ,builtin :inherit fixed-pitch))))
`(font-lock-string-face ((t (:inherit fixed-pitch :foreground ,string))))
`(font-lock-function-name-face ((t (:inherit fixed-pitch :foreground ,function-name))))
`(font-lock-keyword-face ((t (:inherit fixed-pitch :foreground ,keyword))))
`(font-lock-comment-delimiter-face ((t (:inherit fixed-pitch :inherit font-lock-comment-face))))
`(font-lock-constant-face ((t (:inherit fixed-pitch :foreground ,constant))))
`(font-lock-doc-face ((t (:inherit fixed-pitch :inherit font-lock-string-face))))
`(font-lock-preprocessor-face ((t (:inherit fixed-pitch :inherit font-lock-builtin-face))))
`(font-lock-regexp-grouping-backslash ((t (:inherit fixed-pitch :inherit bold))))
`(font-lock-regexp-grouping-construct ((t (:inherit fixed-pitch :inherit bold))))
`(font-lock-type-face ((t (:foreground ,type :inherit fixed-pitch))))
`(font-lock-variable-name-face ((t (:inherit fixed-pitch :foreground ,variable))))
`(font-lock-warning-face ((t (:inherit error))))
`(org-level-1 ((t (:inherit default :foreground ,header :height (lambda (_x) (poet-theme--height 1.5))))))
`(org-level-2 ((t (:inherit default :foreground ,header :height (lambda (_x) (poet-theme--height 1.4))))))
`(org-level-3 ((t (:inherit default :foreground ,header :height (lambda (_x) (poet-theme--height 1.3))))))
`(org-level-4 ((t (:inherit default :foreground ,header :height (lambda (_x) (poet-theme--height 1.23))))))
`(org-level-5 ((t (:inherit default :foreground ,header :height (lambda (_x) (poet-theme--height 1.23))))))
`(org-level-6 ((t (:inherit default :foreground ,header :height (lambda (_x) (poet-theme--height 1.23))))))
`(org-level-7 ((t (:inherit default :foreground ,header :height (lambda (_x) (poet-theme--height 1.23))))))
`(org-level-8 ((t (:inherit default :foreground ,header :height (lambda (_x) (poet-theme--height 1.23))))))
`(org-meta-line ((t (:inherit fixed-pitch :foreground ,org-meta))))
`(org-document-info-keyword ((t (:inherit fixed-pitch :foreground ,org-document-info))))
`(org-document-info ((t (:inherit default :foreground ,org-document-info))))
`(org-verbatim ((t (:inherit fixed-pitch))))
`(org-code ((t (:inherit fixed-pitch))))
`(org-table ((t (:inherit fixed-pitch :background ,org-table))))
`(org-formula ((t (:inherit org-table :height (lambda (_x) (poet-theme--height 1))))))
`(org-verse ((t (:inherit default :foreground ,org-quote-fg :background ,org-quote-bg))))
`(org-quote ((t (:inherit default :foreground ,org-quote-fg :background ,org-quote-bg))))
`(org-hide ((t (:inherit fixed-pitch :foreground ,bg))))
`(org-indent ((t (:inherit org-hide))))
`(org-date ((t (:inherit fixed-pitch :foreground ,org-date :underline nil))))
`(org-document-title ((t (:inherit default :foreground ,org-title :height (lambda (_x) (poet-theme--height 1.8)) :underline (:color ,org-title-underline)))))
`(org-checkbox ((t (:inherit fixed-pitch :weight bold :foreground ,org-checkbox))))
`(org-done ((t (:inherit fixed-pitch :foreground ,org-done))))
`(org-todo ((t (:inherit fixed-pitch :foreground ,org-todo))))
`(org-tag ((t (:inherit fixed-pitch :height (lambda (_x) (poet-theme--height 1)) :foreground ,org-tag))))
`(org-block-begin-line ((t (:inherit fixed-pitch :background ,org-block-line))))
`(org-block-end-line ((t (:inherit fixed-pitch :background ,org-block-line))))
`(org-block ((t (:background ,org-block-bg :inherit fixed-pitch))))
`(org-priority ((t (:inherit fixed-pitch :weight normal))))
`(org-agenda-structure ((t (:foreground ,org-agenda-structure-fg :background ,bg :box (:line-width 3 :color ,bg) :underline ,org-agenda-structure-bg))))
`(org-scheduled ((t (:foreground ,org-scheduled))))
`(org-scheduled-today ((t (:foreground ,org-scheduled-today))))
`(org-agenda-date-weekend ((t (:inherit org-agenda-structure))))
`(org-agenda-date-today ((t (:box (:line-width 3 :color ,org-agenda-today-bg) :foreground ,org-agenda-today-fg :background ,org-agenda-today-bg))))
`(org-special-keyword ((t (:inherit fixed-pitch :foreground ,org-special-keyword))))
`(org-scheduled-previously ((t (:foreground ,org-sched-prev))))
`(org-agenda-done ((t (:foreground ,org-agenda-done))))
`(org-footnote ((t (:foreground ,link))))
`(hl-line ((t (:background ,hl-line))))
`(linum-highlight-face ((t (:inherit fixed-pitch :foreground ,linum-hlt))))
`(linum ((t (:inherit fixed-pitch :foreground ,linum))))
`(line-number ((t (:inherit fixed-pitch :foreground ,linum))))
`(line-number-current-line ((t (:inherit fixed-pitch :foreground ,linum-hlt))))
`(markdown-header-face-1 ((t (:foreground ,header :inherit default :height (lambda (_x) (poet-theme--height 1.5))))))
`(markdown-header-face-2 ((t (:foreground ,header :inherit default :height (lambda (_x) (poet-theme--height 1.4))))))
`(markdown-header-face-3 ((t (:foreground ,header :inherit default :height (lambda (_x) (poet-theme--height 1.3))))))
`(markdown-header-face-4 ((t (:foreground ,header :inherit default :height (lambda (_x) (poet-theme--height 1.23))))))
`(markdown-header-face-5 ((t (:foreground ,header :inherit default :height (lambda (_x) (poet-theme--height 1.23))))))
`(markdown-header-face-6 ((t (:foreground ,header :inherit default :height (lambda (_x) (poet-theme--height 1.23))))))
`(markdown-header-face-7 ((t (:foreground ,header :inherit default :height (lambda (_x) (poet-theme--height 1.23))))))
`(markdown-header-face-8 ((t (:foreground ,header :inherit default :height (lambda (_x) (poet-theme--height 1.23))))))
`(markdown-markup-face ((t (:inherit fixed-pitch :foreground ,markdown-markup))))
`(markdown-inline-code-face ((t (:inherit fixed-pitch))))
`(markdown-metadata-key-face ((t (:inherit fixed-pitch :height (lambda (_x) (poet-theme--height 1)) :foreground ,markdown-metadata))))
`(markdown-metadata-value-face ((t (:inherit fixed-pitch :height (lambda (_x) (poet-theme--height 1)) :foreground ,fg))))
`(markdown-language-keyword-face ((t (:foreground ,markdown-language))))
`(markdown-list-face ((t (:inherit fixed-pitch :foreground ,markdown-list))))
`(markdown-code-face ((t (:inherit fixed-pitch :foreground ,fg :background ,markdown-code-bg))))
`(markdown-pre-face ((t (:inherit fixed-pitch :color ,fg :background ,markdown-pre-bg))))
`(markdown-header-delimiter-face ((t (:inherit fixed-pitch :foreground ,markdown-header-delimiter))))
`(markdown-header-rule-face ((t (:inherit fixed-pitch :foreground ,markdown-header-delimiter))))
`(markdown-url-face ((t (:inherit fixed-pitch :foreground ,link))))
`(imenu-list-entry-face-0 ((t (:foreground ,imenu))))
`(imenu-list-entry-face-1 ((t (:foreground ,imenu))))
`(imenu-list-entry-face-2 ((t (:foreground ,imenu))))
`(imenu-list-entry-face-3 ((t (:foreground ,imenu))))
`(imenu-list-entry-face-4 ((t (:foreground ,imenu))))
`(imenu-list-entry-face-5 ((t (:foreground ,imenu))))
`(helm-source-header ((t (:height (lambda (_x) (poet-theme--height 1))))))
`(ein:cell-input-area ((t (:background ,org-block-bg))))
`(ein:cell-input-prompt ((t (:foreground ,org-tag :background ,bg))))
`(ein:cell-output-prompt ((t (:foreground ,org-tag :background ,bg))))
`(ivy-org ((t (:inherit fixed-pitch)))))
(custom-theme-set-variables 'poet-dark
'(line-spacing .2)
`(fci-rule-color ,fci)))
;;;###autoload
(when (and (boundp 'custom-theme-load-path)
load-file-name)
(add-to-list 'custom-theme-load-path
(file-name-as-directory
(file-name-directory load-file-name))))
(provide-theme 'poet-dark)
(provide 'poet-dark-theme)
;;; poet-dark-theme.el ends here