使用下一個版本的ECMAScript編寫模塊化和可擴展的CSS:unistyle

ygp8 9年前發布 | 9K 次閱讀 unistyle CSS 前端技術

unistyle實現使用下一個版本的ECMAScript編寫模塊化和可擴展的CSS。

Why?

使用ES2015 和一些ES2016特性來編寫CSS用JavaScript讓其真正的模塊化,可 擴展,讓你很好地實踐CSS前或后處理器的所有功能,無需求助于一個新的語言。

Unistyle?

The name is an abbreviation of Uniform Stylesheets. It is also somewhat related to Universal JavaScript or what you want to call it, because of the ability to share the same CSS code written in JavaScript between your frontend component's inline styles and the application's complete CSS.

Installation

Installunistyleusing npm:

npm install --save unistyle

CLI Usage

$> unistyle --help

Usage: bin/unistyle [options] <path to module>

Options:
  -o, --output   Output compiled CSS to specified file instead of to stdout  [string]
  -h, --help     Show help  [boolean]
  -v, --version  Show version number  [boolean]

Examples:
  bin/unistyle -o app.css src/styles.js  Compile src/styles.js to app.css
  bin/unistyle -o style.css style        Compile style/index.js to style.css

項目主頁:http://www.baiduhome.net/lib/view/home/1441426543628

 本文由用戶 ygp8 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!