【发布时间】:2016-10-27 11:47:52
【问题描述】:
我在页面上使用 express、bootstrap-styl、stylus、nib 和 pug/jade
我的服务器代码
var express=require('express')
var boostrap=require('bootstrap-styl')
var stylus=require('stylus')
var nib=require('nib')
var pug=require('pug')
var app=express()
app.use(express.static('public'));
app.use(stylus.middleware({
src: 'public',
compile: compile
}))
app.set('views', './views');
app.set('view engine', 'pug');
function compile(str,path){
return stylus(str)
.set('filename',path)
.set('compress',true)
.use([boostrap(),nib()])
}
app.get('/',function(req,res){
//res.send('Hello Hola')
res.render('index',{msg:'my message'})
})
app.listen(80)
我的玉码
doctype html5
html
head
link(rel='stylesheet',href='/style/style.css')
body
=msg
input(type=text)
button.btn.btn-warning(type='button') Click
我的按钮没有用 bootstrap 设置样式,bootstrap-styl 到底是做什么的?
我的错,我没有在 style.styl 导入引导程序
@import 'nib'
@import bootstrap
body
background-color red
【问题讨论】:
-
也许你应该查一下? npmjs.com/package/bootstrap-styl
标签: javascript node.js twitter-bootstrap pug stylus