Skip to content

Commit a403d4a

Browse files
committed
chore: test
1 parent 1e1be7c commit a403d4a

File tree

4 files changed

+500
-13
lines changed

4 files changed

+500
-13
lines changed

src/badge/_example/style/index.less

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,66 @@
1414
.block {
1515
padding: 16px 16px 24px;
1616
}
17+
18+
// TODO: 样式调试。待设计走查需提交到子仓库
19+
20+
@badge-color: var(--td-error-color);
21+
22+
.t-badge {
23+
&--ribbon,
24+
&--ribbon-right {
25+
background: linear-gradient(45deg, transparent 50%, @badge-color 50%, @badge-color 85%, transparent 85%);
26+
}
27+
28+
&--ribbon,
29+
&--ribbon-right,
30+
&--triangle-right {
31+
right: 0;
32+
33+
.t-badge__count {
34+
transform: rotate(45deg) translateY(calc(-1 * var(--td-line-height-mark-extraSmall, 16px) / 2 + .5px) );
35+
}
36+
}
37+
38+
&--ribbon-left {
39+
background: linear-gradient(-45deg, transparent 50%, @badge-color 50%, @badge-color 85%, transparent 85%);
40+
}
41+
42+
&--triangle-left {
43+
background: linear-gradient(-45deg, transparent 50%, @badge-color 50%);
44+
}
45+
46+
&--ribbon-left,
47+
&--triangle-left {
48+
left: 0;
49+
50+
.t-badge__count {
51+
transform: rotate(-45deg) translateY(calc(-1 * var(--td-line-height-mark-extraSmall, 16px) / 2 + .5px));
52+
}
53+
}
54+
55+
&--large&--ribbon,
56+
&--large&--ribbon-right,
57+
&--large&--ribbon-left,
58+
&--large&--triangle-right,
59+
&--large&--triangle-left {
60+
padding: 0;
61+
}
62+
63+
&--large&--ribbon,
64+
&--large&--ribbon-right,
65+
&--large&--triangle-right {
66+
67+
.t-badge__count {
68+
transform: rotate(45deg) translateY(calc(-1 * var(--td-line-height-mark-small, 20px) / 2 + 1.5px));
69+
}
70+
}
71+
72+
&--large&--ribbon-left,
73+
&--large&--triangle-left {
74+
75+
.t-badge__count {
76+
transform: rotate(-45deg) translateY(calc(-1 * var(--td-line-height-mark-small, 20px) / 2 + 1.5px));
77+
}
78+
}
79+
}

src/badge/_example/theme.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ export default function ThemeBadge() {
2929
<div className="summary" style={{ marginBottom: '16px' }}>
3030
角标
3131
</div>
32+
{/* TODO: 待设计走查完需要移除 */}
3233
<Cell title="单行标题" note={<Badge count="NEW" offset={[0, 0]} shape="ribbon" />}></Cell>
34+
<Cell title="单行标题" note={<Badge size="large" count="NEW" offset={[0, 0]} shape="ribbon" />}></Cell>
35+
<Cell title="单行标题" note={<Badge count="NEW" offset={[0, 0]} shape="ribbon-left" />}></Cell>
36+
<Cell title="单行标题" note={<Badge size="large" count="NEW" offset={[0, 0]} shape="ribbon-left" />}></Cell>
3337

34-
<div className="summary" style={{ marginBottom: '16px' }}>
35-
三角角标
36-
</div>
3738
<Cell title="单行标题" note={<Badge count="NEW" offset={[0, 0]} shape="triangle-right" />}></Cell>
39+
<Cell title="单行标题" note={<Badge count="NEW" size="large" offset={[0, 0]} shape="triangle-right" />}></Cell>
40+
<Cell title="单行标题" note={<Badge count="NEW" offset={[0, 0]} shape="triangle-left" />}></Cell>
41+
<Cell title="单行标题" note={<Badge count="NEW" size="large" offset={[0, 0]} shape="triangle-left" />}></Cell>
3842
</>
3943
);
4044
}

0 commit comments

Comments
 (0)