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

引入 antd.css 和 antd.less 效果不一致的问题 #2400

Closed
akecn opened this issue Jul 15, 2016 · 3 comments
Closed

引入 antd.css 和 antd.less 效果不一致的问题 #2400

akecn opened this issue Jul 15, 2016 · 3 comments

Comments

@akecn
Copy link

akecn commented Jul 15, 2016

本地环境

  • antd 版本: 1.6.3
  • 操作系统及其版本:osx 10.11.5
  • 浏览器及其版本: chrome 51.0.2704.106 (64-bit)

你做了什么?

不使用antd-init 等工具。

创建 use_css.lessuse_less.less,内容分别为

@import '~antd/dist/antd.css';

@import '~antd/dist/antd.less';

页面分别引入这两个文件,查看效果。

你期待的结果是:

样式定义应该是一致的。

实际上的结果:

部分样式的顺序不同。比如 Cascader 组件中的 Input 组件样式。

如果引入 use_css.less,则 .ant-cascader-input 类的定义会覆盖 ant-input 类的定义。
如果引入 use_less.less,则 ant-input 类的定义会覆盖 .ant-cascader-input 类的定义;并且存在重复定义的情况,所有的 antd 类 都定义了好多次。

可重现的在线演示

use antd.css

use antd.less

@afc163
Copy link
Member

afc163 commented Jul 15, 2016

fixed in a535238

@afc163 afc163 closed this as completed Jul 15, 2016
@akecn
Copy link
Author

akecn commented Jul 15, 2016

呃。。根本的原因似乎是less 顺序的问题,虽然不清楚为什么css文件的结果是正确的。只是直接这么改cascader组件的问题是不是会有遗漏呀~~ @afc163

@lock
Copy link

lock bot 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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants