Rumah > hujung hadapan web > html tutorial > 生成 Material 风格颜色样式_html/css_WEB-ITnose

生成 Material 风格颜色样式_html/css_WEB-ITnose

WBOY
Lepaskan: 2016-06-21 08:48:01
asal
1615 orang telah melayarinya

theme-color

Material theme color generator.

DEMO

http://qingwei-li.github.io/theme-color/

Install

$ npm i theme-color -S
Salin selepas log masuk

Quick Start

import ThemeColor from 'theme-color'const tc = new ThemeColor('blue', 'red')tc.get()/*{  "lightPrimary": "#BBDEFB",  "primary": "#2196F3",  "darkPrimary": "#1976D2",  "accent": "#FF5252"}*/tc.css({  prefix: 'color-'})/*  .color-light-primary: {    background-color: "#BBDEFB";  }  .color-primary: {    background-color: "#2196F3";  }  .color-dark-primary: {    background-color: "#1976D2";  }  .color-accent {    background-color: "#FF5252";  } */
Salin selepas log masuk

Options

  • primaryColor: String
  • accentColor: String

Material color: ['red', 'pink', 'purple', 'deepPurple', 'indigo', 'blue', 'lightBlue', 'cyan', 'teal', 'green', 'lightGreen', 'lime', 'yellow', 'amber', 'orange', 'deepOrange', 'brown', 'grey', 'blueGrey']

// primary color blue, accent color redvar tc = new ThemeColor('blue', 'red')// randomvar tc = new ThemeColor()// random accent colorvar tc = new ThemeColor('blue')
Salin selepas log masuk

API

get()

theme color object. like

{  "lightPrimary": "#BBDEFB",  "primary": "#2196F3",  "darkPrimary": "#1976D2",  "accent": "#FF5252"}
Salin selepas log masuk

css(options: Object)

return css string.

const tc = new ThemeColor('blue', 'red')tc.css({  prefix: 'tc-',  suffix: '-color',  primary: 'main',  lightPrimary: 'light-main',  darkPrimary: 'dark-main',  accent: 'second'})
Salin selepas log masuk

output

.tc-light-main-color: {background-color: #BBDEFB;}.tc-main-color: {background-color: #2196F3;}.tc-dark-main-color: {background-color: #1976D2;}.tc-second-color: {background-color: #FF5252;}
Salin selepas log masuk

CLI

-c --config

config file. like

{  "color": ["blue", "red"],  "css": {    "prefix": "tc-",    "suffix": "-color",    "primary": "main",    "darkPrimary": "dark-main",    "lightPrimary": "light-main",    "accent": "second"  }}
Salin selepas log masuk

-o --output

output css file.

-d --demo

output demo html file.

License

WTFPL

sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan