Skip to content

Commit c5280ce

Browse files
committed
Use child theme to customize faces
1 parent dbdee79 commit c5280ce

File tree

7 files changed

+69
-153
lines changed

7 files changed

+69
-153
lines changed

init.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
(setq my/slow-device t))
4747

4848
(eval-and-compile
49-
(add-to-list 'load-path (locate-user-emacs-file "modules/")))
49+
(add-to-list 'load-path (locate-user-emacs-file "modules/"))
50+
(add-to-list 'custom-theme-load-path (locate-user-emacs-file "themes/")))
5051

5152
;; suppress the GNU spam
5253
(fset 'display-startup-echo-area-message #'ignore)
@@ -127,5 +128,5 @@
127128
(message "[============== ] modes")
128129
(my/require-config-module 'config-modes)
129130
(message "[===============] solarized")
130-
(my/require-config-module 'config-solarized)
131+
(load-theme 'quark-solarized-dark t)
131132
(message "[===============] done"))

modules/config-avy-easymotion.el

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,6 @@
3131
avy-timeout-seconds 0.3
3232
avy-keys (eval-when-compile (string-to-list "jfkdlsaurieowncpqmxzb")))
3333

34-
(defun my/avy-setup-faces ()
35-
(set-face-foreground 'avy-background-face "#586e75")
36-
37-
(set-face-attribute 'avy-lead-face nil
38-
:weight 'normal
39-
:background nil
40-
:foreground "#b58900"
41-
:inherit nil)
42-
(set-face-attribute 'avy-lead-face-0 nil
43-
:weight 'extra-bold
44-
:background nil
45-
:foreground "#dc322f"
46-
:inherit nil)
47-
(set-face-attribute 'avy-lead-face-1 nil
48-
:background nil
49-
:foreground "#839493"
50-
:inherit nil))
51-
52-
(my/avy-setup-faces)
53-
(add-hook 'load-theme-hook #'my/avy-setup-faces)
54-
5534
(use-package evil
5635
;; Note: evil is ensured in config-evil
5736
:ensure nil

modules/config-company.el

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
:hook 'first-change-hook
1313
:after-hook 'emacs-startup-hook
1414
:condition (get-buffer-window)
15-
(global-company-mode +1)
16-
(run-hooks 'load-theme-hook))
15+
(global-company-mode +1))
1716

1817
(eval-and-compile
1918
(cl-macrolet
@@ -109,47 +108,8 @@
109108
(company-select-next-or-abort arg)))
110109

111110
(define-key company-active-map (kbd "<up>") #'company-select-above)
112-
(define-key company-active-map (kbd "<down>") #'company-select-below)
113-
114-
(add-hook
115-
'load-theme-hook
116-
(my/defun-as-value my/company-setup-tooltip-faces ()
117-
(set-face-attribute 'company-tooltip-common-selection nil
118-
:background "#839496"
119-
:foreground (if (< (display-color-cells) 256)
120-
"black"
121-
nil)
122-
:underline nil
123-
:inherit 'region)
124-
125-
(set-face-attribute 'company-tooltip-selection nil
126-
:background "#586e75"
127-
:foreground nil
128-
:inherit 'region)
129-
130-
(set-face-attribute 'company-tooltip-common nil
131-
:background nil
132-
:underline nil
133-
:inherit 'company-tooltip
134-
:foreground "#586e75")
135-
136-
(set-face-attribute 'company-tooltip-annotation nil
137-
:foreground nil
138-
:background nil
139-
:inherit 'company-tooltip)
140-
141-
(set-face-attribute 'company-tooltip nil
142-
:foreground nil
143-
:inherit 'default))))
144-
145-
(with-eval-after-load 'company-template
146-
(add-hook
147-
'load-theme-hook
148-
(my/defun-as-value my/company-setup-template-faces ()
149-
(set-face-attribute 'company-template-field nil
150-
:foreground nil
151-
:background nil
152-
:inherit 'region))))
111+
(define-key company-active-map (kbd "<down>") #'company-select-below))
112+
153113

154114
(with-eval-after-load 'company-dabbrev-code
155115
(eval-when-compile

modules/config-ivy.el

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,29 +169,20 @@ Minibuffer bindings:
169169
(require 'historian)
170170
(require 'ivy)))
171171

172-
(ivy-historian-mode +1)
173-
174-
(defun my/ivy-setup-faces ()
175-
(set-face-attribute 'ivy-minibuffer-match-face-1 nil
176-
:background nil)
177-
(set-face-attribute 'ivy-minibuffer-match-face-2 nil
178-
:background nil
179-
:foreground "#268bd2")
180-
181-
(setq ivy-minibuffer-faces (list 'ivy-minibuffer-match-face-1
182-
'ivy-minibuffer-match-face-2)))
172+
(setq ivy-minibuffer-faces
173+
(list 'ivy-minibuffer-match-face-1
174+
'ivy-minibuffer-match-face-2))
183175

176+
(ivy-historian-mode +1)
184177
(diminish 'ivy-mode)
185178

186179
(setq ivy-display-style 'fancy
187180
ivy-re-builders-alist '((t . ivy--regex-fuzzy))
188181
ivy-extra-directories nil
189182
ivy-count-format ""
190183
ivy-flx-limit 2000
191-
ivy-use-selectable-prompt t)
184+
ivy-use-selectable-prompt t))
192185

193-
(my/ivy-setup-faces)
194-
(add-hook 'load-theme-hook #'my/ivy-setup-faces))
195186

196187
(use-package counsel
197188
:init

modules/config-solarized.el

Lines changed: 0 additions & 59 deletions
This file was deleted.

modules/config-ui.el

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
frame-inhibit-implied-resize t
2121
inhibit-compacting-font-caches t)
2222

23+
(define-advice list-faces-display
24+
(:after (&rest _args) turn-off-hl-line-mode)
25+
(with-current-buffer (get-buffer "*Faces*")
26+
(setq-local global-hl-line-mode nil
27+
hl-line-mode nil)))
28+
29+
(let ((display-table (or standard-display-table (make-display-table))))
30+
(set-display-table-slot display-table 'vertical-border (make-glyph-code ?│))
31+
(setq standard-display-table display-table))
32+
2333
(defun isearch-exit-chord-worker ()
2434
"Exit out of isearch after a chord"
2535
(interactive)
@@ -238,20 +248,6 @@ DIR should be 1 or -1 and COUNT should be a positive integer or nil."
238248
(defvar-local my/rainbow-delimiters-face-cookies nil
239249
"a list of face-remap-add-relative cookies to reset")
240250

241-
(defun my/rainbow-delimiters-setup-faces ()
242-
(set-face-foreground 'rainbow-delimiters-depth-1-face "#889899")
243-
(set-face-foreground 'rainbow-delimiters-depth-2-face "#9b7b6b")
244-
(set-face-foreground 'rainbow-delimiters-depth-3-face "#7b88a5")
245-
(set-face-foreground 'rainbow-delimiters-depth-4-face "#889899")
246-
(set-face-foreground 'rainbow-delimiters-depth-5-face "#839564")
247-
(set-face-foreground 'rainbow-delimiters-depth-6-face "#6391aa")
248-
(set-face-foreground 'rainbow-delimiters-depth-7-face "#9d748f")
249-
(set-face-foreground 'rainbow-delimiters-depth-8-face "#7b88a5")
250-
(set-face-foreground 'rainbow-delimiters-depth-9-face "#659896"))
251-
252-
(my/rainbow-delimiters-setup-faces)
253-
(add-hook 'load-theme-hook #'my/rainbow-delimiters-setup-faces)
254-
255251
(defun my/rainbow-delimiters-focus-on ()
256252
"Punch the rainbow-delimiters"
257253
(setq my/rainbow-delimiters-face-cookies

themes/quark-solarized-dark-theme.el

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
(eval-and-compile
2+
(use-package solarized-theme)
3+
(require 'solarized))
4+
(eval-when-compile
5+
(require 'solarized-palettes))
6+
7+
(setq quark/solarized-faces
8+
'("My personal solarized theme customization."
9+
(custom-theme-set-faces
10+
theme-name
11+
`(mode-line
12+
((,class (:inverse-video unspecified
13+
:foreground ,s-mode-line-fg
14+
:background ,s-mode-line-bg))))
15+
`(mode-line-inactive
16+
((,class (:inverse-video unspecified
17+
:underline ,s-mode-line-underline
18+
:foreground ,s-mode-line-inactive-fg
19+
:background ,base02))))
20+
`(mode-line-buffer-id ((,class (:weight bold))))
21+
`(fringe ((,class (:foreground ,s-fringe-fg :background "#022F3A"))))
22+
`(vertical-border ((,class (:background nil :foreground ,base02))))
23+
`(diff-hl-change ((,class (:background ,s-diff-fine-C-bg :foreground ,s-diff-C-fg))))
24+
`(diff-hl-delete ((,class (:background ,s-diff-fine-A-bg :foreground ,s-diff-A-fg))))
25+
`(diff-hl-insert ((,class (:background ,s-diff-fine-B-bg :foreground ,s-diff-B-fg))))
26+
`(avy-background-face ((,class (:foreground ,base01))))
27+
`(avy-lead-face ((,class (:foreground ,yellow :background nil))))
28+
`(avy-lead-face-0 ((,class (:weight extra-bold :foreground ,red :background nil))))
29+
`(avy-lead-face-1 ((,class (:foreground ,base0 :background nil))))
30+
`(ivy-minibuffer-match-face-1 ((,class (:background nil))))
31+
`(ivy-minibuffer-match-face-2 ((,class (:background nil :foreground ,blue))))
32+
`(rainbow-delimiters-depth-1-face ((,class (:foreground "#889899"))))
33+
`(rainbow-delimiters-depth-2-face ((,class (:foreground "#9b7b6b"))))
34+
`(rainbow-delimiters-depth-3-face ((,class (:foreground "#7b88a5"))))
35+
`(rainbow-delimiters-depth-4-face ((,class (:foreground "#889899"))))
36+
`(rainbow-delimiters-depth-5-face ((,class (:foreground "#839564"))))
37+
`(rainbow-delimiters-depth-6-face ((,class (:foreground "#6391aa"))))
38+
`(rainbow-delimiters-depth-7-face ((,class (:foreground "#9d748f"))))
39+
`(rainbow-delimiters-depth-8-face ((,class (:foreground "#7b88a5"))))
40+
`(rainbow-delimiters-depth-9-face ((,class (:foreground "#659896"))))
41+
)))
42+
43+
(deftheme quark-solarized-dark "The dark variant of the Solarized colour theme")
44+
45+
(solarized-with-color-variables
46+
'dark 'quark-solarized-dark solarized-dark-color-palette-alist quark/solarized-faces)
47+
48+
(provide-theme 'quark-solarized-dark)

0 commit comments

Comments
 (0)