简体   繁体   English

在 npm run build 后反应网站应用不同的 css

[英]React Website applying different css after npm run build

I am creating a production build of my website with npm run build and using netlify to host it.我正在使用npm run build创建我的网站的生产版本并使用 netlify 来托管它。 After creating the production build the look of the website has changed dramatically and I can't understand why.创建生产版本后,网站的外观发生了巨大变化,我不明白为什么。
Before发展 View on codesandbox在代码和框上查看
After
Production生产

Several other aspects are different too on almost every page.几乎每个页面上的其他几个方面也不同。 I've had this issue before when I found that there were multiple parts of my Css that were changing the same Html tag, but I have not seen that in this code.我之前遇到过这个问题,当我发现我的 Css 的多个部分正在更改相同的 Html 标签时,但我没有在这段代码中看到这一点。
github repo Any advice you have will be greatly appreciated. github repo您的任何建议将不胜感激。

I figured out my mistake.我想通了我的错误。 Don't mix bootstrap, react-bootstrap, and custom css into a frankenstien's monster like I did.不要像我一样将 bootstrap、react-bootstrap 和自定义 css 混合到一个科学怪人的怪物中。 There's a reason for my SOF name.我的 SOF 名字是有原因的。
If anyone else has this problem in the future, simplify your css, and you might have to redo the whole layout.如果将来有人遇到此问题,请简化您的 css,您可能需要重做整个布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM