fix: generateColor

This commit is contained in:
ycjcl868 2019-12-24 18:26:35 +08:00
parent 589750dbd6
commit 9049e08957
2 changed files with 25 additions and 1 deletions

View File

@ -66,7 +66,7 @@
"pretty-quick": "pretty-quick",
"pub": "antd-tools run pub",
"prepublish": "antd-tools run guard",
"site": "cross-env npm run compile && npm run dist && cp ./dist/antd.dark.css ./_site/dark.css && NODE_ICU_DATA=node_modules/full-icu bisheng build --ssr -c ./site/bisheng.config.js && node ./scripts/generateColorLess.js",
"site": "cross-env NODE_ICU_DATA=node_modules/full-icu bisheng build --ssr -c ./site/bisheng.config.js && node ./scripts/generateColorLess.js",
"sort": "npx sort-package-json",
"sort-api": "antd-tools run sort-api-table",
"start": "rimraf _site && mkdir _site && node ./scripts/generateColorLess.js && cross-env NODE_ENV=development bisheng start -c ./site/bisheng.config.js",
@ -157,6 +157,7 @@
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "~2.9.0",
"antd-theme-generator": "^1.1.6",
"antd-pro-merge-less": "^2.0.24",
"babel-eslint": "^10.0.1",
"babel-plugin-add-react-displayname": "^0.0.5",
"bisheng": "~1.3.3",

View File

@ -1,6 +1,29 @@
#!/usr/bin/env node
const path = require('path');
const { generateTheme } = require('antd-theme-generator');
const genCss = require('antd-pro-merge-less');
const dark = require('./dark-vars');
genCss(
path.join(__dirname, '..'),
[
{
theme: 'dark',
fileName: './_site/dark.css',
modifyVars: {
...dark,
'@site-markdown-code-bg': '@input-bg',
},
},
],
{
ignoreAntd: true,
isModule: false,
cache: false,
loadAny: true,
ignoreProLayout: true,
},
);
const options = {
stylesDir: path.join(__dirname, '../site/theme/static'),