0
;;; sass-mode.el -- Major mode for editing Sass files
0
;;; Written by Nathan Weizenbaum
0
;;; Because Sass's indentation schema is similar
0
;;; functions are similar to those in yaml-mode and python-mode.
0
;;; To install, save this somewhere and add the following to your .emacs file:
0
;;; (add-to-list 'load-path "/path/to/sass-mode.el")
0
;;; (require 'sass-mode nil 't)
0
"Prepends a Sass-tab-matching regexp to str."
0
(concat "^\\(" (string-* " " sass-indent-offset) "\\)*" str))
0
+(defconst sass-font-lock-keywords-1
0
+ '("^@.*" 0 font-lock-constant-face)
0
+ ;; strings and hex constants
0
+ '("\\(\'[^']*'\\)" 1 font-lock-string-face append)
0
+ '("\\(\"[^\"]*\"\\)" 1 font-lock-string-face append)
0
+ '("\\(#[0-9a-fA-F]\\{3\\}\\{1,2\\}\\>\\)" 1 font-lock-string-face append)
0
+ '("\\(:[A-Za-z-]+\\|[A-Za-z-]+:\\)" 0 font-lock-constant-face append)
0
+ '("![a-z0-9_-]+" 0 font-lock-variable-name-face append)
0
+ '("^ *\\(/[/*].*\\)$" 1 font-lock-comment-face append)
0
+ '("\\(?:^\\|,\\) *\\(#[a-z0-9_-]+\/?\\)" 1 font-lock-keyword-face)
0
+ '("\\(?:^\\|,\\) *\\(\\.[a-z0-9_-]+\/?\\)" 1 font-lock-type-face)
0
+ '("\\(?:^\\|,\\) *\\(&\\|[a-z0-9_]+\/?\\)" 1 font-lock-function-name-face )
0
+ '("\\(?:^\\|,\\) *\\(#[a-z0-9_]+\/?\\)" (1 font-lock-keyword-face)
0
+ ("\\.[a-z0-9_-]+" nil nil (0 font-lock-type-face)))
0
+ '("\\(?:^\\|,\\) *\\(\\.[a-z0-9_]+\/?\\)" (1 font-lock-type-face)
0
+ ("\\.[a-z0-9_-]+" nil nil (0 font-lock-type-face)))
0
+ '("\\(?:^\\|,\\) *\\(\\.[a-z0-9_]+\/?\\)" (1 font-lock-type-face)
0
+ ("\\#[a-z0-9_-]+" nil nil (0 font-lock-keyword-face)))
0
+ '("\\(?:^\\|,\\) *\\(&\\|[a-z0-9_]+\/?\\)" (1 font-lock-function-name-face)
0
+ ("\\.[a-z0-9_-]+" nil nil (0 font-lock-type-face)))
0
+ '("\\(?:^\\|,\\) *\\(&\\|[a-z0-9_]+\/?\\)" (1 font-lock-function-name-face)
0
+ ("\\#[a-z0-9_-]+" nil nil (0 font-lock-keyword-face)))
0
+ '("\\([=]\\)" 0 font-lock-preprocessor-face prepend)))
0
-(defconst sass-mode-version "0.0.
1" "Version of `sass-mode.'")
0
+(defconst sass-mode-version "0.0.
2" "Version of `sass-mode.'")
0
(defconst sass-blank-line-re "^[ \t]*$"
0
"Regexp matching a line containing only whitespace.")
0
"Simple mode to edit Sass.
0
- (set (make-local-variable 'indent-line-function) 'sass-indent-line))
0
+ (set (make-local-variable 'indent-line-function) 'sass-indent-line)
0
+ (set (make-local-variable 'font-lock-defaults)
0
+ '((sass-font-lock-keywords-1)
0
;; Indentation and electric keys
Comments
No one has commented yet.