I rewrote CSS3 from scratch for the new sublime-syntax system. The result is night-and-day better than v1.0. I will make the claim that this is the definitive CSS package for Sublime.
https://packagecontrol.io/packages/CSS3
Here’s the changelog:
- complete rewrite using the new sublime-syntax system
- fixed countless highlighting bugs
- removed W3C validator for performance (will return as separate package)
- removed backtracking regexes for performance
- much, much faster
- updated for latest changes to the specs
- CSS variables
- HTML5 custom element selectors
- added exhaustive completions
- increased specificity of completions (less noisy)
I went through 40+ W3C specs and implemented custom regexes for 400+ properties. Every property, value, @-rule, and function now has comprehensive completions. The finished language definition came in at about 9600 lines. This makes it one of the largest, if not the largest, definition for any language. The main reasons CSS3 is so huge is because of A) CSS is a gargantuan language, and B) I only wanted valid CSS values to be highlighted. In other words, if you mistype a property value, it shouldn’t be highlighted. I had to write regexes for each of the 400+ CSS properties to make that happen. That sucked hard, but the result is a big win for productivity.
Despite its size, version 2.0 is MUCH faster than 1.0 thanks to the new regex engine. It used to take a second or two for the syntax highlighting to be applied to large CSS files. Now it typically takes less than 100ms.
The new sublime-syntax system was a dream to work with compared with the old TextMate garbage. My hat’s off to the Sublime Text authors for such a nice language definition system. Package authors: if you haven’t made the leap to sublime-syntax yet, it’s well worth the effort.
I’m really happy with how everything turned out, but here’s a confession: I don’t write CSS professionally. If some of you front-end wizards would try it out and send me bug reports, I’d really appreciate it.
Thanks!