Skip to content

Commit a679980

Browse files
refactor(popconfirm): [popconfirm] refactor theme vars (#2282)
* refactor(popconfirm): [popconfirm] refactor theme vars * refactor(popconfirm): [popconfirm] refactor theme vars
1 parent ade7165 commit a679980

File tree

2 files changed

+43
-41
lines changed

2 files changed

+43
-41
lines changed

packages/theme/src/popconfirm/index.less

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@popconfirm-prefix-cls: ~'@{css-prefix}popconfirm';
1818

1919
.@{popconfirm-prefix-cls} {
20-
.component-css-vars-popconfirm();
20+
.inject-Popconfirm-vars();
2121

2222
display: inline-block;
2323

@@ -27,49 +27,49 @@
2727
}
2828

2929
.@{popconfirm-prefix-cls}-popover {
30-
.component-css-vars-popconfirm();
30+
.inject-Popconfirm-vars();
3131

3232
min-width: 168px;
3333
max-width: 90vw;
3434

3535
&__container {
36-
padding: var(--ti-popconfirm-popover-container-padding-vertical) 0;
37-
font-size: var(--ti-popconfirm-popover-footer-font-size);
38-
color: var(--ti-popconfirm-popover-footer-font-color);
36+
padding: var(--tv-Popconfirm-popover-container-padding-vertical) 0;
37+
font-size: var(--tv-Popconfirm-popover-footer-font-size);
38+
color: var(--tv-Popconfirm-popover-footer-font-color);
3939
}
4040

4141
&__header {
4242
display: flex;
4343
align-items: center;
44-
margin-bottom: var(--ti-popconfirm-popover-margin-bottom);
44+
margin-bottom: var(--tv-Popconfirm-popover-margin-bottom);
4545
}
4646

4747
&__icon {
48-
height: var(--ti-popconfirm-popover-icon-width);
49-
width: var(--ti-popconfirm-popover-icon-width);
50-
margin-right: var(--ti-popconfirm-popover-icon-margin-right);
51-
margin-bottom: var(--ti-popconfirm-popover-icon-margin-bottom);
48+
height: 20px;
49+
width: 20px;
50+
margin-right: var(--tv-Popconfirm-popover-icon-margin-right);
51+
margin-bottom: var(--tv-Popconfirm-popover-icon-margin-bottom);
5252
}
5353

5454
&__title {
55-
font-size: var(--ti-popconfirm-popover-title-font-size);
56-
font-weight: var(--ti-popconfirm-popover-title-font-weight);
57-
line-height: var(--ti-popconfirm-popover-title-line-height);
55+
font-size: var(--tv-Popconfirm-popover-title-font-size);
56+
font-weight: var(--tv-Popconfirm-popover-title-font-weight);
57+
line-height: var(--tv-Popconfirm-popover-title-line-height);
5858
}
5959

6060
&__content {
61-
color: var(--ti-popconfirm-popover-text-color);
62-
line-height: var(--ti-popconfirm-popover-content-line-height);
61+
color: var(--tv-Popconfirm-popover-text-color);
62+
line-height: var(--tv-Popconfirm-popover-content-line-height);
6363
}
6464

6565
&__footer {
6666
display: flex;
67-
justify-content: var(--ti-popconfirm-popover-footer-justify-content);
68-
margin-top: var(--ti-popconfirm-popover-footer-margin-top);
67+
justify-content: right;
68+
margin-top: var(--tv-Popconfirm-popover-footer-margin-top);
6969
}
7070

7171
&__confirm-button {
72-
margin-left: 8px;
72+
margin-left: var(--tv-Popconfirm-popover-confirm-button-margin-left);
7373
width: 72px;
7474
}
7575

@@ -78,18 +78,18 @@
7878
}
7979

8080
&--info {
81-
fill: #1476FF;
81+
fill: var(--tv-Popconfirm-icon-info-fill);
8282
}
8383

8484
&--error {
85-
fill: #F23030;
85+
fill: var(--tv-Popconfirm-icon-error-fill);
8686
}
8787

8888
&--warning {
89-
fill: #FF8800;
89+
fill: var(--tv-Popconfirm-icon-warning-fill);
9090
}
9191

9292
&--success {
93-
fill: #5CB300;
93+
fill: var(--tv-Popconfirm-icon-success-fill);
9494
}
9595
}

