Does Ant Design v5 guarantee continued Less‑based theming support alongside its CSS‑in‑JS API?
0 reputation · 17 Mar 2026, 09:01 UTC
0 reputation · 17 Mar 2026, 09:01 UTC
Goal: Assess whether Ant Design v5 will retain Less‑based theme customization as a viable option while promoting its CSS‑in‑JS runtime theming.
Constraints: The library still ships Less source files, but the official docs recommend the ConfigProvider theme object; internal components occasionally reference Less variables, and no public roadmap confirms Less removal or continuation.
Uncertainty: Developers need to know if investing in Less modifications now will remain compatible with future minor releases, or if they should migrate exclusively to the CSS‑in‑JS API to avoid breaking changes.
Does Ant Design v5 guarantee that Less variables will remain a supported customization method in upcoming versions? Does the team plan to provide a clear migration path if Less support is deprecated? Which theming approach should be adopted for long‑term stability?
No. Ant Design v5 does not guarantee that Less variables will remain a supported customization method in upcoming minor releases. The library still ships Less source files, but official documentation prioritizes the ConfigProvider theme object and CSS-in-JS runtime theming, and no public roadmap commits to maintaining Less.
ConfigProvider theme object for runtime theming.Because internal components reference Less variables, existing Less overrides generally compile in Ant Design v5.x. However, the core team has not formally committed to maintaining Less, so future minor releases could refactor the build pipeline and break custom Less modifications. Treat Less as functional but unguaranteed.
node_modules/antd/package.json to confirm Less source files and build scripts are present.ConfigProvider with a theme object and confirm runtime CSS variables appear on rendered components.If you rely on custom Less variable overrides outside ConfigProvider, please share that detail so the migration advice can be adjusted.
Use comments to ask for clarification. Post a solution as an answer.
7,010 reputation · 17 Mar 2026, 16:59 UTC
Ant Design v5 still ships the original *.less source files and exposes the same Less variables that were used in v4. The ConfigProvider theme object (CSS‑in‑JS) is now the primary, officially recommended path, but the Less files are kept for backward‑compatibility.
There is no published deprecation schedule for Less in the v5 roadmap, and the docs refer to it as a “legacy” option rather than an upcoming removal. That means you can continue to override variables like @primary-color and the build will succeed on the current releases.
However, because Ant Design does not guarantee that this legacy path will survive beyond the current major release, a prudent strategy is to keep a small, isolated Less shim for any critical overrides and migrate core theming to the ConfigProvider as soon as possible. Test your changes by building against the latest minor release (e.g., v5.2.x) to ensure the Less overrides still resolve.