Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

antd-theme-generator

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antd-theme-generator - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

yarn.lock

44

index.js

@@ -8,2 +8,3 @@ const fs = require("fs");

const hash = require("hash.js");
const NpmImportPlugin = require('less-plugin-npm-import');

@@ -148,3 +149,4 @@ let hashCache = "";

paths: paths,
javascriptEnabled: true
javascriptEnabled: true,
plugins: [new NpmImportPlugin({ prefix: '~' })]
});

@@ -217,2 +219,26 @@ }

function getCssModulesStyles(stylesDir, antdStylesDir) {
const styles = glob.sync(path.join(stylesDir, './**/*.less'));
return Promise.all(
styles.map(p =>
less
.render(fs.readFileSync(p).toString(), {
paths: [
stylesDir,
antdStylesDir,
],
filename: path.resolve(p),
javascriptEnabled: true,
plugins: [new NpmImportPlugin({ prefix: '~' })],
})
.catch(() => '\n')
)
)
.then(csss => csss.map(c => c.css).join('\n'))
.catch(err => {
console.log('Error', err);
return '';
});
}
/*

@@ -230,2 +256,3 @@ This is main function which call all other functions to generate color.less file which contins all color

outputFilePath,
cssModules = false,
themeVariables = ['@primary-color']

@@ -316,7 +343,12 @@ }) {

content = `${content}\n${colorsLess}`;
return render(content, lessPaths).then(({ css }) => [
css,
mappings,
colorsLess
]);
return render(content, lessPaths).then(({ css }) => {
return getCssModulesStyles(stylesDir, antdStylesDir).then(customCss => {
return [
`${customCss}\n${css}`,
mappings,
colorsLess
];
})
});
})

@@ -323,0 +355,0 @@ .then(([css, mappings, colorsLess]) => {

7

package.json
{
"name": "antd-theme-generator",
"version": "1.1.1",
"version": "1.1.2",
"description": "This a script to generate color specific styles less file and which you can use to change theme dynamically in browser",

@@ -12,4 +12,5 @@ "main": "index.js",

"less": "^2.7.2",
"less-bundle-promise": "1.0.6",
"postcss": "^6.0.21"
"less-bundle-promise": "1.0.7",
"postcss": "^6.0.21",
"less-plugin-npm-import": "^2.1.0"
},

@@ -16,0 +17,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc