fix: Badge number style (#21235)

* fix css priority

* update snapshot

* update snapshot
This commit is contained in:
二货机器人 2020-02-05 13:52:26 +08:00 committed by GitHub
parent 74f01d8485
commit 52a1600a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 879 additions and 875 deletions

View File

@ -42,152 +42,152 @@ exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
style="transition:none;-ms-transform:translateY(-1100%);-webkit-transform:translateY(-1100%);transform:translateY(-1100%)"
>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class="current"
class="ant-scroll-number-only-unit current"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>

View File

@ -16,12 +16,16 @@ function getNumberArray(num: string | number | undefined | null) {
: [];
}
function renderNumberList(position: number) {
function renderNumberList(position: number, className: string) {
const childrenToReturn: React.ReactElement<any>[] = [];
for (let i = 0; i < 30; i++) {
const currentClassName = position === i ? 'current' : '';
childrenToReturn.push(
<p key={i.toString()} className={currentClassName}>
<p
key={i.toString()}
className={classNames(className, {
current: position === i,
})}
>
{i % 10}
</p>,
);
@ -137,7 +141,7 @@ class ScrollNumber extends React.Component<ScrollNumberProps, ScrollNumberState>
},
key: i,
},
renderNumberList(position),
renderNumberList(position, `${prefixCls}-only-unit`),
);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -190,7 +190,7 @@
display: inline-block;
height: @badge-height;
transition: all 0.3s @ease-in-out;
> p {
> p.@{number-prefix-cls}-only-unit {
height: @badge-height;
margin: 0;
}

View File

@ -334,152 +334,152 @@ exports[`ConfigProvider components Badge configProvider 1`] = `
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
>
<p
class=""
class="config-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
4
</p>
<p
class="current"
class="config-scroll-number-only-unit current"
>
5
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
9
</p>
@ -514,152 +514,152 @@ exports[`ConfigProvider components Badge normal 1`] = `
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class="current"
class="ant-scroll-number-only-unit current"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
@ -694,152 +694,152 @@ exports[`ConfigProvider components Badge prefixCls 1`] = `
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
>
<p
class=""
class="prefix-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
4
</p>
<p
class="current"
class="prefix-scroll-number-only-unit current"
>
5
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
9
</p>

View File

@ -36,152 +36,152 @@ exports[`renders ./components/radio/demo/badge.md correctly 1`] = `
style="transition:none;-ms-transform:translateY(-1100%);-webkit-transform:translateY(-1100%);transform:translateY(-1100%)"
>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class="current"
class="ant-scroll-number-only-unit current"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
@ -220,152 +220,152 @@ exports[`renders ./components/radio/demo/badge.md correctly 1`] = `
style="transition:none;-ms-transform:translateY(-1200%);-webkit-transform:translateY(-1200%);transform:translateY(-1200%)"
>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class="current"
class="ant-scroll-number-only-unit current"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>