packages/theme/src/popconfirm/vars.less

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,32 @@
1010
*
1111
*/
1212

13-
.component-css-vars-popconfirm() {
13+
.inject-Popconfirm-vars() {
1414
// 提示弹窗title字体行高
15-
--ti-popconfirm-popover-title-line-height:var(--ti-common-line-height-2, 24px);
15+
--tv-Popconfirm-popover-title-line-height: var(--tv-line-height-number);
1616
// 提示弹窗content字体行高
17-
--ti-popconfirm-popover-content-line-height: var(--ti-common-line-height-1, 22px);
18-
// 底部按钮flex排列方式
19-
--ti-popconfirm-popover-footer-justify-content: right;
17+
--tv-Popconfirm-popover-content-line-height: var(--tv-line-height-number);
2018
// 提示弹窗字体大小
21-
--ti-popconfirm-popover-footer-font-size: var(--ti-common-font-size-base, 14px);
19+
--tv-Popconfirm-popover-footer-font-size: var(--tv-font-size-md);
2220
// 提示弹窗字体颜色
23-
--ti-popconfirm-popover-footer-font-color: #191919;
21+
--tv-Popconfirm-popover-footer-font-color: var(--tv-color-text);
2422
// 提示弹窗容器垂直内边距
25-
--ti-popconfirm-popover-container-padding-vertical: var(--ti-common-space-base, 4px);
26-
// 提示弹窗图标大小
27-
--ti-popconfirm-popover-icon-width: var(--ti-common-size-5x, 20px);
28-
--ti-popconfirm-popover-icon-margin-bottom: 2px;
29-
// 提示弹窗图标上侧外边距
30-
--ti-popconfirm-popover-icon-margin-right: var(--ti-common-space-base, 4px);
23+
--tv-Popconfirm-popover-container-padding-vertical: var(--tv-space-base);
24+
// 提示弹窗图标外边距
25+
--tv-Popconfirm-popover-icon-margin-bottom: var(--tv-space-xs);
26+
--tv-Popconfirm-popover-icon-margin-right: var(--tv-space-base);
3127
// 提示弹窗底部按钮容器上侧外边距
32-
--ti-popconfirm-popover-footer-margin-top: var(--ti-common-space-4x, 16px);
33-
// 标题字重、大小
34-
--ti-popconfirm-popover-title-font-size: var(--ti-common-font-size-2, 16px);
35-
--ti-popconfirm-popover-title-font-weight: var(--ti-common-font-weight-bold, 600);
36-
--ti-popconfirm-popover-text-color: #191919;
28+
--tv-Popconfirm-popover-footer-margin-top: var(--tv-space-xl);
29+
// 标题字重、大小、颜色
30+
--tv-Popconfirm-popover-title-font-size: var(--tv-icon-size);
31+
--tv-Popconfirm-popover-title-font-weight: var(--tv-font-weight-bold);
32+
--tv-Popconfirm-popover-text-color: var(--tv-color-text);
3733
// 标题距离内容下边距
38-
--ti-popconfirm-popover-margin-bottom: var(--ti-common-space-2x, 8px);
34+
--tv-Popconfirm-popover-margin-bottom: var(--tv-space-md);
35+
--tv-Popconfirm-popover-confirm-button-margin-left: var(--tv-space-md);
36+
// 图标色
37+
--tv-Popconfirm-icon-info-fill: var(--tv-color-info-icon);
38+
--tv-Popconfirm-icon-error-fill: var(--tv-color-error-icon);
39+
--tv-Popconfirm-icon-warning-fill: var(--tv-color-warning-icon);
40+
--tv-Popconfirm-icon-success-fill: var(--tv-color-success-icon);
3941
}

0 commit comments

Comments
 (0)