1.8.0
Windows 10
Chrome 70.0.3538.102(正式版本) (64 位)
[email protected]
https://stackblitz.com/edit/ng-zorro-antd-start-z14eiy?file=src%2Fapp%2Fapp.component.html
<nz-form-item nzGutter="8">
<nz-form-control nzSpan="10">
<nz-form-text>Col 10 In Form</nz-form-text>
</nz-form-control>
</nz-form-item>
<nz-form-control> get correct style padding-left: 4px; padding-right: 4px, like [nz-col] in [nz-row].
<nz-form-control> has no style, but <nz-form-item> generated margin style.
Hi, I would like to look into this bug if that's okay, please?
@asincole 👏 Sure! Welcome to contribute. Feel free to open a pr.
Alright, great. I have forked already and will start working on it tonight. This is my first Contribution to an OSS, any tips or hints outside the ones in the CONTRIBUTING.md or general tips? @wendzhue
Hi, so I have taken a look at it, I discovered that the nz-form-control selector has no padding added, so I have added that, but then once nzSpan directive is added, the padding rule gets overwritten and then set to 0 which are the rules for nzSpan directive. So I added an extra rule to override it
.@{form-prefix-cls}-item-control-wrapper {
display: block;
width: 100%;
padding-right: 4px;
padding-left: 4px;
&[class^="@{ant-prefix}-col-"] { // adds the padding rules to overwrite the nzSpan directive rules
padding-right: 4px;
padding-left: 4px;
}
is repeating the rules optimal or is there a better way I can do it?
@asincole You can just create a pr and we would review your code there.
@wendzhue alright. I'll do it in a bit.. sorry about the delay. Thanks.
@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt
fixed in https://github.com/NG-ZORRO/ng-zorro-antd/pull/2493/files#diff-611562526e66dba4ffd92fb8fa6cdd54R126
Most helpful comment
Hi, so I have taken a look at it, I discovered that the nz-form-control selector has no padding added, so I have added that, but then once nzSpan directive is added, the padding rule gets overwritten and then set to 0 which are the rules for nzSpan directive. So I added an extra rule to override it
is repeating the rules optimal or is there a better way I can do it?