|
| 1 | +;;; nano-appearance.el --- Theme and faces settings -*- lexical-binding: t; -*- |
| 2 | + |
| 3 | +;; GNU Emacs / N Λ N O - Emacs made simple |
| 4 | +;; Copyright (C) 2023-2024 - N Λ N O developers |
| 5 | + |
| 6 | +;; This program is free software; you can redistribute it and/or modify |
| 7 | +;; it under the terms of the GNU General Public License as published by |
| 8 | +;; the Free Software Foundation, either version 3 of the License, or |
| 9 | +;; (at your option) any later version. |
| 10 | + |
| 11 | +;; This program is distributed in the hope that it will be useful, |
| 12 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +;; GNU General Public License for more details. |
| 15 | + |
| 16 | +;; You should have received a copy of the GNU General Public License |
| 17 | +;; along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + |
| 19 | +;;; Commentary: |
| 20 | + |
| 21 | +;;; Code: |
| 22 | + |
| 23 | +;; Theme |
| 24 | +(require 'nord-theme) |
| 25 | +(nord-load-theme) |
| 26 | + |
| 27 | +(defface nano-critical `((t (:foreground ,nord13 :weight normal))) |
| 28 | + "Critical face is for information that requires immediate action. |
| 29 | +It should be of high contrast when compared to other faces. This |
| 30 | +can be realized (for example) by setting an intense background |
| 31 | +color, typically a shade of red. It must be used scarcely." |
| 32 | + :group nil) |
| 33 | + |
| 34 | +(defface nano-faded `((t (:foreground ,nord-comment))) |
| 35 | + "Faded face is for information that are less important. |
| 36 | +It is made by using the same hue as the default but with a lesser |
| 37 | +intensity than the default. It can be used for comments, |
| 38 | +secondary information and also replace italic (which is generally |
| 39 | +abused anyway)." |
| 40 | + :group 'nano) |
| 41 | + |
| 42 | +(defface nano-faded-i `((t (:foreground ,nord0 :background ,nord-comment))) |
| 43 | + "Faded face inversed." |
| 44 | + :group nil) |
| 45 | + |
| 46 | +(defface nano-popout `((t (:foreground ,nord12))) |
| 47 | + "Popout face is used for information that needs attention. |
| 48 | +To achieve such effect, the hue of the face has to be |
| 49 | +sufficiently different from other faces such that it attracts |
| 50 | +attention through the popout effect." |
| 51 | + :group 'nano) |
| 52 | + |
| 53 | +(defface nano-popout-i `((t (:foreground ,nord0 :background ,nord12))) |
| 54 | + "Popout face inversed." |
| 55 | + :group 'nano) |
| 56 | + |
| 57 | +(defface nano-salient `((t (:foreground ,nord9))) |
| 58 | + "Salient face is used for information that are important. |
| 59 | +To suggest the information is of the same nature but important, |
| 60 | +the face uses a different hue with approximately the same |
| 61 | +intensity as the default face. This is typically used for links." |
| 62 | + :group 'nano) |
| 63 | + |
| 64 | +(defface nano-subtle `((t (:foreground ,nord2))) |
| 65 | + "Subtle face is used to suggest a physical area on the screen. |
| 66 | +It is important to not disturb too strongly the reading of |
| 67 | +information and this can be made by setting a very light |
| 68 | +background color that is barely perceptible." |
| 69 | + :group nil) |
| 70 | + |
| 71 | +;; Apply fonts |
| 72 | +(custom-theme-set-faces 'nord |
| 73 | + `(default ((t (:foreground ,nord6 |
| 74 | + :weight ,(face-attribute 'nano-mono :weight) |
| 75 | + :height ,(face-attribute 'nano-mono :height) |
| 76 | + :family ,(face-attribute 'nano-mono :family))))) |
| 77 | + `(italic ((t (:foreground ,nord6 |
| 78 | + :weight ,(face-attribute 'nano-italic :weight) |
| 79 | + :height ,(face-attribute 'nano-italic :height) |
| 80 | + :slant ,(face-attribute 'nano-italic :slant) |
| 81 | + :family ,(face-attribute 'nano-italic :family)))))) |
| 82 | + |
| 83 | +;; Line spacing (in pixels) |
| 84 | +(setq line-spacing 1.2) |
| 85 | + |
| 86 | +;; Customize indent-bars mode |
| 87 | +(with-eval-after-load 'indent-bars |
| 88 | + ;; Enable TreeSitter support |
| 89 | + (setq indent-bars-treesit-support t) |
| 90 | + (setq indent-bars-treesit-ignore-blank-lines-types '("module")) |
| 91 | + |
| 92 | + ;; Make the indent-bars package decide when to use the stipple attribute |
| 93 | + ;; Stripple doesn't work on most macOS and Windows builds. |
| 94 | + (setq indent-bars-prefer-character |
| 95 | + (if (memq initial-window-system '(pgtk ns)) t)) |
| 96 | + |
| 97 | + (setq |
| 98 | + indent-bars-color '(nano-faded-i :face-bg t :blend 0.55) |
| 99 | + indent-bars-pattern "..." |
| 100 | + indent-bars-width-frac 0.1 |
| 101 | + indent-bars-pad-frac 0.1 |
| 102 | + indent-bars-zigzag nil |
| 103 | + indent-bars-color-by-depth nil |
| 104 | + indent-bars-highlight-current-depth nil |
| 105 | + indent-bars-display-on-blank-lines nil)) |
| 106 | + |
| 107 | +;; Customize hl-todo colors |
| 108 | +(with-eval-after-load 'hl-todo |
| 109 | + (setq hl-todo-highlight-punctuation ":" |
| 110 | + hl-todo-keyword-faces |
| 111 | + `(("TODO" . nano-popout) |
| 112 | + ("XXX" . nano-popout) |
| 113 | + ("CRUTCH" . nano-popout) |
| 114 | + ("FIXME" . nano-critical) |
| 115 | + ("NB" . nano-salient) |
| 116 | + ("NOTE" . nano-salient)))) |
| 117 | + |
| 118 | +(provide 'nano-appearance) |
| 119 | +;;; nano-appearance.el ends here |
0 commit comments