Created
November 22, 2013 01:42
-
-
Save kamiyam/7593391 to your computer and use it in GitHub Desktop.
"stylus" & "nib" use auto compiler for Express
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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