2017-09-18 17:31:48 +08:00
|
|
|
#!/usr/bin/env node
|
|
|
|
const path = require('path');
|
2019-12-23 16:30:32 +08:00
|
|
|
const { generateTheme } = require('antd-theme-generator');
|
2019-12-24 18:26:35 +08:00
|
|
|
const genCss = require('antd-pro-merge-less');
|
2020-04-05 20:38:56 +08:00
|
|
|
const defaultVar = require('./default-vars');
|
2019-12-24 18:26:35 +08:00
|
|
|
const dark = require('./dark-vars');
|
2020-03-29 10:39:46 +08:00
|
|
|
const compact = require('./compact-vars');
|
2019-12-24 18:26:35 +08:00
|
|
|
|
|
|
|
genCss(
|
|
|
|
path.join(__dirname, '..'),
|
|
|
|
[
|
|
|
|
{
|
|
|
|
theme: 'dark',
|
|
|
|
fileName: './_site/dark.css',
|
|
|
|
modifyVars: {
|
2020-04-05 20:38:56 +08:00
|
|
|
...defaultVar,
|
2019-12-24 18:26:35 +08:00
|
|
|
...dark,
|
2020-02-06 14:43:16 +08:00
|
|
|
'@site-text-color': '@heading-color',
|
2019-12-24 18:26:35 +08:00
|
|
|
'@site-markdown-code-bg': '@input-bg',
|
|
|
|
},
|
|
|
|
},
|
2020-03-29 10:39:46 +08:00
|
|
|
{
|
|
|
|
theme: 'compact',
|
|
|
|
fileName: './_site/compact.css',
|
|
|
|
modifyVars: {
|
2020-04-05 20:38:56 +08:00
|
|
|
...defaultVar,
|
2020-03-29 10:39:46 +08:00
|
|
|
...compact,
|
|
|
|
},
|
|
|
|
},
|
2019-12-24 18:26:35 +08:00
|
|
|
],
|
|
|
|
{
|
|
|
|
ignoreAntd: true,
|
|
|
|
isModule: false,
|
|
|
|
cache: false,
|
|
|
|
loadAny: true,
|
|
|
|
ignoreProLayout: true,
|
|
|
|
},
|
|
|
|
);
|
2018-05-18 12:01:32 +08:00
|
|
|
|
2019-12-23 16:30:32 +08:00
|
|
|
const options = {
|
|
|
|
stylesDir: path.join(__dirname, '../site/theme/static'),
|
|
|
|
antdStylesDir: path.join(__dirname, '../components'),
|
|
|
|
varFile: path.join(__dirname, '../components/style/themes/default.less'),
|
|
|
|
mainLessFile: path.join(__dirname, '../site/theme/static/index.less'),
|
|
|
|
themeVariables: ['@primary-color'],
|
|
|
|
outputFilePath: path.join(__dirname, '../_site/color.less'),
|
|
|
|
};
|
|
|
|
|
|
|
|
generateTheme(options);
|