Created
May 4, 2020 21:00
-
-
Save annacoding2020/0efc6024eb9e793e2f20d6aa65e80d5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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