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

同时引入date-picker与time-picker时,样式有冲突 #3307

Closed
zation opened this issue Oct 5, 2016 · 2 comments
Closed

同时引入date-picker与time-picker时,样式有冲突 #3307

zation opened this issue Oct 5, 2016 · 2 comments

Comments

@zation
Copy link
Contributor

zation commented Oct 5, 2016

发生问题的环境是:

  • antd 版本: 2.0.1
  • less 版本: 2.7.1
  • less-loader 版本: 2.2.3
  • 操作系统及其版本: Mac OS

您做了什么?

引入了所有ant的less文件

@import "~antd/lib/style/themes/default.less";
@import "~antd/lib/style/core/index.less";
@import "~antd/lib/style/components.less";

您期待的结果是:

当使用DatePicker的时间选择功能时,样式显示正常

实际上的结果是:

时间选择功能没有样式,完全没有。

问题产生的可能原因:

我看了一下代码,@timepicker-prefix-cls这个变量在两个地方有声明:date-picker/style/index.less以及time-picker/style/index.less,我现在输出的css里面,两个地方都输出了.ant-time-picker。当我把time-picker/style/index.less里面的变量名换个名字并且把使用的地方也相应改了以后(@timepicker-prefix-cls => @timepicker-prefix-class),就是让这两个地方的变量名不同,我发现date picker的时间选择功能的样式就有了,显示也正常了。

不太清楚为什么这两个地方的变量会冲突,我用的应该是最新的 less 和 less-loader了。

@afc163
Copy link
Member

afc163 commented Oct 7, 2016

感谢反馈,fixed in #3312

afc163 added a commit that referenced this issue Oct 7, 2016
@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