欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

使用下一个版本的ECMAScript编写模块化和可扩展的CSS:unistyle_html/css_WEB-ITnose

程序员文章站 2022-05-28 10:14:31
...
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 --helpUsage: bin/unistyle [options] 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.open-open.com/lib/view/home/1441426543628