2020-04-05 20:38:56 +08:00
|
|
|
/**
|
2020-12-28 15:30:18 +08:00
|
|
|
* Convert default.less into js vars
|
2020-04-05 20:38:56 +08:00
|
|
|
*
|
2020-12-28 15:30:18 +08:00
|
|
|
* @example
|
|
|
|
* const darkVars = require('./default-vars');
|
2020-04-05 20:38:56 +08:00
|
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
const lessToJs = require('less-vars-to-js');
|
|
|
|
|
|
|
|
const stylePath = path.join(__dirname, '..', 'components', 'style');
|
|
|
|
const colorLess = fs.readFileSync(path.join(stylePath, 'color', 'colors.less'), 'utf8');
|
|
|
|
const defaultLess = fs.readFileSync(path.join(stylePath, 'themes', 'default.less'), 'utf8');
|
|
|
|
|
|
|
|
const defaultPaletteLess = lessToJs(`${colorLess}${defaultLess}`, {
|
|
|
|
stripPrefix: true,
|
|
|
|
resolveVariables: false,
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = defaultPaletteLess;
|