-(require-package 'mmm-mode)
-(require-package 'sass-mode)
-(require-package 'scss-mode)
-(require-package 'less-css-mode)
-(require-package 'flymake-css)
-(require-package 'flymake-sass)
+;;; Colourise CSS colour literals
+(when (eval-when-compile (>= emacs-major-version 24))
+  ;; rainbow-mode needs color.el, bundled with Emacs >= 24.
+  (require-package 'rainbow-mode)
+  (eval-after-load 'rainbow-mode
+    '(dolist (hook '(css-mode-hook html-mode-hook sass-mode-hook))
+       (add-hook hook 'rainbow-mode))))
 
 
++
+;;; Embedding in html
+(require-package 'mmm-mode)
 (eval-after-load 'mmm-vars
   '(progn
      (mmm-add-group

(add-hook 'css-mode-hook 'maybe-flymake-css-load)


(add-hook 'sass-mode-hook 'flymake-sass-load)
(add-hook 'scss-mode-hook 'flymake-sass-load)
(setq-default scss-compile-at-save nil)


(eval-after-load 'auto-complete
  '(progn
     (dolist (hook '(css-mode-hook sass-mode-hook scss-mode-hook))
       (add-hook hook 'ac-css-mode-setup))))

(provide 'init-css)

       (mmm-add-mode-ext-class mode "\\.r?html\\(\\.erb\\)?\\'" 'html-css))))



;;; CSS flymake
(require-package 'flymake-css)
(defun maybe-flymake-css-load ()
  "Activate flymake-css as necessary, but not in derived modes."
  (when (eq major-mode 'css-mode)
