diff options
| author | Simen Heggestøyl | 2016-01-30 20:47:18 +0100 |
|---|---|---|
| committer | Simen Heggestøyl | 2016-01-30 20:47:18 +0100 |
| commit | 2df0e04296b73d212875ce46c8734ec255496a78 (patch) | |
| tree | 97bc159cf9336dca84d381a1531031f4f8b57696 | |
| parent | 3cf5e81ded367e64fa93aca4aeb1ed75373dc085 (diff) | |
| download | emacs-2df0e04296b73d212875ce46c8734ec255496a78.tar.gz emacs-2df0e04296b73d212875ce46c8734ec255496a78.zip | |
Highlight CSS variables with variable name face
* lisp/textmodes/css-mode.el (css-nmstart-re): Don't match variables.
(css--font-lock-keywords): Highlight variables in
`font-lock-variable-name-face'.
| -rw-r--r-- | lisp/textmodes/css-mode.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index d402fb19955..96a82baa56c 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el | |||
| @@ -215,7 +215,7 @@ | |||
| 215 | (defconst css-escapes-re | 215 | (defconst css-escapes-re |
| 216 | "\\\\\\(?:[^\000-\037\177]\\|[0-9a-fA-F]+[ \n\t\r\f]?\\)") | 216 | "\\\\\\(?:[^\000-\037\177]\\|[0-9a-fA-F]+[ \n\t\r\f]?\\)") |
| 217 | (defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)")) | 217 | (defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)")) |
| 218 | (defconst css-nmstart-re (concat "\\(?:--\\)?\\(?:[[:alpha:]]\\|" css-escapes-re "\\)")) | 218 | (defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)")) |
| 219 | (defconst css-ident-re ;; (concat css-nmstart-re css-nmchar-re "*") | 219 | (defconst css-ident-re ;; (concat css-nmstart-re css-nmchar-re "*") |
| 220 | ;; Apparently, "at rules" names can start with a dash, e.g. @-moz-keyframes. | 220 | ;; Apparently, "at rules" names can start with a dash, e.g. @-moz-keyframes. |
| 221 | (concat css-nmchar-re "+")) | 221 | (concat css-nmchar-re "+")) |
| @@ -246,6 +246,8 @@ | |||
| 246 | ;; Since "An at-rule consists of everything up to and including the next | 246 | ;; Since "An at-rule consists of everything up to and including the next |
| 247 | ;; semicolon (;) or the next block, whichever comes first." | 247 | ;; semicolon (;) or the next block, whichever comes first." |
| 248 | (,(concat "@" css-ident-re) (0 font-lock-builtin-face)) | 248 | (,(concat "@" css-ident-re) (0 font-lock-builtin-face)) |
| 249 | ;; Variables. | ||
| 250 | (,(concat "--" css-ident-re) (0 font-lock-variable-name-face)) | ||
| 249 | ;; Selectors. | 251 | ;; Selectors. |
| 250 | ;; FIXME: attribute selectors don't work well because they may contain | 252 | ;; FIXME: attribute selectors don't work well because they may contain |
| 251 | ;; strings which have already been highlighted as f-l-string-face and | 253 | ;; strings which have already been highlighted as f-l-string-face and |