如何让 Bootstrap 3 和 Ant Design 3 共存 [英] How to make Bootstrap 3 and Ant Design 3 live together

查看:98
本文介绍了如何让 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 中找到一个 LESS 变量可以用于前缀所有 Ant 的 CSS 规则.

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天全站免登陆