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

官网列出了很多颜色配置的方案,但是我如何在项目中进行修改? #193

Closed
Tinker404 opened this issue Aug 26, 2015 · 15 comments

Comments

@Tinker404
Copy link

antd文件里只有个index.css文件,要修改如此大量的色彩很复杂,是否有less或者其他的文件?

@afc163
Copy link
Member

afc163 commented Aug 26, 2015

antd 的模板采用全局主色调变量的方式进行扩展,自定义可以参考以下的步骤:

git clone git@github.com:ant-design/ant-design.git
cd ant-design
npm install

修改 https://github.com/ant-design/ant-design/blob/master/style/themes/default/custom.less 里的主色调 @primary-color

然后在根目录运行:

npm run release

会在 dist 下打包出包含修改配色方案的新的样式文件。

@Tinker404
Copy link
Author

Good,npm下的没less,原来在这,已解决

@SSebo
Copy link

SSebo commented Nov 6, 2015

想请教一下,能否在自己的项目中直接覆盖@primary-color变量的方式来修改呢?
这样修改可以和项目在git中保持一致

@afc163
Copy link
Member

afc163 commented Nov 6, 2015

try 0.10.x and antd-bin@0.9.x.

In your project's package.json:

  "theme": {
    "primary-color": "#f60"
  },

@afc163
Copy link
Member

afc163 commented Nov 6, 2015

#384

@SSebo
Copy link

SSebo commented Nov 6, 2015

非常感谢!我从历史的issue里也找到了,准备来关闭问题,没想到回复这么快,antdesign是个好轮子

@afc163
Copy link
Member

afc163 commented Nov 6, 2015

感谢支持,特别欢迎贡献代码!

@xuxuepu
Copy link

xuxuepu commented Jul 29, 2016

@afc163
1、修改style: true后;
2、删除以下webpack配置代码,antd组件的样式正常,但自己写的less样式不正常显示;
3、若留下以下的代码,antd组件的样式不正常,自己写的less样式正常显示。

webpackConfig.module.loaders.forEach(function(loader, index) {
    if (typeof loader.test === 'function' && loader.test.toString().indexOf('\\.less$') > -1 ) {
      loader.test = /\.dont\.exist\.file/;
    }
    if (loader.test.toString() === '/\\.module\\.less$/' ) {
      loader.test = /\.less$/;
    }
  });

@afc163
Copy link
Member

afc163 commented Jul 29, 2016

@zjyfantasy
Copy link

@xuxuepu 问你一下webpackConfig.module.loaders.forEach里webpackConfig怎么引入的,是安装的组件吗

@xuxuepu
Copy link

xuxuepu commented Jan 13, 2017

@zjyfantasy@sorrycc 大神的dva-cli [https://github.com/dvajs/dva-cli]

@wangguozheng666
Copy link

我想让标签浮动,添加类名设置了根本不起作用,好无语呀,是不是这个框架跟boothstrap差不多呢,有自己内部的可供类名可以设置样式呢,还是……?该怎么样去修改呢

@WSYProject
Copy link

请问一下,怎么清除antd的input框聚焦后出现的阴影

@suwu150
Copy link

suwu150 commented May 28, 2018

请问,react-native中使用ant-design-mobile的时候,怎么对样式进行覆盖,比如覆盖 tabs组件的高度
hight

@xcc1995
Copy link

xcc1995 commented Jul 8, 2018

怎么兼容自己写的样式啊!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants