Skip to content

Instantly share code, notes, and snippets.

@annacoding2020
Created May 4, 2020 21:00
Show Gist options
  • Select an option

  • Save annacoding2020/0efc6024eb9e793e2f20d6aa65e80d5d to your computer and use it in GitHub Desktop.

Select an option

Save annacoding2020/0efc6024eb9e793e2f20d6aa65e80d5d to your computer and use it in GitHub Desktop.
const path = require('path');
const { generateTheme } = require('antd-theme-generator');
const options = {
stylesDir: path.join(__dirname, './src/theme'),
antDir: path.join(__dirname, './node_modules/antd'),
varFile: path.join(__dirname, './src/theme/vars.less'),
mainLessFile: path.join(__dirname, './src/theme/index.less'),
themeVariables: ['@primary-color', '@layout-header-background', '@menu-dark-color', '@font-size-base'],
indexFileName: 'index.html',
outputFilePath: path.join(__dirname, './public/color.less'),
};
generateTheme(options)
.then((less) => {
console.log('Theme generated successfully');
})
.catch((error) => {
console.log('Error', error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment