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

stylus , another css processor的更多相关文章

  1. vue 使用Jade模板写html,stylus写css

    vue 使用Jade模板写html,stylus写css 日常工作都是使用vue开发页面和webApp,写的多了就想偷懒简化各种书写方式,所以使用了jade写html,stylus写css,省了很多的 ...

  2. stylus(css预编译器)

    推荐去张鑫旭大神这里详细了解:http://www.zhangxinxu.com/jq/stylus/ 安装 npm install -g stylus 自动编译 $ stylus -w demo.s ...

  3. vue中使用stylus编写css

    安装步骤 cnpm install stylus --save-dev cnpm install stylus-loader --save-dev 写法如下: <style lang=" ...

  4. CSS预处器的对比——Sass、Less和Stylus

    预处器的对比--Sass.LESS和Stylus 转载: 英文原文:http://net.tutsplus.com/tutorials/html-css-techniques/sass-vs-less ...

  5. 前端学习笔记系列一:6 一种新的css预编译器stylus

    stylus是 CSS 的预处理框架.CSS 预处理,顾名思义,预先处理 CSS.那 stylus 咋预先处理呢?stylus 给 CSS 添加了可编程的特性,也就是说,在 stylus 中可以使用变 ...

  6. CSS+Javascript的那些框架

    CSS CSS 制作框架 SASS http://www.oschina.net/p/sass Blueprint  http://www.oschina.net/p/blueprintcss Ela ...

  7. [AngularJS + Webpack] Requiring CSS & Preprocessors

    Making your CSS modular is a difficult thing to do, but using Webpack makes this so much easier. By ...

  8. stylus 详解与引入

    Stylus介绍及特点Stylus 是一个基于Node.js的CSS的预处理框架,诞生于2010年,比较年轻,可以说是一种新型语言,其本质上做的事情与 Sass/LESS 等类似, 可以以近似脚本的方 ...

  9. stylus入门学习笔记

    title: stylus入门学习笔记 date: 2018-09-06 17:35:28 tags: [stylus] description: 学习到 vue, 有人推荐使用 stylus 这个 ...

随机推荐

  1. .NET控件命名规范

    一.基本数据类型前缀 数据类型    数据类型简写 Array    arr Boolean    bln Byte    byt Char    chr DateTime    dtm Decima ...

  2. 利用Underscore求数组的交集、并集和差集

    1 数组交集函数——intersection 数组的交集是指包含多个数组中的共同元素的一个数组,求数组的交集就是找出给定数组中的共有元素. 下面实现一个求两个数组交集的函数. 判断数组是够包含指定值, ...

  3. bzoj2336 [HNOI2011]任务调度

    Description 正解:搜索+随机化. 先写个搜索,枚举所有没有要求的任务属于哪一种任务,然后再用爬山来更新最优解. 具体来说就是先把所有先做任务$A$的按照$a$时间从大到小排序,先做任务$B ...

  4. 从windows到linux的换行转换工具dos2unix

    同学们也许知道,windows中的文本文件的换行符是"\r\n",而linux中是"\n".由于换行符的不同,所以有的时候会发生一些莫名其妙的状况.至于具体什么 ...

  5. Mongod启动失败修复方法

    可能的原因:上次服务未正常关闭 1.删除data/db目录下的mongo.lock文件 2.删除/tmp/mongodb-27017.sock文件

  6. [19/04/12-星期五] 多线程_任务定时调度(Timer、Timetask和QUARTZ)

    一.Timer和Timetask 通过Timer和Timetask,我们可以实现定时启动某个线程. java.util.Timer 在这种实现方式中,Timer类作用是类似闹钟的功能,也就是定时或者每 ...

  7. SpringAop之日志管理

    导入的依赖均为JavaWeb界面在线配置代码生成器这篇文章,你只需将这篇文章的maven依赖导入即可. SpringAop利用注解的特性进行日志管理,只需在对应的方法上加上自己编写的注解,即可完美实现 ...

  8. MySQL常用API函数

    -- 返回数字的绝对值 SELECT ABS(-10) -- 返回不大于X的最大整数值 SELECT FLOOR(10.9) -- 返回不小于X的最大整数值 SELECT CEILING(10.4) ...

  9. springAOP(Aspect)权限访问页面

    1.XML进行配置切面 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="h ...

  10. 浅谈DB2的四个隔离级别

    隔离级别定义用于控制并发事务的行为,它决定在访问数据时数据是如何锁定的.如何与其他进程隔离的. 包括四个级别,级别从高到低: RR(可重复读取) RS(读取稳定性) CS(游标稳定性) UR(未提交的 ...