stylus , another css processor

 

1. install from npm

sudo npm install stylus 

 

2. create a styl file named step1.styl

border-radius() {
  -webkit-border-radius: arguments
  -moz-border-radius: arguments
  border-radius: arguments
}

body a {
  font: 12px/1.4 "Lucida Grande", Arial, sans-serif;
  background: black;
  color: #ccc;
}

form input {
  padding: 5px;
  border: 1px solid;
  border-radius: 5px;
}

 

3. create a js file for render css from styl file

var stylus = require(‘stylus‘);


var str=".{border:1px solid red;}";
str = require("fs").readFileSync("step1.styl", "utf8");

stylus.render(str, { filename: ‘step1.styl‘ }, function(err, css){
  if (err) throw err;
  console.log(css);
});

 

 

 

https://github.com/Automattic/stylus

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。