branch: elpa/jade-mode
commit 1b869260464de75b094a4e5ef8e68b908fe5f2c5
Author: Gavin Cannizzaro <[email protected]>
Commit: Gavin Cannizzaro <[email protected]>
Refined and extended syntax highlighting
- Capturing class names that include hyphens
- Capturing id selectors that include hyphens
- Capturing standalone (unitless) integers
- Capturing directives (@) and "backreferences" (same-rule property
references)
---
stylus-mode.el | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/stylus-mode.el b/stylus-mode.el
index 46cc196249..9849697ea2 100644
--- a/stylus-mode.el
+++ b/stylus-mode.el
@@ -47,9 +47,12 @@
0 font-lock-constant-face)
(,(concat "[^_$]?\\<\\(" stylus-keywords "\\)\\>[^_]?")
0 font-lock-keyword-face)
-
(,"\\([.0-9]+:?\\(em\\|ex\\|px\\|mm\\|cm\\|in\\|pt\\|pc\\|deg\\|rad\\|grad\\|ms\\|s\\|Hz\\|kHz\\|rem\\|%\\)\\)"
0 font-lock-constant-face)
- (,"#\\w+" 0 font-lock-keyword-face)
+ (,"#\\w[a-zA-Z0-9\\-]+" 0 font-lock-keyword-face) ; id selectors (also
colors...)
+
(,"\\([.0-9]+:?\\(em\\|ex\\|px\\|mm\\|cm\\|in\\|pt\\|pc\\|deg\\|rad\\|grad\\|ms\\|s\\|Hz\\|kHz\\|rem\\|%\\)\\b\\)"
0 font-lock-constant-face)
+ (,"\\b[0-9]+\\b" 0 font-lock-constant-face)
+ (,"\\.\\w[a-zA-Z0-9\\-]+" 0 font-lock-type-face) ; class names
(,"$\\w+" 0 font-lock-variable-name-face)
+ (,"@\\w[a-zA-Z0-9\\-]+" 0 font-lock-preprocessor-face) ; directives and
backreferences
))
(defvar stylus-syntax-table