1 ;;; org-faces.el --- Face definitions -*- lexical-binding: t; -*-
3 ;; Copyright (C) 2004-2016 Free Software Foundation, Inc.
5 ;; Author: Carsten Dominik <carsten at orgmode dot org>
6 ;; Keywords: outlines, hypermedia, calendar, wp
7 ;; Homepage: http://orgmode.org
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27 ;; This file contains the face definitions for Org.
31 (defgroup org-faces nil
34 :group
'org-appearance
)
36 (defface org-default
'((t :inherit default
))
37 "Face used for default text."
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
'((t :inherit outline-1
))
49 "Face used for level 1 headlines."
52 (defface org-level-2
'((t :inherit outline-2
))
53 "Face used for level 2 headlines."
56 (defface org-level-3
'((t :inherit outline-3
))
57 "Face used for level 3 headlines."
60 (defface org-level-4
'((t :inherit outline-4
))
61 "Face used for level 4 headlines."
64 (defface org-level-5
'((t :inherit outline-5
))
65 "Face used for level 5 headlines."
68 (defface org-level-6
'((t :inherit outline-6
))
69 "Face used for level 6 headlines."
72 (defface org-level-7
'((t :inherit outline-7
))
73 "Face used for level 7 headlines."
76 (defface org-level-8
'((t :inherit outline-8
))
77 "Face used for level 8 headlines."
80 (defface org-special-keyword
'((t :inherit font-lock-keyword-face
))
81 "Face used for special keywords."
84 (defface org-drawer
;Copied from `font-lock-function-name-face'
85 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
86 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
87 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
88 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
89 (((class color
) (min-colors 8)) (:foreground
"blue" :bold t
))
91 "Face used for drawers."
94 (defface org-property-value nil
95 "Face used for the value of a property."
99 '((((class color
) (min-colors 16) (background light
))
100 (:background
"grey90" :weight normal
:slant normal
:strike-through nil
102 (((class color
) (min-colors 16) (background dark
))
103 (:background
"grey30" :weight normal
:slant normal
:strike-through nil
105 (((class color
) (min-colors 8))
106 (:background
"cyan" :foreground
"black"
107 :weight normal
:slant normal
:strike-through nil
109 (t (:inverse-video t
)))
110 "Face for column display of entry properties.
111 This is actually only part of the face definition for the text in column view.
112 The following faces apply, with this priority.
114 1. The color of the reference face. This is normally the level fact that
115 is used in the outline. In agenda-mode, it will be the face of the
116 first character in the line. The color is explicitly retained to
117 make sure that the column line still looks a bit like the structure
120 2. The `org-column' face.
122 3. The remaining properties of the reference face.
124 Since column view works by putting overlays with a display property
125 over individual characters in the buffer, the face of the underlining
126 character (this might for example be the a TODO keyword) might still
127 shine through in some properties. So when your column view looks
128 funny, with \"random\" colors, weight, strike-through, try to explicitly
129 set the properties in the `org-column' face. For example, set
130 :underline to nil, or the :slant to `normal'."
133 (defface org-column-title
134 '((((class color
) (min-colors 16) (background light
))
135 (:background
"grey90" :underline t
:weight bold
))
136 (((class color
) (min-colors 16) (background dark
))
137 (:background
"grey30" :underline t
:weight bold
))
138 (((class color
) (min-colors 8))
139 (:background
"cyan" :foreground
"black" :underline t
:weight bold
))
140 (t (:inverse-video t
)))
141 "Face for column display of entry properties."
144 (defface org-agenda-column-dateline
'((t :inherit org-column
))
145 "Face used in agenda column view for datelines with summaries."
148 (defface org-warning
'((t :inherit font-lock-warning-face
))
149 "Face for deadlines and TODO keywords."
152 (defface org-archived
'((t :inherit shadow
))
153 "Face for headline with the ARCHIVE tag."
156 (defface org-link
'((t :inherit link
))
160 (defface org-footnote
161 '((((class color
) (background light
)) (:foreground
"Purple" :underline t
))
162 (((class color
) (background dark
)) (:foreground
"Cyan" :underline t
))
164 "Face for footnotes."
167 (defface org-ellipsis
168 '((((class color
) (background light
)) (:foreground
"DarkGoldenrod" :underline t
))
169 (((class color
) (background dark
)) (:foreground
"LightGoldenrod" :underline t
))
170 (t (:strike-through t
)))
171 "Face for the ellipsis in folded text."
175 '((((class color
) (background light
)) (:underline t
))
176 (((class color
) (background dark
)) (:underline t
))
178 "Face for link targets."
182 '((((class color
) (background light
)) (:foreground
"Purple" :underline t
))
183 (((class color
) (background dark
)) (:foreground
"Cyan" :underline t
))
185 "Face for date/time stamps."
188 (defface org-date-selected
189 '((((class color
) (min-colors 16) (background light
)) (:foreground
"Red1" :inverse-video t
))
190 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Pink" :inverse-video t
))
191 (((class color
) (min-colors 8) (background light
)) (:foreground
"red" :inverse-video t
))
192 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :inverse-video t
))
193 (t (:inverse-video t
)))
194 "Face for highlighting the calendar day when using `org-read-date'.
195 Using a bold face here might cause discrepancies while displaying the
199 (defface org-sexp-date
200 '((((class color
) (background light
)) (:foreground
"Purple"))
201 (((class color
) (background dark
)) (:foreground
"Cyan"))
203 "Face for diary-like sexp date specifications."
206 (defface org-tag
'((t (:bold t
)))
207 "Default face for tags.
208 Note that the variable `org-tag-faces' can be used to overrule this face for
212 (defface org-list-dt
'((t (:bold t
)))
213 "Default face for definition terms in lists."
216 (defface org-todo
;Copied from `font-lock-warning-face'
217 '((((class color
) (min-colors 16) (background light
)) (:foreground
"Red1" :bold t
))
218 (((class color
) (min-colors 16) (background dark
)) (:foreground
"Pink" :bold t
))
219 (((class color
) (min-colors 8) (background light
)) (:foreground
"red" :bold t
))
220 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
221 (t (:inverse-video t
:bold t
)))
222 "Face for TODO keywords."
225 (defface org-done
;Copied from `font-lock-type-face'
226 '((((class color
) (min-colors 16) (background light
)) (:foreground
"ForestGreen" :bold t
))
227 (((class color
) (min-colors 16) (background dark
)) (:foreground
"PaleGreen" :bold t
))
228 (((class color
) (min-colors 8)) (:foreground
"green"))
230 "Face used for todo keywords that indicate DONE items."
233 (defface org-agenda-done
;Copied from `font-lock-type-face'
234 '((((class color
) (min-colors 16) (background light
)) (:foreground
"ForestGreen"))
235 (((class color
) (min-colors 16) (background dark
)) (:foreground
"PaleGreen"))
236 (((class color
) (min-colors 8)) (:foreground
"green"))
238 "Face used in agenda, to indicate lines switched to DONE.
239 This face is used to de-emphasize items that where brightly colored in the
240 agenda because they were things to do, or overdue. The DONE state itself
241 is of course immediately visible, but for example a passed deadline is
242 \(by default) very bright read. This face could be simply the default face
243 of the frame, for example."
246 (defface org-headline-done
;Copied from `font-lock-string-face'
247 '((((class color
) (min-colors 16) (background light
)) (:foreground
"RosyBrown"))
248 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSalmon"))
249 (((class color
) (min-colors 8) (background light
)) (:bold nil
)))
250 "Face used to indicate that a headline is DONE.
251 This face is only used if `org-fontify-done-headline' is set. If applies
252 to the part of the headline after the DONE keyword."
255 (defcustom org-faces-easy-properties
256 '((todo .
:foreground
) (tag .
:foreground
) (priority .
:foreground
))
257 "The property changes by easy faces.
258 This is an alist, the keys show the area of application, the values
259 can be `:foreground' or `:background'. A color string for special
260 keywords will then be interpreted as either foreground or background
266 (cons (choice (const todo
) (const tag
) (const priority
))
267 (choice (const :foreground
) (const :background
)))))
269 (defcustom org-todo-keyword-faces nil
270 "Faces for specific TODO keywords.
271 This is a list of cons cells, with TODO keywords in the car
272 and faces in the cdr. The face can be a symbol, a color
273 as a string (in which case the rest is inherited from the `org-todo' face),
274 or a property list of attributes, like
275 (:foreground \"blue\" :weight bold :underline t).
276 If it is a color string, the variable `org-faces-easy-properties'
277 determines if it is a foreground or a background color."
282 (string :tag
"Keyword")
284 (string :tag
"Color")
285 (sexp :tag
"Face")))))
287 (defface org-priority
'((t :inherit font-lock-keyword-face
))
288 "Face used for priority cookies."
291 (defcustom org-priority-faces nil
292 "Faces for specific Priorities.
293 This is a list of cons cells, with priority character in the car
294 and faces in the cdr. The face can be a symbol, a color as
295 as a string, or a property list of attributes, like
296 (:foreground \"blue\" :weight bold :underline t).
297 If it is a color string, the variable `org-faces-easy-properties'
298 determines if it is a foreground or a background color."
303 (character :tag
"Priority")
305 (string :tag
"Color")
306 (sexp :tag
"Face")))))
308 (defvar org-tags-special-faces-re nil
)
309 (defun org-set-tag-faces (var value
)
312 (setq org-tags-special-faces-re nil
)
313 (setq org-tags-special-faces-re
314 (concat ":\\(" (mapconcat 'car value
"\\|") "\\):"))))
316 (defface org-checkbox
'((t :inherit bold
))
317 "Face for checkboxes."
320 (defface org-checkbox-statistics-todo
'((t (:inherit org-todo
)))
321 "Face used for unfinished checkbox statistics."
324 (defface org-checkbox-statistics-done
'((t (:inherit org-done
)))
325 "Face used for finished checkbox statistics."
328 (defcustom org-tag-faces nil
329 "Faces for specific tags.
330 This is a list of cons cells, with tags in the car and faces in the cdr.
331 The face can be a symbol, a foreground color (in which case the rest is
332 inherited from the `org-tag' face) or a property list of attributes,
333 like (:foreground \"blue\" :weight bold :underline t).
334 If you set this variable through customize, it will immediately be effective
335 in new buffers and in modified lines.
336 If you set it with Lisp, a restart of Emacs is required to activate the
340 :set
'org-set-tag-faces
345 (string :tag
"Foreground color")
346 (sexp :tag
"Face")))))
348 (defface org-table
;Copied from `font-lock-function-name-face'
349 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
350 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
351 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
352 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
353 (((class color
) (min-colors 8) (background light
)) (:foreground
"blue"))
354 (((class color
) (min-colors 8) (background dark
))))
355 "Face used for tables."
359 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
360 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
361 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
362 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red"))
363 (t (:bold t
:italic t
)))
367 (defface org-code
'((t :inherit shadow
))
368 "Face for fixed-width text like code snippets."
372 (defface org-meta-line
'((t :inherit font-lock-comment-face
))
373 "Face for meta lines starting with \"#+\"."
377 (defface org-document-title
378 '((((class color
) (background light
)) (:foreground
"midnight blue" :weight bold
))
379 (((class color
) (background dark
)) (:foreground
"pale turquoise" :weight bold
))
381 "Face for document title, i.e. that which follows the #+TITLE: keyword."
384 (defface org-document-info
385 '((((class color
) (background light
)) (:foreground
"midnight blue"))
386 (((class color
) (background dark
)) (:foreground
"pale turquoise"))
388 "Face for document date, author and email; i.e. that which
389 follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword."
392 (defface org-document-info-keyword
'((t :inherit shadow
))
393 "Face for #+TITLE:, #+AUTHOR:, #+EMAIL: and #+DATE: keywords."
396 (defface org-block
'((t :inherit shadow
))
397 "Face text in #+begin ... #+end blocks.
398 In addition to this face that take precedence for particular
399 languages. For instance, to change the block face for Emacs-Lisp
400 blocks define a `org-block-emacs-lisp' face."
404 (defface org-block-begin-line
'((t (:inherit org-meta-line
)))
405 "Face used for the line delimiting the begin of source blocks."
408 (defface org-block-end-line
'((t (:inherit org-block-begin-line
)))
409 "Face used for the line delimiting the end of source blocks."
412 (defface org-verbatim
'((t (:inherit shadow
)))
413 "Face for fixed-with text like code snippets"
417 (defface org-quote
'((t (:inherit org-block
)))
418 "Face for #+BEGIN_QUOTE ... #+END_QUOTE blocks."
421 (defface org-verse
'((t (:inherit org-block
)))
422 "Face for #+BEGIN_VERSE ... #+END_VERSE blocks."
425 (defcustom org-fontify-quote-and-verse-blocks nil
426 "Non-nil means, add a special face to #+begin_quote and #+begin_verse block.
427 When nil, format these as normal Org. This is the default, because the
428 content of these blocks will still be treated as Org syntax."
433 (defface org-clock-overlay
;Copied from `secondary-selection'
434 '((((class color
) (min-colors 88) (background light
))
435 (:background
"LightGray" :foreground
"black"))
436 (((class color
) (min-colors 88) (background dark
))
437 (:background
"SkyBlue4" :foreground
"white"))
438 (((class color
) (min-colors 16) (background light
))
439 (:background
"gray" :foreground
"black"))
440 (((class color
) (min-colors 16) (background dark
))
441 (:background
"SkyBlue4" :foreground
"white"))
442 (((class color
) (min-colors 8))
443 (:background
"cyan" :foreground
"black"))
444 (t (:inverse-video t
)))
445 "Basic face for displaying the secondary selection."
448 (defface org-agenda-structure
;Copied from `font-lock-function-name-face'
449 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Blue1"))
450 (((class color
) (min-colors 88) (background dark
)) (:foreground
"LightSkyBlue"))
451 (((class color
) (min-colors 16) (background light
)) (:foreground
"Blue"))
452 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightSkyBlue"))
453 (((class color
) (min-colors 8)) (:foreground
"blue" :bold t
))
455 "Face used in agenda for captions and dates."
458 (defface org-agenda-date
'((t (:inherit org-agenda-structure
)))
459 "Face used in agenda for normal days."
462 (defface org-agenda-date-today
463 '((t (:inherit org-agenda-date
:weight bold
:italic t
)))
464 "Face used in agenda for today."
467 (defface org-agenda-clocking
'((t (:inherit secondary-selection
)))
468 "Face marking the current clock item in the agenda."
471 (defface org-agenda-date-weekend
'((t (:inherit org-agenda-date
:weight bold
)))
472 "Face used in agenda for weekend days.
474 See the variable `org-agenda-weekend-days' for a definition of
475 which days belong to the weekend."
478 (defface org-scheduled
479 '((((class color
) (min-colors 88) (background light
)) (:foreground
"DarkGreen"))
480 (((class color
) (min-colors 88) (background dark
)) (:foreground
"PaleGreen"))
481 (((class color
) (min-colors 8)) (:foreground
"green"))
482 (t (:bold t
:italic t
)))
483 "Face for items scheduled for a certain day."
486 (defface org-scheduled-today
487 '((((class color
) (min-colors 88) (background light
)) (:foreground
"DarkGreen"))
488 (((class color
) (min-colors 88) (background dark
)) (:foreground
"PaleGreen"))
489 (((class color
) (min-colors 8)) (:foreground
"green"))
490 (t (:bold t
:italic t
)))
491 "Face for items scheduled for a certain day."
494 (defface org-agenda-dimmed-todo-face
495 '((((background light
)) (:foreground
"grey50"))
496 (((background dark
)) (:foreground
"grey50")))
497 "Face used to dim blocked tasks in the agenda."
500 (defface org-scheduled-previously
501 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
502 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
503 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
504 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
506 "Face for items scheduled previously, and not yet done."
509 (defface org-upcoming-deadline
510 '((((class color
) (min-colors 88) (background light
)) (:foreground
"Firebrick"))
511 (((class color
) (min-colors 88) (background dark
)) (:foreground
"chocolate1"))
512 (((class color
) (min-colors 8) (background light
)) (:foreground
"red"))
513 (((class color
) (min-colors 8) (background dark
)) (:foreground
"red" :bold t
))
515 "Face for items scheduled previously, and not yet done."
518 (defcustom org-agenda-deadline-faces
519 '((1.0 . org-warning
)
520 (0.5 . org-upcoming-deadline
)
522 "Faces for showing deadlines in the agenda.
523 This is a list of cons cells. The cdr of each cell is a face to be used,
524 and it can also just be like \\='(:foreground \"yellow\").
525 Each car is a fraction of the head-warning time that must have passed for
526 this the face in the cdr to be used for display. The numbers must be
527 given in descending order. The head-warning time is normally taken
528 from `org-deadline-warning-days', but can also be specified in the deadline
529 timestamp itself, like this:
531 DEADLINE: <2007-08-13 Mon -8d>
533 You may use d for days, w for weeks, m for months and y for years. Months
534 and years will only be treated in an approximate fashion (30.4 days for a
535 month and 365.24 days for a year)."
537 :group
'org-agenda-daily
/weekly
540 (number :tag
"Fraction of head-warning time passed")
541 (sexp :tag
"Face"))))
543 (defface org-agenda-restriction-lock
544 '((((class color
) (min-colors 88) (background light
)) (:background
"#eeeeee"))
545 (((class color
) (min-colors 88) (background dark
)) (:background
"#1C1C1C"))
546 (((class color
) (min-colors 16) (background light
)) (:background
"#eeeeee"))
547 (((class color
) (min-colors 16) (background dark
)) (:background
"#1C1C1C"))
548 (((class color
) (min-colors 8)) (:background
"cyan" :foreground
"black"))
549 (t (:inverse-video t
)))
550 "Face for showing the agenda restriction lock."
553 (defface org-agenda-filter-tags
'((t :inherit mode-line
))
554 "Face for tag(s) in the mode-line when filtering the agenda."
557 (defface org-agenda-filter-regexp
'((t :inherit mode-line
))
558 "Face for regexp(s) in the mode-line when filtering the agenda."
561 (defface org-agenda-filter-category
'((t :inherit mode-line
))
562 "Face for categories(s) in the mode-line when filtering the agenda."
565 (defface org-time-grid
;Copied from `font-lock-variable-name-face'
566 '((((class color
) (min-colors 16) (background light
)) (:foreground
"DarkGoldenrod"))
567 (((class color
) (min-colors 16) (background dark
)) (:foreground
"LightGoldenrod"))
568 (((class color
) (min-colors 8)) (:foreground
"yellow" :weight light
)))
569 "Face used for time grids."
572 (defface org-agenda-current-time
'((t (:inherit org-time-grid
)))
573 "Face used to show the current time in the time grid."
576 (defface org-agenda-diary
'((t :inherit default
))
577 "Face used for agenda entries that come from the Emacs diary."
580 (defface org-agenda-calendar-event
'((t :inherit default
))
581 "Face used to show events and appointments in the agenda."
584 (defface org-agenda-calendar-sexp
'((t :inherit default
))
585 "Face used to show events computed from a S-expression."
588 (defconst org-level-faces
589 '(org-level-1 org-level-2 org-level-3 org-level-4
590 org-level-5 org-level-6 org-level-7 org-level-8
))
592 (defcustom org-n-level-faces
(length org-level-faces
)
593 "The number of different faces to be used for headlines.
594 Org mode defines 8 different headline faces, so this can be at most 8.
595 If it is less than 8, the level-1 face gets re-used for level N+1 etc."
599 (defcustom org-cycle-level-faces t
600 "Non-nil means level styles cycle after level `org-n-level-faces'.
601 Then so level org-n-level-faces+1 is styled like level 1.
602 If nil, then all levels >=org-n-level-faces are styled like
603 level org-n-level-faces"
604 :group
'org-appearance
609 (defface org-latex-and-related
610 (let ((font (cond ((assq :inherit custom-face-attributes
)
611 '(:inherit underline
))
612 (t '(:underline t
)))))
613 `((((class grayscale
) (background light
))
614 (:foreground
"DimGray" ,@font
))
615 (((class grayscale
) (background dark
))
616 (:foreground
"LightGray" ,@font
))
617 (((class color
) (background light
))
618 (:foreground
"SaddleBrown"))
619 (((class color
) (background dark
))
620 (:foreground
"burlywood"))
622 "Face used to highlight LaTeX data, entities and sub/superscript."
625 :package-version
'(Org .
"8.0"))
627 (defface org-macro
'((t :inherit org-latex-and-related
))
631 :package-version
'(Org .
"8.0"))
633 (defface org-tag-group
'((t :inherit org-tag
))
634 "Face for group tags."
637 :package-version
'(Org .
"8.0"))
639 (defface org-mode-line-clock
'((t (:inherit mode-line
)))
640 "Face used for clock display in mode line."
643 (defface org-mode-line-clock-overrun
644 '((t (:inherit mode-line
:background
"red")))
645 "Face used for clock display for overrun tasks in mode line."
650 ;;; org-faces.el ends here