flake-update-20260505
1;;; tonski-modus-theme-ts-focus.el --- Semantic-focused theme without bolding -*- lexical-binding: t; no-byte-compile: t; -*-
2
3(deftheme tonski-modus-ts-focus "A highly accessible, semantic highlighting theme based on Modus/Tonski principles, optimized for Tree-sitter and without bolding.")
4
5(let* ((bg-main "#ffffff")
6 (fg-main "#000000")
7 (bg-subtle "#f8f8f8")
8 (bg-param "#eeeeee") ; Subtle background for arguments/parameters
9 (fg-dim "#555555") ; Comments/Fringe
10
11 ;; Modus-inspired high-contrast colors (no bolding)
12 (color-keyword "#880088") ; Magenta/Purple for Keywords/Control Flow (where desired)
13 (color-type "#000088") ; Dark Blue for Types/Classes
14 (color-function "#006800") ; Dark Green for Function Names
15 (color-constant "#804000") ; Dark Ochre/Brown for Constants/Macros
16 (color-string "#004080") ; Deep Blue for Strings
17 (color-warning "#a60000") ; Dark Red for Errors/Warnings
18 (color-builtin "#008888") ; Cyan/Teal for Builtins
19 )
20
21 (custom-theme-set-faces
22 'tonski-modus-ts-focus
23
24 ;; --- Basic/Core Faces ---
25 `(default ((t (:background ,bg-main :foreground ,fg-main :weight normal))))
26 `(cursor ((t (:background ,fg-main))))
27
28 ;; --- Base Font-Lock Faces (Used primarily as fallbacks/inheritance) ---
29
30 ;; Use standard colors, but remove bolding
31 `(font-lock-keyword-face ((t (:foreground ,color-keyword :weight normal))))
32 `(font-lock-type-face ((t (:foreground ,color-type :weight normal))))
33 `(font-lock-function-name-face ((t (:foreground ,color-function :weight normal))))
34 `(font-lock-constant-face ((t (:foreground ,color-constant :weight normal))))
35 `(font-lock-string-face ((t (:foreground ,color-string :weight normal))))
36 `(font-lock-comment-face ((t (:foreground ,fg-dim :italic t :weight normal))))
37
38 ;; Variables/Identifiers: Set to default FG
39 `(font-lock-variable-name-face ((t (:foreground ,fg-main :weight normal))))
40
41 ;; --- Tree-sitter Faces (Granular Semantic Highlighting Focus) ---
42 ;; We define specific TS faces to adhere to Tonski's principles precisely
43
44 ;; 1. Function and Method Names (Action/Behavior)
45 `(tree-sitter-hl-face:function ((t (:foreground ,color-function :weight normal))))
46 `(tree-sitter-hl-face:method ((t (:foreground ,color-function :weight normal))))
47
48 ;; 2. Types and Classes (Structure/Data)
49 `(tree-sitter-hl-face:type ((t (:foreground ,color-type :weight normal))))
50 `(tree-sitter-hl-face:type.definition ((t (:foreground ,color-type :weight normal))))
51
52 ;; 3. Constants and Macros (Stable/Immutable Data)
53 `(tree-sitter-hl-face:constant ((t (:foreground ,color-constant :weight normal))))
54 `(tree-sitter-hl-face:macro ((t (:foreground ,color-constant :weight normal))))
55
56 ;; 4. Keywords (Control Flow)
57 ;; Keeping keywords colored for now, but you can change this to `fg-main`
58 ;; if you want to de-emphasize all keywords like the previous refinement.
59 `(tree-sitter-hl-face:keyword ((t (:foreground ,color-keyword :weight normal))))
60
61 ;; 5. Variables/Identifiers (De-emphasized)
62 `(tree-sitter-hl-face:variable ((t (:foreground ,fg-main :weight normal))))
63
64 ;; 6. Parameters/Arguments (The key background distinction)
65 `(tree-sitter-hl-face:parameter ((t (:background ,bg-param :foreground ,fg-main :weight normal))))
66
67 ;; 7. Fields/Properties (Subtle visual cue)
68 `(tree-sitter-hl-face:field ((t (:foreground ,fg-main :italic t :weight normal))))
69
70 ;; 8. Strings
71 `(tree-sitter-hl-face:string ((t (:foreground ,color-string :weight normal))))
72
73 ;; 9. Errors/Warnings
74 `(tree-sitter-hl-face:error ((t (:foreground ,color-warning :weight normal))))
75
76 ;; --- Other common faces ---
77 `(warning ((t (:foreground ,color-warning :weight normal))))
78 `(error ((t (:foreground ,color-warning :weight normal))))
79 ))
80
81(provide 'tonski-modus-theme-ts-focus)