lightningcss set custom options #64580
Replies: 10 comments 1 reply
-
|
How has there been no answer to this? We can turn on Lightning but there's no option to configure? |
Beta Was this translation helpful? Give feedback.
-
|
Bumping this as well. PostCSS is the only bottleneck we have in our compilation times. We rely on it for stuff like custom media and mixins, now if we could configure LightningCSS we could build those plugins ourselves. |
Beta Was this translation helpful? Give feedback.
-
|
Crazy that this hasn't been answered. Really struggling with performance issues that have completely soured my relationship with NextJS. Turbopack seems to be faster but #64509 is a blocker. @timneutkens stated in the issue that it's been fixed with a configuration option but I can find zero information about how you configure Lightning CSS in both the NextJS and Turborepo docs. Please for the love of your paying Vercel customers start to triage and resolve these large NextJS issues that have been outstanding for months and sometimes years. Justifying the use of NextJS is getting harder by the day. |
Beta Was this translation helpful? Give feedback.
-
|
I support this discussion, my team needs to change the pattern of CSS modules after switching to Turbopack, there are no problems with this in Vite, and I would like it to be easy to configure in NextJS too. |
Beta Was this translation helpful? Give feedback.
-
|
bumping, any update here? our company needs the ability to specify the module hashnames |
Beta Was this translation helpful? Give feedback.
-
|
We cannot migrate from webpack to turbopack without being able to configure lightningcss, particularly to disable feature scoping for animations: https://lightningcss.dev/css-modules.html#turning-off-feature-scoping Is Next.js even in active development anymore? |
Beta Was this translation helpful? Give feedback.
-
|
Update for Next.js 16.2+ (March 2026): Custom LightningCSS configuration options are now available experimentally! This has been a long time coming. Next.js 16.2 — Experimental
|
| Version | LightningCSS Config Support |
|---|---|
| Next.js 13–15 | useLightningcss: true only — no custom options |
| Next.js 16.0–16.1 | Same as above |
| Next.js 16.2+ | lightningCssFeatures experimental option added |
Upgrade to 16.2+ and use experimental.lightningCssFeatures to get the configuration control this thread has been asking for.
Beta Was this translation helpful? Give feedback.
-
|
Lightningcss seems to support custom naming patterns, can we allow these: https://lightningcss.dev/css-modules.html#custom-naming-patterns |
Beta Was this translation helpful? Give feedback.
-
|
Small correction for the current state: Next.js exposes It only lets you force feature transpilation on/off: const nextConfig = {
experimental: {
useLightningcss: true,
lightningCssFeatures: {
include: ['light-dark'],
exclude: ['nesting'],
},
},
}So this does not cover things like CSS Modules custom naming patterns, disabling Lightning CSS module feature scoping, or custom transforms. If you need those specific Lightning CSS options today, there is no supported |
Beta Was this translation helpful? Give feedback.
-
|
I opened a PR that adds experimental support for configuring Lightning CSS CSS Modules options in Turbopack. It exposes: Custom CSS Modules naming patterns (pattern) This is intended to address the requests in this discussion for custom hash patterns and the ability to disable animation/keyframe scoping. PR: #95444 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I am want to add custom trasnforms and would like to know how to pass lightning css options when
useLightningcss: trueAdditional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions