SolidZORO / next-plugin-antd-less

🎩 Use Antd (Less) with Next.js v12, Zero Dependency on other Next-Plugins.
MIT License
345 stars 48 forks source link

What is lessVarsFilePath for? #24

Closed devuxer closed 3 years ago

devuxer commented 3 years ago

Can you provide a quick explanation of the lessVarsFilePath setting?

I get that modifyVars is for swapping in different values for Ant Design default less variables, but I'm a little confused by the additional lessVarsFilePath setting.

What variables should we be putting in variables.less?

How is this different than importing global styles into _app using require('./styles.less');?

SolidZORO commented 3 years ago

require('./styles.less') in _app can't overwrite antd default variables;


lessVarsFilePath and modifyVars for JS (It's actually for javascriptEnabled), if you will change antd default variables e.g. @primary-color, it can only be declared here.

setlessVarsFilePath JUST will automatically convert all variables to modifyVars.

BTW javascriptEnabled.

http://lesscss.org/usage/#less-options

Enable Inline JavaScript (Deprecated)
lessc --js  { javascriptEnabled: true }
False by default starting in v3.0.0. Enables evaluation of JavaScript inline in .less files. This created a security problem for some developers who didn't expect user input for style sheets to have executable code.

Replaced with the @plugin option.
devuxer commented 3 years ago

So I can either do modifyVars or lessVarsFilePath to override the default Ant Design less variables?

SolidZORO commented 3 years ago

you can.