{"action":"opened","number":3024,"pull_request":{"url":"https://api.github.com/repos/ant-design/ant-design/pulls/3024","id":84975424,"html_url":"https://github.com/ant-design/ant-design/pull/3024","diff_url":"https://github.com/ant-design/ant-design/pull/3024.diff","patch_url":"https://github.com/ant-design/ant-design/pull/3024.patch","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/3024","number":3024,"state":"open","locked":false,"title":"保证所有的tsx和less都正确使用prefix","user":{"login":"PinkyJie","id":551329,"avatar_url":"https://avatars.githubusercontent.com/u/551329?v=3","gravatar_id":"","url":"https://api.github.com/users/PinkyJie","html_url":"https://github.com/PinkyJie","followers_url":"https://api.github.com/users/PinkyJie/followers","following_url":"https://api.github.com/users/PinkyJie/following{/other_user}","gists_url":"https://api.github.com/users/PinkyJie/gists{/gist_id}","starred_url":"https://api.github.com/users/PinkyJie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinkyJie/subscriptions","organizations_url":"https://api.github.com/users/PinkyJie/orgs","repos_url":"https://api.github.com/users/PinkyJie/repos","events_url":"https://api.github.com/users/PinkyJie/events{/privacy}","received_events_url":"https://api.github.com/users/PinkyJie/received_events","type":"User","site_admin":false},"body":"目前自定义前缀的功能只能通过组件的`prefixCls`属性来定义，但有两个问题：\r\n1. 有些组件的实现里根本没有提供`prefixCls`或在定义`prefixCls`的情况下依然在代码里写死`ant-xxxx`的样式类名。\r\n2. 即便改写了`prefixCls`后相应组件的样式类名变了，但对应的css中的样式类名没办法定制。比如说\r\n```\r\n<Button prefixCls=\"a-btn\">a</Button>\r\n```\r\n这样生成的HTML里对应的样式类名变成了`a-btn`，但CSS里并没有生成相对应的`.a-btn`的样式。\r\n\r\n本PR的改动如下：\r\n1. 在`default.less`里定义一个变量`@ant-prefix`，所有的less文件都使用这个变量来决定样式类名。这样通过自定义主题的方式用户可以很方便的覆盖这个变量，实现css文件中的自定义前缀。\r\n2. 修正所有写死的情况，保证所有的tsx都能够正确的使用`prefixCls`。另外，有些组件可能依赖别的组件的样式类名，比如`Cascader`组件里有使用`Input`组件的类名，原先的实现是写死了`ant-input-lg`，这种情况我就给`Cascader`组件新增了一个`inputPrefixCls`的属性，以避免写死的情况。\r\n\r\n问题：\r\n这个PR改动的文件非常多，我将目前的antd版本build出来的css文件和我改动后build出来的css文件做了diff，两者是相同的，这保证了less相关的改动都是OK的。但tsx的相关改动我不知道如何能做一个放心的测试。我尝试在我自己的项目的`package.json`里使用git URL的方式依赖这个改后的版本，不能生效，貌似只能依赖npm上的版本。。。","created_at":"2016-09-13T02:17:58Z","updated_at":"2016-09-13T02:17:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ant-design/ant-design/pulls/3024/commits","review_comments_url":"https://api.github.com/repos/ant-design/ant-design/pulls/3024/comments","review_comment_url":"https://api.github.com/repos/ant-design/ant-design/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/3024/comments","statuses_url":"https://api.github.com/repos/ant-design/ant-design/statuses/221d8b22bd01288e4ba42a3951d9b8b08c7684b9","head":{"label":"PinkyJie:master","ref":"master","sha":"221d8b22bd01288e4ba42a3951d9b8b08c7684b9","user":{"login":"PinkyJie","id":551329,"avatar_url":"https://avatars.githubusercontent.com/u/551329?v=3","gravatar_id":"","url":"https://api.github.com/users/PinkyJie","html_url":"https://github.com/PinkyJie","followers_url":"https://api.github.com/users/PinkyJie/followers","following_url":"https://api.github.com/users/PinkyJie/following{/other_user}","gists_url":"https://api.github.com/users/PinkyJie/gists{/gist_id}","starred_url":"https://api.github.com/users/PinkyJie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinkyJie/subscriptions","organizations_url":"https://api.github.com/users/PinkyJie/orgs","repos_url":"https://api.github.com/users/PinkyJie/repos","events_url":"https://api.github.com/users/PinkyJie/events{/privacy}","received_events_url":"https://api.github.com/users/PinkyJie/received_events","type":"User","site_admin":false},"repo":{"id":67970256,"name":"ant-design","full_name":"PinkyJie/ant-design","owner":{"login":"PinkyJie","id":551329,"avatar_url":"https://avatars.githubusercontent.com/u/551329?v=3","gravatar_id":"","url":"https://api.github.com/users/PinkyJie","html_url":"https://github.com/PinkyJie","followers_url":"https://api.github.com/users/PinkyJie/followers","following_url":"https://api.github.com/users/PinkyJie/following{/other_user}","gists_url":"https://api.github.com/users/PinkyJie/gists{/gist_id}","starred_url":"https://api.github.com/users/PinkyJie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PinkyJie/subscriptions","organizations_url":"https://api.github.com/users/PinkyJie/orgs","repos_url":"https://api.github.com/users/PinkyJie/repos","events_url":"https://api.github.com/users/PinkyJie/events{/privacy}","received_events_url":"https://api.github.com/users/PinkyJie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PinkyJie/ant-design","description":":ant: One design language","fork":true,"url":"https://api.github.com/repos/PinkyJie/ant-design","forks_url":"https://api.github.com/repos/PinkyJie/ant-design/forks","keys_url":"https://api.github.com/repos/PinkyJie/ant-design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PinkyJie/ant-design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PinkyJie/ant-design/teams","hooks_url":"https://api.github.com/repos/PinkyJie/ant-design/hooks","issue_events_url":"https://api.github.com/repos/PinkyJie/ant-design/issues/events{/number}","events_url":"https://api.github.com/repos/PinkyJie/ant-design/events","assignees_url":"https://api.github.com/repos/PinkyJie/ant-design/assignees{/user}","branches_url":"https://api.github.com/repos/PinkyJie/ant-design/branches{/branch}","tags_url":"https://api.github.com/repos/PinkyJie/ant-design/tags","blobs_url":"https://api.github.com/repos/PinkyJie/ant-design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PinkyJie/ant-design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PinkyJie/ant-design/git/refs{/sha}","trees_url":"https://api.github.com/repos/PinkyJie/ant-design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PinkyJie/ant-design/statuses/{sha}","languages_url":"https://api.github.com/repos/PinkyJie/ant-design/languages","stargazers_url":"https://api.github.com/repos/PinkyJie/ant-design/stargazers","contributors_url":"https://api.github.com/repos/PinkyJie/ant-design/contributors","subscribers_url":"https://api.github.com/repos/PinkyJie/ant-design/subscribers","subscription_url":"https://api.github.com/repos/PinkyJie/ant-design/subscription","commits_url":"https://api.github.com/repos/PinkyJie/ant-design/commits{/sha}","git_commits_url":"https://api.github.com/repos/PinkyJie/ant-design/git/commits{/sha}","comments_url":"https://api.github.com/repos/PinkyJie/ant-design/comments{/number}","issue_comment_url":"https://api.github.com/repos/PinkyJie/ant-design/issues/comments{/number}","contents_url":"https://api.github.com/repos/PinkyJie/ant-design/contents/{+path}","compare_url":"https://api.github.com/repos/PinkyJie/ant-design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PinkyJie/ant-design/merges","archive_url":"https://api.github.com/repos/PinkyJie/ant-design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PinkyJie/ant-design/downloads","issues_url":"https://api.github.com/repos/PinkyJie/ant-design/issues{/number}","pulls_url":"https://api.github.com/repos/PinkyJie/ant-design/pulls{/number}","milestones_url":"https://api.github.com/repos/PinkyJie/ant-design/milestones{/number}","notifications_url":"https://api.github.com/repos/PinkyJie/ant-design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PinkyJie/ant-design/labels{/name}","releases_url":"https://api.github.com/repos/PinkyJie/ant-design/releases{/id}","deployments_url":"https://api.github.com/repos/PinkyJie/ant-design/deployments","created_at":"2016-09-12T02:53:54Z","updated_at":"2016-09-12T02:53:56Z","pushed_at":"2016-09-12T12:48:53Z","git_url":"git://github.com/PinkyJie/ant-design.git","ssh_url":"git@github.com:PinkyJie/ant-design.git","clone_url":"https://github.com/PinkyJie/ant-design.git","svn_url":"https://github.com/PinkyJie/ant-design","homepage":"http://ant.design","size":85779,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ant-design:master","ref":"master","sha":"7156083c7a3261f403c0f8ed542501c4af78989e","user":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars.githubusercontent.com/u/12101536?v=3","gravatar_id":"","url":"https://api.github.com/users/ant-design","html_url":"https://github.com/ant-design","followers_url":"https://api.github.com/users/ant-design/followers","following_url":"https://api.github.com/users/ant-design/following{/other_user}","gists_url":"https://api.github.com/users/ant-design/gists{/gist_id}","starred_url":"https://api.github.com/users/ant-design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ant-design/subscriptions","organizations_url":"https://api.github.com/users/ant-design/orgs","repos_url":"https://api.github.com/users/ant-design/repos","events_url":"https://api.github.com/users/ant-design/events{/privacy}","received_events_url":"https://api.github.com/users/ant-design/received_events","type":"Organization","site_admin":false},"repo":{"id":34526884,"name":"ant-design","full_name":"ant-design/ant-design","owner":{"login":"ant-design","id":12101536,"avatar_url":"https://avatars.githubusercontent.com/u/12101536?v=3","gravatar_id":"","url":"https://api.github.com/users/ant-design","html_url":"https://github.com/ant-design","followers_url":"https://api.github.com/users/ant-design/followers","following_url":"https://api.github.com/users/ant-design/following{/other_user}","gists_url":"https://api.github.com/users/ant-design/gists{/gist_id}","starred_url":"https://api.github.com/users/ant-design/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ant-design/subscriptions","organizations_url":"https://api.github.com/users/ant-design/orgs","repos_url":"https://api.github.com/users/ant-design/repos","events_url":"https://api.github.com/users/ant-design/events{/privacy}","received_events_url":"https://api.github.com/users/ant-design/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ant-design/ant-design","description":":ant: One design language","fork":false,"url":"https://api.github.com/repos/ant-design/ant-design","forks_url":"https://api.github.com/repos/ant-design/ant-design/forks","keys_url":"https://api.github.com/repos/ant-design/ant-design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ant-design/ant-design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ant-design/ant-design/teams","hooks_url":"https://api.github.com/repos/ant-design/ant-design/hooks","issue_events_url":"https://api.github.com/repos/ant-design/ant-design/issues/events{/number}","events_url":"https://api.github.com/repos/ant-design/ant-design/events","assignees_url":"https://api.github.com/repos/ant-design/ant-design/assignees{/user}","branches_url":"https://api.github.com/repos/ant-design/ant-design/branches{/branch}","tags_url":"https://api.github.com/repos/ant-design/ant-design/tags","blobs_url":"https://api.github.com/repos/ant-design/ant-design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ant-design/ant-design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ant-design/ant-design/git/refs{/sha}","trees_url":"https://api.github.com/repos/ant-design/ant-design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ant-design/ant-design/statuses/{sha}","languages_url":"https://api.github.com/repos/ant-design/ant-design/languages","stargazers_url":"https://api.github.com/repos/ant-design/ant-design/stargazers","contributors_url":"https://api.github.com/repos/ant-design/ant-design/contributors","subscribers_url":"https://api.github.com/repos/ant-design/ant-design/subscribers","subscription_url":"https://api.github.com/repos/ant-design/ant-design/subscription","commits_url":"https://api.github.com/repos/ant-design/ant-design/commits{/sha}","git_commits_url":"https://api.github.com/repos/ant-design/ant-design/git/commits{/sha}","comments_url":"https://api.github.com/repos/ant-design/ant-design/comments{/number}","issue_comment_url":"https://api.github.com/repos/ant-design/ant-design/issues/comments{/number}","contents_url":"https://api.github.com/repos/ant-design/ant-design/contents/{+path}","compare_url":"https://api.github.com/repos/ant-design/ant-design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ant-design/ant-design/merges","archive_url":"https://api.github.com/repos/ant-design/ant-design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ant-design/ant-design/downloads","issues_url":"https://api.github.com/repos/ant-design/ant-design/issues{/number}","pulls_url":"https://api.github.com/repos/ant-design/ant-design/pulls{/number}","milestones_url":"https://api.github.com/repos/ant-design/ant-design/milestones{/number}","notifications_url":"https://api.github.com/repos/ant-design/ant-design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ant-design/ant-design/labels{/name}","releases_url":"https://api.github.com/repos/ant-design/ant-design/releases{/id}","deployments_url":"https://api.github.com/repos/ant-design/ant-design/deployments","created_at":"2015-04-24T15:37:24Z","updated_at":"2016-09-13T02:06:37Z","pushed_at":"2016-09-12T10:58:33Z","git_url":"git://github.com/ant-design/ant-design.git","ssh_url":"git@github.com:ant-design/ant-design.git","clone_url":"https://github.com/ant-design/ant-design.git","svn_url":"https://github.com/ant-design/ant-design","homepage":"http://ant.design","size":90784,"stargazers_count":5537,"watchers_count":5537,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1036,"mirror_url":null,"open_issues_count":72,"forks":1036,"open_issues":72,"watchers":5537,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ant-design/ant-design/pulls/3024"},"html":{"href":"https://github.com/ant-design/ant-design/pull/3024"},"issue":{"href":"https://api.github.com/repos/ant-design/ant-design/issues/3024"},"comments":{"href":"https://api.github.com/repos/ant-design/ant-design/issues/3024/comments"},"review_comments":{"href":"https://api.github.com/repos/ant-design/ant-design/pulls/3024/comments"},"review_comment":{"href":"https://api.github.com/repos/ant-design/ant-design/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ant-design/ant-design/pulls/3024/commits"},"statuses":{"href":"https://api.github.com/repos/ant-design/ant-design/statuses/221d8b22bd01288e4ba42a3951d9b8b08c7684b9"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":395,"deletions":335,"changed_files":75}}
{"actor":{"display_login":"PinkyJie"}}