Use Stylus CSS in Sublime Text 3

I used to use LESS, but Stylus look interesting, it is fewer characters to type, less code less error.

Here is how I can “transpile/compile” .stylus file to .css file in Build System of Sublime Text 3 (on Windows)

  • Install nodejs
  • Go to command line (Run as Administrator), run 
    npm install stylus -g
install stylus module, in global mode
  • Open Sublime Text (I used v3)
  • Go to menu Tools / Build System / New Build System
  • Paste this
{
“cmd”: “stylus $file_name”,
“working_dir”: “$file_path”
}
  • Save it as my-Stylus.sublime-build
  • Done

Now you can open a test.stylus, with content

b
 color blue

Press Ctrl B, then you have test.css with b {color: #00f;}

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.