CSS engines with Express

Once we have our HTML, we'll want to style it. We could of course use raw CSS, but Express integrates nicely with some select CSS engines.

Stylus is one such engine. It's written with Express in mind, and as a syntax it follows many of the design principles found in Jade.

In this recipe, we're going to put Stylus in the spotlight, learning how we can use it to apply styles to our profiles table from the previous recipe.

Getting ready

We'll need our nca folder as it was left in the previous recipe.

How to do it...

First, we need to set up our app to use Stylus.

If we were starting a new project, we could use the express executable to generate a Stylus-based Express project, as follows:

express -c stylus ourNewAppName

This would ...

Get Node Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.