1 ;;; org-faces.el --- Face definitions for Org-mode.
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
5 ;; Author: Carsten Dominik <carsten at orgmode dot org>
6 ;; Keywords: outlines, hypermedia, calendar, wp
7 ;; Homepage: http://orgmode.org
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28 ;; This file contains the face definitons for Org.
35 (defgroup org-faces nil
38 :group
'org-font-lock
)
41 '((((background light
)) (:foreground
"white"))
42 (((background dark
)) (:foreground
"black")))
43 "Face used to hide leading stars in headlines.
44 The foreground color of this face should be equal to the background
48 (defface org-level-1
;; originally copied from font-lock-function-name-face
49 (org-compatible-face 'outline-1
50 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
51 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
52 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
53 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
54 (((class color
) (min-colors 8)) (:foreground
"blue" :bold t
))
56 "Face used for level 1 headlines."
59 (defface org-level-2
;; originally copied from font-lock-variable-name-face
60 (org-compatible-face 'outline-2
61 '((((class color
) (min-colors 16) (background light
)) (:foreground
"DarkGoldenrod"))
62 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightGoldenrod"))
63 (((class color
) (min-colors 8) (background light
)) (:foreground
"yellow"))
64 (((class color
) (min-colors 8) (background dark
)) (:foreground
"yellow" :bold t
))
66 "Face used for level 2 headlines."
69 (defface org-level-3
;; originally copied from font-lock-keyword-face
70 (org-compatible-face 'outline-3
71 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Purple"))
72 (((class color
) (min-colors 88) (background dark
)) (:foreground
"Cyan1"))
73 (((class color
) (min-colors 16) (background light
)) (:foreground
"Purple"))
74 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Cyan"))
75 (((class color
) (min-colors 8) (background light
)) (:foreground
"purple" :bold t
))
76 (((class color
) (min-colors 8) (background dark
)) (:foreground
"cyan" :bold t
))
78 "Face used for level 3 headlines."
81 (defface org-level-4
;; originally copied from font-lock-comment-face
82 (org-compatible-face 'outline-4
83 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
84 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
85 (((class color
) (min-colors 16) (background light
)) (:foreground
"red"))
86 (((class color
) (min-colors 16) (background dark
)) (:foreground
"red1"))
87 (((class color
) (min-colors 8) (background light
)) (:foreground
"red" :bold t
))
88 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
90 "Face used for level 4 headlines."
93 (defface org-level-5
;; originally copied from font-lock-type-face
94 (org-compatible-face 'outline-5
95 '((((class color
) (min-colors 16) (background light
)) (:foreground
"ForestGreen"))
96 (((class color
) (min-colors 16) (background dark
)) (:foreground
"PaleGreen"))
97 (((class color
) (min-colors 8)) (:foreground
"green"))))
98 "Face used for level 5 headlines."
101 (defface org-level-6
;; originally copied from font-lock-constant-face
102 (org-compatible-face 'outline-6
103 '((((class color
) (min-colors 16) (background light
)) (:foreground
"CadetBlue"))
104 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Aquamarine"))
105 (((class color
) (min-colors 8)) (:foreground
"magenta"))))
106 "Face used for level 6 headlines."
109 (defface org-level-7
;; originally copied from font-lock-builtin-face
110 (org-compatible-face 'outline-7
111 '((((class color
) (min-colors 16) (background light
)) (:foreground
"Orchid"))
112 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSteelBlue"))
113 (((class color
) (min-colors 8)) (:foreground
"blue"))))
114 "Face used for level 7 headlines."
117 (defface org-level-8
;; originally copied from font-lock-string-face
118 (org-compatible-face 'outline-8
119 '((((class color
) (min-colors 16) (background light
)) (:foreground
"RosyBrown"))
120 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSalmon"))
121 (((class color
) (min-colors 8)) (:foreground
"green"))))
122 "Face used for level 8 headlines."
125 (defface org-special-keyword
;; originally copied from font-lock-string-face
126 (org-compatible-face nil
127 '((((class color
) (min-colors 16) (background light
)) (:foreground
"RosyBrown"))
128 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSalmon"))
130 "Face used for special keywords."
133 (defface org-drawer
;; originally copied from font-lock-function-name-face
134 (org-compatible-face nil
135 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
136 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
137 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
138 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
139 (((class color
) (min-colors 8)) (:foreground
"blue" :bold t
))
141 "Face used for drawers."
144 (defface org-property-value nil
145 "Face used for the value of a property."
149 (org-compatible-face nil
150 '((((class color
) (min-colors 16) (background light
))
151 (:background
"grey90" :weight normal
:slant normal
:strike-through nil
153 (((class color
) (min-colors 16) (background dark
))
154 (:background
"grey30" :weight normal
:slant normal
:strike-through nil
156 (((class color
) (min-colors 8))
157 (:background
"cyan" :foreground
"black"
158 :weight normal
:slant normal
:strike-through nil
160 (t (:inverse-video t
))))
161 "Face for column display of entry properties.
162 This is actually only part of the face definition for the text in column view.
163 The following faces apply, with this priority.
165 1. The color of the reference face. This is normally the level fact that
166 is used in the outline. In agenda-mode, it will be the face of the
167 first character in the line. The color is explicitly retained to
168 make sure that the column line still looks a bit like the structure
171 2. The `org-column' face.
173 3. The remaining properties of the reference face.
175 Since column view works by putting overlays with a display property
176 over individual characters in the buffer, the face of the underlining
177 character (this might for example be the a TODO keyword) might still
178 shine through in some properties. So when your column view looks
179 funny, with \"random\" colors, weight, strike-through, try to explicitly
180 set the properties in the `org-column' face. For example, set
181 :underline to nil, or the :slant to `normal'.
183 Under XEmacs, the rules are simpler, because the XEmacs version of
184 column view defines special faces for each outline level. See the file
185 `org-colview-xemacs.el' for details."
188 (defface org-column-title
189 (org-compatible-face nil
190 '((((class color
) (min-colors 16) (background light
))
191 (:background
"grey90" :underline t
:weight bold
))
192 (((class color
) (min-colors 16) (background dark
))
193 (:background
"grey30" :underline t
:weight bold
))
194 (((class color
) (min-colors 8))
195 (:background
"cyan" :foreground
"black" :underline t
:weight bold
))
196 (t (:inverse-video t
))))
197 "Face for column display of entry properties."
200 (when (fboundp 'set-face-attribute
)
201 ;; Make sure that a fixed-width face is used when we have a column table.
202 (set-face-attribute 'org-column nil
203 :height
(face-attribute 'default
:height
)
204 :family
(face-attribute 'default
:family
)))
207 (org-compatible-face 'font-lock-warning-face
208 '((((class color
) (min-colors 16) (background light
)) (:foreground
"Red1" :bold t
))
209 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Pink" :bold t
))
210 (((class color
) (min-colors 8) (background light
)) (:foreground
"red" :bold t
))
211 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
213 "Face for deadlines and TODO keywords."
216 (defface org-archived
; similar to shadow
217 (org-compatible-face 'shadow
218 '((((class color grayscale
) (min-colors 88) (background light
))
219 (:foreground
"grey50"))
220 (((class color grayscale
) (min-colors 88) (background dark
))
221 (:foreground
"grey70"))
222 (((class color
) (min-colors 8) (background light
))
223 (:foreground
"green"))
224 (((class color
) (min-colors 8) (background dark
))
225 (:foreground
"yellow"))))
226 "Face for headline with the ARCHIVE tag."
230 '((((class color
) (background light
)) (:foreground
"Purple" :underline t
))
231 (((class color
) (background dark
)) (:foreground
"Cyan" :underline t
))
236 (defface org-ellipsis
237 '((((class color
) (background light
)) (:foreground
"DarkGoldenrod" :underline t
))
238 (((class color
) (background dark
)) (:foreground
"LightGoldenrod" :underline t
))
239 (t (:strike-through t
)))
240 "Face for the ellipsis in folded text."
244 '((((class color
) (background light
)) (:underline t
))
245 (((class color
) (background dark
)) (:underline t
))
251 '((((class color
) (background light
)) (:foreground
"Purple" :underline t
))
252 (((class color
) (background dark
)) (:foreground
"Cyan" :underline t
))
257 (defface org-sexp-date
258 '((((class color
) (background light
)) (:foreground
"Purple"))
259 (((class color
) (background dark
)) (:foreground
"Cyan"))
269 (defface org-todo
; font-lock-warning-face
270 (org-compatible-face nil
271 '((((class color
) (min-colors 16) (background light
)) (:foreground
"Red1" :bold t
))
272 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Pink" :bold t
))
273 (((class color
) (min-colors 8) (background light
)) (:foreground
"red" :bold t
))
274 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
275 (t (:inverse-video t
:bold t
))))
276 "Face for TODO keywords."
279 (defface org-done
;; originally copied from font-lock-type-face
280 (org-compatible-face nil
281 '((((class color
) (min-colors 16) (background light
)) (:foreground
"ForestGreen" :bold t
))
282 (((class color
) (min-colors 16) (background dark
)) (:foreground
"PaleGreen" :bold t
))
283 (((class color
) (min-colors 8)) (:foreground
"green"))
285 "Face used for todo keywords that indicate DONE items."
288 (defface org-headline-done
;; originally copied from font-lock-string-face
289 (org-compatible-face nil
290 '((((class color
) (min-colors 16) (background light
)) (:foreground
"RosyBrown"))
291 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSalmon"))
292 (((class color
) (min-colors 8) (background light
)) (:bold nil
))))
293 "Face used to indicate that a headline is DONE.
294 This face is only used if `org-fontify-done-headline' is set. If applies
295 to the part of the headline after the DONE keyword."
298 (defcustom org-todo-keyword-faces nil
299 "Faces for specific TODO keywords.
300 This is a list of cons cells, with TODO keywords in the car
301 and faces in the cdr. The face can be a symbol, or a property
302 list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
307 (string :tag
"keyword")
308 (sexp :tag
"face"))))
310 (defface org-table
;; originally copied from font-lock-function-name-face
311 (org-compatible-face nil
312 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
313 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
314 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
315 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
316 (((class color
) (min-colors 8) (background light
)) (:foreground
"blue"))
317 (((class color
) (min-colors 8) (background dark
)))))
318 "Face used for tables."
322 (org-compatible-face nil
323 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
324 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
325 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
326 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red"))
327 (t (:bold t
:italic t
))))
332 (org-compatible-face nil
333 '((((class color grayscale
) (min-colors 88) (background light
))
334 (:foreground
"grey50"))
335 (((class color grayscale
) (min-colors 88) (background dark
))
336 (:foreground
"grey70"))
337 (((class color
) (min-colors 8) (background light
))
338 (:foreground
"green"))
339 (((class color
) (min-colors 8) (background dark
))
340 (:foreground
"yellow"))))
341 "Face for fixed-with text like code snippets."
345 (defface org-verbatim
346 (org-compatible-face nil
347 '((((class color grayscale
) (min-colors 88) (background light
))
348 (:foreground
"grey50" :underline t
))
349 (((class color grayscale
) (min-colors 88) (background dark
))
350 (:foreground
"grey70" :underline t
))
351 (((class color
) (min-colors 8) (background light
))
352 (:foreground
"green" :underline t
))
353 (((class color
) (min-colors 8) (background dark
))
354 (:foreground
"yellow" :underline t
))))
355 "Face for fixed-with text like code snippets."
359 (defface org-agenda-structure
;; originally copied from font-lock-function-name-face
360 (org-compatible-face nil
361 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
362 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
363 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
364 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
365 (((class color
) (min-colors 8)) (:foreground
"blue" :bold t
))
367 "Face used in agenda for captions and dates."
370 (unless (facep 'org-agenda-date
)
371 (copy-face 'org-agenda-structure
'org-agenda-date
)
372 (set-face-doc-string 'org-agenda-date
373 "Face used in agenda for normal days."))
375 (unless (facep 'org-agenda-date-weekend
)
376 (copy-face 'org-agenda-date
'org-agenda-date-weekend
)
377 (set-face-doc-string 'org-agenda-date-weekend
378 "Face used in agenda for weekend days.
379 See the variable `org-agenda-weekend-days' for a definition of which days
380 belong to the weekend.")
381 (when (fboundp 'set-face-attribute
)
382 (set-face-attribute 'org-agenda-date-weekend nil
:weight
'bold
)))
384 (defface org-scheduled
385 (org-compatible-face nil
386 '((((class color
) (min-colors 88) (background light
)) (:foreground
"DarkGreen"))
387 (((class color
) (min-colors 88) (background dark
)) (:foreground
"PaleGreen"))
388 (((class color
) (min-colors 8)) (:foreground
"green"))
389 (t (:bold t
:italic t
))))
390 "Face for items scheduled for a certain day."
393 (defface org-scheduled-today
394 (org-compatible-face nil
395 '((((class color
) (min-colors 88) (background light
)) (:foreground
"DarkGreen"))
396 (((class color
) (min-colors 88) (background dark
)) (:foreground
"PaleGreen"))
397 (((class color
) (min-colors 8)) (:foreground
"green"))
398 (t (:bold t
:italic t
))))
399 "Face for items scheduled for a certain day."
403 (defface org-scheduled-previously
404 (org-compatible-face nil
405 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
406 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
407 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
408 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
410 "Face for items scheduled previously, and not yet done."
413 (defface org-upcoming-deadline
414 (org-compatible-face nil
415 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
416 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
417 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
418 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
420 "Face for items scheduled previously, and not yet done."
423 (defcustom org-agenda-deadline-faces
424 '((1.0 . org-warning
)
425 (0.5 . org-upcoming-deadline
)
427 "Faces for showing deadlines in the agenda.
428 This is a list of cons cells. The cdr of each cell is a face to be used,
429 and it can also just be like '(:foreground \"yellow\").
430 Each car is a fraction of the head-warning time that must have passed for
431 this the face in the cdr to be used for display. The numbers must be
432 given in descending order. The head-warning time is normally taken
433 from `org-deadline-warning-days', but can also be specified in the deadline
434 timestamp itself, like this:
436 DEADLINE: <2007-08-13 Mon -8d>
438 You may use d for days, w for weeks, m for months and y for years. Months
439 and years will only be treated in an approximate fashion (30.4 days for a
440 month and 365.24 days for a year)."
442 :group
'org-agenda-daily
/weekly
445 (number :tag
"Fraction of head-warning time passed")
446 (sexp :tag
"Face"))))
448 (defface org-agenda-restriction-lock
449 (org-compatible-face nil
450 '((((class color
) (min-colors 88) (background light
)) (:background
"yellow1"))
451 (((class color
) (min-colors 88) (background dark
)) (:background
"skyblue4"))
452 (((class color
) (min-colors 16) (background light
)) (:background
"yellow1"))
453 (((class color
) (min-colors 16) (background dark
)) (:background
"skyblue4"))
454 (((class color
) (min-colors 8)) (:background
"cyan" :foreground
"black"))
455 (t (:inverse-video t
))))
456 "Face for showing the agenda restriction lock."
459 (defface org-time-grid
;; originally copied from font-lock-variable-name-face
460 (org-compatible-face nil
461 '((((class color
) (min-colors 16) (background light
)) (:foreground
"DarkGoldenrod"))
462 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightGoldenrod"))
463 (((class color
) (min-colors 8)) (:foreground
"yellow" :weight light
))))
464 "Face used for time grids."
467 (defconst org-level-faces
468 '(org-level-1 org-level-2 org-level-3 org-level-4
469 org-level-5 org-level-6 org-level-7 org-level-8
472 (defcustom org-n-level-faces
(length org-level-faces
)
473 "The number of different faces to be used for headlines.
474 Org-mode defines 8 different headline faces, so this can be at most 8.
475 If it is less than 8, the level-1 face gets re-used for level N+1 etc."
479 (defface org-latex-and-export-specials
480 (let ((font (cond ((assq :inherit custom-face-attributes
)
481 '(:inherit underline
))
482 (t '(:underline t
)))))
483 `((((class grayscale
) (background light
))
484 (:foreground
"DimGray" ,@font
))
485 (((class grayscale
) (background dark
))
486 (:foreground
"LightGray" ,@font
))
487 (((class color
) (background light
))
488 (:foreground
"SaddleBrown"))
489 (((class color
) (background dark
))
490 (:foreground
"burlywood"))
492 "Face used to highlight math latex and other special exporter stuff."
497 ;; arch-tag: 9dab5f91-c4b9-4d6f-bac3-1f6211ad0a04
499 ;;; org-faces.el ends here