those are called css modules - nextjs has built in support https://nextjs.org/docs/app/building-your-application/stylin...
And it's not hard to get them working in Webpack...if you're like me.. maintaining the same app for 10 years and see no reason to switch to the new hotness.