Stylus基本使用

Stylus [ˈstaɪləs] CSS预处理语言

  1. 安装到全局环境
$ npm install stylus -g
  1. 基本使用
stylus -w style.styl -o style.css

Stylus基本使用_第1张图片
  1. Example
    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

compiles to:

     body a {
        font: 12px/1.4 "Lucida Grande", Arial, sans-serif;
        background: #000;
        color: #ccc;
     }
    form input {
        padding: 5px;
        border: 1px solid;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
    }

学习地址:Stylus中文版参考文档

你可能感兴趣的:(Stylus基本使用)