Skip to content

Instantly share code, notes, and snippets.

@kamiyam
Created November 22, 2013 01:42
Show Gist options
  • Save kamiyam/7593391 to your computer and use it in GitHub Desktop.
Save kamiyam/7593391 to your computer and use it in GitHub Desktop.
"stylus" & "nib" use auto compiler for Express
var express = require('express');
var path = require('path');
var stylus = require("stylus"), nib = require("nib");
var app = express();
// app.use ...
app.use(stylus.middleware({
src: path.join(__dirname, 'public'),
compile: function (str, path){ return stylus(str).set("filename", path).set("compress", true).use(nib()); }
}));
app.use(express.static(path.join(__dirname, 'public')));
@import 'nib'
body
padding: 50px
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif
a
color: #00B7FF
button
border-radius 5px
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment