如何使Bootstrap 3和Ant Design 3一起生活 [英] How to make Bootstrap 3 and Ant Design 3 live together

查看:601
本文介绍了如何使Bootstrap 3和Ant Design 3一起生活的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个React应用程序(使用Create React App而不弹出它),我们决定使用Ant作为我们的基本组件库. 现在我们已经接近项目的结尾,我们发现该应用程序将作为"portlet"集成到公司门户(WebSphere)中,因此我们将从主页继承所有CSS文件.

We are working on a React application (using Create React App without ejecting it) and we decided to use Ant as our base component library. Now that we are near the end of the project, we discover that the application will be integrated into a corporate portal (WebSphere) as a "portlet", so we inherit all the CSS files from the main page.

两个框架似乎都有自己的 reset 样式,但是它们使用不同的值. 到目前为止,我还没有在Ant中找到可用于前缀所有Ant的CSS规则的LESS变量.

Both frameworks seem to have their own reset styles, but they use different values. So far, I have not been able to find a LESS variable in Ant that can be used for prefix all Ant's CSS rules.

有没有人试图让他们在一起生活?

Has anyone ever tried to make them live together?

我们不拥有父级开发,我们只能在React部分进行更改,因此只能进行与Ant相关的事情.

We don't own the parent development, we can only make change on the React part, so only things related to Ant.

推荐答案

我们终于有了一个特定的CSS补丁文件,并在需要时添加了规则.

We finally go with a specific CSS patch file, and we add rules when needed.

并不是很完美,但是没有一条建议的路径可以完成我们期望的工作.

Not really perfect, but none of the suggested path did the job we expected.

这篇关于如何使Bootstrap 3和Ant Design 3一起生活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