Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE9上 bootstrap css 和 antd css同时引入导致样式失效问题 #1482

Closed
shlice opened this issue Apr 22, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@shlice
Copy link
Contributor

commented Apr 22, 2016

我在项目里同时使用了 bootstrap和 antd。
如下引用 css

import 'bootstrap/dist/css/bootstrap.css';
import 'antd/lib/index.css';
import './my.less';

使用 webpack打包。在 chrome、safari、firefox 和 IE10以上浏览器均正常。
但是在IE9浏览器上,只要同时存在 bootstrap css 和 antd css就会出现 antd css 加载不全,且后续的 css 定义无法生效的问题。
调整bootstrap css 和 antd css的加载顺序,antd css 也加载不全,但加载的样式有所区别,后续样式定义同样不生效。

请帮忙确认下该问题,谢谢。

Environment Information
  • "antd": "^0.12.13"
  • "bootstrap": "^3.3.6"
  • browser: IE9
@benjycui

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2016

antd bs 之类的 UI 库只能用其中一个,同时使用会有冲突的,因为 CSS 都是全局,这种冲突无法解决。

@shlice

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2016

能解释下为什么在 IE9会暴露出来呢,其他浏览器目前使用中未发现异常。

@benjycui

This comment has been minimized.

Copy link
Contributor

commented Apr 22, 2016

不是浏览器专家,自行研究吧 😅

@benjycui benjycui closed this Apr 22, 2016

@afc163

This comment has been minimized.

Copy link
Member

commented Apr 22, 2016

IE 会有 selector 数量限制和 css 文件大小限制。

http://stackoverflow.com/questions/9906794/internet-explorers-css-rules-limits

@justnull

This comment has been minimized.

Copy link

commented Aug 31, 2016

我找到了完美的解决方法。https://www.npmjs.com/package/css-split-webpack-plugin

@lock

This comment has been minimized.

Copy link

commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.