theme-zero
v0.0.2
Published
Theme generator cli tool
Downloads
2
Readme
theme-zero
Theme generator cli tool.
Installation
install local or global
npm i theme-zero -D
CLI
# init variables file
tz --init [file path]
# watch then build
tz --watch [--vars variables file name] [--out output theme path] [--name output theme name]
# build
tz [--theme default theme path] [--vars variables file name] [--out output theme path] [--name output theme name] [--minimize]
Node API
var tz = require('theme-zero');
// watch mode
tz.watch({
themeVars: 'variables.less',
outPath: './src/styles/theme-custom',
outName: 'theme-custom',
});
// build
et.run({
themePath: './src/styles/theme-default',
themeVars: 'variables.less',
outPath: './src/styles/theme-custom',
outName: 'theme-custom',
minimize: true,
});
Options
themePath
Default theme path, default ./src/styles/theme-default
.
themeVars
Variable file name, default variables.css
.
outPath
Theme output path, default ./src/styles/theme-custom
.
outName
Theme output name, default theme-custom
.
minimize
Compressed file.
browsers
set browsers, default ['ie > 9', 'last 2 versions']
.
watch
watch variable file changes then build.
components
A lists of components that you want to generate themes for. All by default.
Config
You can configure some options in theme
by putting it in package.json:
{
"theme": {
"themePath": "./src/styles/theme-default",
"themeVars": "variables.less",
"outPath": "./src/styles/theme-custom",
"outName": "theme-custom",
"browsers": ["ie > 9", "last 2 versions"],
"minimize": false,
"components": ["button", "input"]
}
}
License
MIT