Comments (7)
😂 https://github.com/vercel/next.js/search?q=css+order&type=issues
from next-plugin-antd-less.
can you show an example repo?
from next-plugin-antd-less.
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:
- yarn install
- yarn dev (sometimes i had to exit and run again)
- navigate to http://localhost:3000/about
- notice the button is not red
- In line 30 of MasterLayout.tsx, uncomment it
- refresh localhost page
- 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.
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.
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.
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.
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)
- lessVarsFilePath not works HOT 5
- Support ant-mobile HOT 3
- 影响了next.js自定义配置的webpack HOT 4
- style is broken on build but works on dev env HOT 8
- Do you that work with SWC compiler? HOT 1
- Warning: invalid next.config.js options detected HOT 11
- Invalid next.config.js options detected HOT 1
- Simple Example with NextJS standard stuff HOT 1
- cannot use `import` to import `.less` files,must use `require`? HOT 1
- next-plugin-antd-less not support next13.x HOT 1
- nextjs 13 antd 5 会导致 cssinjs 无法 ssr HOT 4
- Antd 4 custom theme config with nextjs after .less CSS files appended multiple times on DOM. HOT 5
- next-plugin-antd-less可以使用thread-loader加快构建吗
- update packages
- README.md incorrectly lists SWC support HOT 2
- Use antd build resource error in [email protected]? HOT 4
- Error with <Image /> component Antd HOT 1
- Module not found: Can't resolve './data:image/svg+xml; HOT 1
- SWC replacing Babel HOT 6
- Error evaluating function `ceil`: argument must be a number HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-plugin-antd-less.