Mac – Emacs CSS modes – most feature complete and maintained

cssemacsmode

According to EmacsWiki there are bunch of CSS modes for Emacs, but none of them seems to be very actively developed or even that feature complete. Which one is the most feature complete so far and is being maybe even maintained?

Features

  • Syntax highlighting
  • Well behaved indentation
  • Commenting
    • Region
    • Line
  • Validation
    • Error reporting

Problems with the default CSS mode

One of the reason why the current CSS mode doesn't cut it for me is because it indents selectors NOT like this

div.bar input,
div.bar select {
    float: left;
}

, but like this

div.bar input,
        div.bar select {
                float: left;
        }

which is simply unbearable.

Best Answer

I'm using the css-mode that comes with GNU Emacs 24 and it indents fine (the way you want). It does all what you want except validation, and it's part of GNU Emacs so it's maintained. I haven't tried it, but I think css-tidy.el can do validation.

The only customizations I have are

(setq cssm-indent-function #'cssm-c-style-indenter)
(setq cssm-indent-level 2)

but I think those are remnants of some former css mode since neither is defined anywhere. What Emacs are you using and what command is being used to indent (C-h k TAB)?

Related Question