zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    前端JS 4
    前端JS 3
    前端JS 2
    前端JS 1
    JS的知识补丁
    去除inline-block元素间的空隙
    js中“||”和“&&”的高级用法
    WebAPP-1
    Node.js_1
    click和onclick的区别
  • 原文地址:https://www.cnblogs.com/zyip/p/4367329.html
Copyright © 2011-2022 走看看