element-theme
Version:
Theme generator cli tool for Element
90 lines (70 loc) • 1.81 kB
Markdown
[](https://travis-ci.org/ElementUI/element-theme)
[](https://www.npmjs.com/package/element-theme)
> Theme generator cli tool for Element.

> The current version is compatible with element-ui@2.x. For element-ui@1.x, please check out the legacy branch.
install local or global
```shell
npm i element-theme -D
```
install `theme-chalk`
```shell
npm i element-theme-chalk -D
npm i https://github.com/ElementUI/theme-chalk -D
```
```shell
et --init [file path]
et --watch [--config variable file path] [--out theme path]
et [--config variable file path] [--out theme path] [--minimize]
```
```javascript
var et = require('element-theme')
// watch mode
et.watch({
config: 'variables/path',
out: 'output/path'
})
// build
et.run({
config: 'variables/path',
out: 'output/path',
minimize: true
})
```
Variable file path, default `./element-variables.css`.
Theme output path, default `./theme`.
Compressed file.
set browsers, default `['ie > 9', 'last 2 versions']`.
watch variable file changes then build.
A lists of components that you want to generate themes for. All by default.
You can configure some options in `element-theme` by putting it in package.json:
```json
{
"element-theme": {
"browsers": ["ie > 9", "last 2 versions"],
"out": "./theme",
"config": "./element-variables.css",
"theme": "element-theme-chalk",
"minimize": false,
"components": ["button", "input"]
}
}
```
MIT