Giter VIP home page Giter VIP logo

Comments (7)

SolidZORO avatar SolidZORO commented on July 28, 2024 1

😂 https://github.com/vercel/next.js/search?q=css+order&type=issues

from next-plugin-antd-less.

SolidZORO avatar SolidZORO commented on July 28, 2024

can you show an example repo?

from next-plugin-antd-less.

kseanjbz avatar kseanjbz commented on July 28, 2024

I was trying to reproduce it a while back with your mkn repo to ensure if it is on my end or not, so it is using a slightly older version of your mkn repo. I do apologize for absolutely butchering your code. I was trying to delete a lot of it as I was trying to figure out the cause of the issue.

Example Repo:
https://github.com/kseanjbz/mkn_bug_demo

steps to reproduce:

  1. yarn install
  2. yarn dev (sometimes i had to exit and run again)
  3. navigate to http://localhost:3000/about
  4. notice the button is not red
  5. In line 30 of MasterLayout.tsx, uncomment it
  6. refresh localhost page
  7. notice how both are now red

Same thing is happening in my app where seemingly random things like this was breaking my app. One was an import of a component which only contained divs and nothing else but it broke the styling. Thanks for looking at this SolidZORO!

from next-plugin-antd-less.

SolidZORO avatar SolidZORO commented on July 28, 2024

I tried to run your case and found that it worked fine, uncommented the Button and found that the .test did not take effect immediately, but after refreshing the page everything worked fine.

I think this is some disadvantage of SSR compared to CSR, the mechanism of code hot update is not the same. Anyway I think this is normal, or can you describe in more detail what is wrong there? Recording a video would be fine.

BTW, the project didn't run because of the missing @THEME--DARK variable, then I added a ~ to the front of vars, like this @THEME--DARK: ~'theme-dark'; and it worked.

from next-plugin-antd-less.

kseanjbz avatar kseanjbz commented on July 28, 2024

The problem is I always expected the button to be red and the .test to take effect, but on initial load it isn't unless the other button is loaded. Why would commenting out the button change anything? Very strange indeed.

Screen.Recording.2021-05-09.at.8.29.53.AM.mov

from next-plugin-antd-less.

SolidZORO avatar SolidZORO commented on July 28, 2024

ohhhh! It seems to be a css order issue with next.js, which is particularly bad on antd.

You can write an extra layer of button.text {} or use !important.

from next-plugin-antd-less.

kseanjbz avatar kseanjbz commented on July 28, 2024

Exactly. I'm trying to figure out why the css ordering can flip so randomly. Using button.text or !important isn't really a feasible solution for my app.

from next-plugin-antd-less.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.