rework

Plugin framework for CSS preprocessing in Node.js

  • 所有者: reworkcss/rework
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

rework Build Status

CSS manipulations built on css, allowing
you to automate vendor prefixing, create your own properties, inline images,
anything you can imagine!

Please refer to css for AST documentation
and to report parser/stringifier issues.

Installation

$ npm install rework

Usage

var rework = require('rework');
var pluginA = require('pluginA');
var pluginB = require('pluginB');

rework('body { font-size: 12px; }', { source: 'source.css' })
  .use(pluginA)
  .use(pluginB)
  .toString({ sourcemap: true })

API

rework(code, [options])

Accepts a CSS string and returns a new Rework instance. The options are
passed directly to css.parse.

Rework#use(fn)

Use the given plugin fn. A rework "plugin" is simply a function accepting the
stylesheet root node and the Rework instance.

Rework#toString([options])

Returns the string representation of the manipulated CSS. The options are
passed directly to css.stringify.

Unlike css.stringify, if you pass sourcemap: true a string will still be
returned, with the source map inlined. Also use sourcemapAsObject: true if
you want the css.stringify return value.

Plugins

Rework has a rich collection of plugins and mixins. Browse all the Rework
plugins
available on npm.

Plugins of particular note:

  • at2x – serve high resolution images
  • calc – resolve simple calc() expressions
  • colors – color helpers like rgba(#fc0, .5)
  • ease – several additional easing functions
  • extendextend: selector support
  • function – user-defined CSS functions
  • import – read and inline CSS via @import
  • inline – inline assets as data URIs
  • mixin – custom property logic with mixins
  • npm - inline CSS via @import using node's module resolver
  • references – property references like height: @width
  • url – rewrite url()s with a given function
  • variables – W3C-style variables

Built with rework

License

(The MIT License)

Copyright (c) 2012–2013 TJ Holowaychuk tj@vision-media.ca

Copyright (c) 2014 Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the 'Software'), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

主要指標

概覽
名稱與所有者reworkcss/rework
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證
所有者活动
創建於2012-07-14 00:10:05
推送於2021-03-26 00:14:52
最后一次提交2015-02-01 01:05:36
發布數45
最新版本名稱1.0.1 (發布於 2014-08-28 13:47:27)
第一版名稱0.0.2 (發布於 2012-07-15 16:56:32)
用户参与
星數2.8k
關注者數85
派生數122
提交數346
已啟用問題?
問題數101
打開的問題數9
拉請求數53
打開的拉請求數7
關閉的拉請求數34
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?