A Type-Based Command Plugin for Sublime 2

2014-09-17 | #solution, #webdev

I really like Stylus.

Its smart "@require"-directive coupled with the possibility to compress the css on output make it a powerful style-aggregator without much hassle.

Add to this the wonderfully easy Sublime integration with node.js and you got a killer tool on your hands.

There was just one thing missing for me to be happy:

Auto-compilation of the aggregator.styl on save of ANY styl-file. Based on the "SublimeBuildOnSave"-plugin I build an own little plugin, which is capable of executing a certain command on save of a certain file type (see links to the left).

Just copy the zip's contents into your Sublime-packages and create your own package settings based on the default settings (file specific stufff should go into the project file under "settings"), everything here should be self explanatory. Currently the defaults are Stylus- and Windows-based, since that's what I'm using atm, but that should really be no brain teaser.

With this, the Stylus-scenario above is really simple to solve and makes working with this preprocessor a breeze!