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

not loaded less styles file on page not using antd #70

Closed ddanngg closed 2 years ago

ddanngg commented 2 years ago

Hi, here is my codesandbox https://codesandbox.io/s/nextjs-ant-less-egwo5?file=/pages/_app.js

The initial root page not load global.less file, I try to config same with your mkn repo but my initial Root page not load my override ant styles + css variable styles. global.less was loaded when I direct to the page /about using antd (Button), you can try with codesandbox link above.

reproduce step:

  1. default you in root / page
  2. click button go to ant page direct to /about (about page using ant button)
  3. then global.less styles I set will apply from now
  4. click back to normal page back to root /, style applied
  5. reload root page style disappear again

Sorry, my English isn't good

SolidZORO commented 2 years ago

hi, look like an antd global pollution problem.

no solution. all use antd or use UI lib will be triggers this problem. whether it's SPA or SSR.