Next.js: Built-In Less Support

Created on 2 Apr 2020  路  7Comments  路  Source: vercel/next.js

Feature request

It's great to see that Next.js 9.3 brings built-in Sass support, but since we are using customized Ant Design UI, we have no choice but to stick to Less.

I think if we can support built-in sass, would it be easier to support less as well?

Thanks!

Most helpful comment

Note that less is already supported through the next-less plugin and that antd could be used with that (there's examples for it) and that already covers that percentage.

I understand maybe less is not commonly used in NextJS and we have the next-less plugin to achieve that, but the only issue with the current way is that the plugin is very old and based on the next-css plugin, which uses [email protected], and it makes achieving less support with CSS Module based on whether file extension has .module. difficult.

All 7 comments

At this point in time we're not planning to add LESS support as it's being used by less than 5% of Next.js applications.

I would also love to see built-in support for LESS, especially to support Ant design theme customization out of the box. If available, the number 5% will definitely jump as Ant Design is quite popular.

Note that less is already supported through the next-less plugin and that antd could be used with that (there's examples for it) and that already covers that percentage.

Here's a plugin to load ant-design with LESS correctly
next-plugin-antd

@anupsarode I agree. many people will use antd, antd depends on less, so why doesn't the official support less?

If you use Next.js > 9.3, you can try next-plugin-antd-less Use Antd
(with Less) with Next.js, Zero Dependency on other Next-Plugins.

I agree. many people will use antd, antd depends on less, so why doesn't the official support less?

The fact that this issue has not received any upvotes through github reactions (馃憤) further confirms that less should not be built in (making the maintenance burden significantly bigger for a feature that is barely used).

Note that less is already supported through the next-less plugin and that antd could be used with that (there's examples for it) and that already covers that percentage.

I understand maybe less is not commonly used in NextJS and we have the next-less plugin to achieve that, but the only issue with the current way is that the plugin is very old and based on the next-css plugin, which uses [email protected], and it makes achieving less support with CSS Module based on whether file extension has .module. difficult.

Was this page helpful?
0 / 5 - 0 ratings