Skip to content

Commit 39f3c9f

Browse files
committed
style: 更新等比适配组件样式
1 parent 04a3afa commit 39f3c9f

12 files changed

Lines changed: 53 additions & 49 deletions

File tree

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
export default definePageConfig({
22
navigationBarTitleText: '首页',
3-
// App设计规范适配版本
4-
// designAppVersion: 16
53
})

src/packages/menu/menu.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
}
4343

4444
&-icon {
45+
width: scale-icon-px(12px);
46+
height: scale-icon-px(12px);
4547
flex-shrink: 0;
4648
transition: all 0.2s linear;
4749
}

src/packages/menu/menu.taro.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,9 @@ export const Menu: FunctionComponent<Partial<TaroMenuProps>> & {
137137
if (titleIcon) return titleIcon
138138
if (icon) return icon
139139
return direction === 'up' ? (
140-
<ArrowUp
141-
className="nut-menu-title-icon"
142-
width="12px"
143-
height="12px"
144-
/>
140+
<ArrowUp className="nut-menu-title-icon" />
145141
) : (
146-
<ArrowDown
147-
className="nut-menu-title-icon"
148-
width="12px"
149-
height="12px"
150-
/>
142+
<ArrowDown className="nut-menu-title-icon" />
151143
)
152144
}
153145
return (

src/packages/menu/menu.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,9 @@ export const Menu: FunctionComponent<Partial<WebMenuProps>> & {
137137
if (titleIcon) return titleIcon
138138
if (icon) return icon
139139
return direction === 'up' ? (
140-
<ArrowUp
141-
className="nut-menu-title-icon"
142-
width="12px"
143-
height="12px"
144-
/>
140+
<ArrowUp className="nut-menu-title-icon" />
145141
) : (
146-
<ArrowDown
147-
className="nut-menu-title-icon"
148-
width="12px"
149-
height="12px"
150-
/>
142+
<ArrowDown className="nut-menu-title-icon" />
151143
)
152144
}
153145
return (

src/packages/menuitem/menuitem.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
color: $menu-item-active-color;
2929
}
3030

31+
&-icon {
32+
display: flex;
33+
align-items: center;
34+
}
35+
3136
.nut-icon {
3237
/* #ifdef dynamic*/
3338
display: flex;

src/packages/numberkeyboard/numberkeyboard.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
@import '../popup/popup.scss';
22

33
.nut-numberkeyboard {
4+
&-close-icon {
5+
width: scale-icon-px(18px);
6+
height: scale-icon-px(18px);
7+
}
8+
49
width: 100%;
510
padding: $numberkeyboard-padding;
611
user-select: none;

src/packages/numberkeyboard/numberkeyboard.taro.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const NumberKeyboard: FunctionComponent<
115115
case 'delete':
116116
return <DeleteIcon />
117117
case 'close':
118-
return <ArrowDown size={18} />
118+
return <ArrowDown className={`${classPrefix}-close-icon`} />
119119
case 'confirm':
120120
return <>{confirmText || locale.done}</>
121121
default:

src/packages/numberkeyboard/numberkeyboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const NumberKeyboard: FunctionComponent<
118118
case 'delete':
119119
return <DeleteIcon />
120120
case 'close':
121-
return <ArrowDown width={18} height={18} />
121+
return <ArrowDown className={`${classPrefix}-close-icon`} />
122122
case 'confirm':
123123
return <>{confirmText || locale.done}</>
124124
default:

src/packages/quickenter/quickenter.scss

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* 限制弹层最大高度,包含安全区 */
66
max-height: calc(#{$quickenter-max-height} + env(safe-area-inset-top, 0));
77
background: $quickenter-bg-color;
8-
border-radius: 0 0 12px 12px;
8+
border-radius: 0 0 scale-px(12px) scale-px(12px);
99
overflow: hidden;
1010
box-sizing: border-box;
1111
display: flex;
@@ -24,7 +24,7 @@
2424
display: flex;
2525
align-items: center;
2626
justify-content: space-between;
27-
padding: 30px 16px 0;
27+
padding: scale-px(30px) scale-px(16px) 0;
2828
box-sizing: border-box;
2929
}
3030

@@ -53,7 +53,7 @@
5353

5454
&-content {
5555
flex: 1;
56-
padding: 10px 28px;
56+
padding: scale-px(10px) scale-px(28px);
5757
overflow-y: hidden; // 始终可滚动,防止内容被遮挡
5858
box-sizing: border-box;
5959

@@ -75,48 +75,48 @@
7575
flex-direction: column;
7676
align-items: center;
7777
justify-content: flex-start;
78-
width: 56px;
79-
padding: 0 0 12px 0; // Reduced from 16px to ensure 2 rows fit in 256px
78+
width: scale-px(56px);
79+
padding: 0 0 scale-px(12px) 0; // Reduced from 16px to ensure 2 rows fit in 256px
8080
box-sizing: border-box;
8181
cursor: pointer;
8282

8383
// Calculate gap for 4 items per row: (100% - 4 * 56px) / 3
84-
margin-right: calc((100% - 224px) / 3);
84+
margin-right: calc((100% - scale-px(224px)) / 3);
8585

8686
&:nth-child(4n) {
8787
margin-right: 0;
8888
}
8989

9090
&-icon {
91-
width: 56px;
92-
height: 56px;
91+
width: scale-px(56px);
92+
height: scale-px(56px);
9393
display: flex;
9494
align-items: center;
9595
justify-content: center;
9696
border-radius: 50%;
9797
background: $quickenter-item-icon-bg-color;
9898
color: $quickenter-item-icon-color;
99-
margin-bottom: 8px;
99+
margin-bottom: scale-px(8px);
100100
flex-shrink: 0;
101101

102102
svg,
103103
.nut-icon {
104-
width: 22px;
105-
height: 22px;
104+
width: scale-icon-px(22px);
105+
height: scale-icon-px(22px);
106106
}
107107
}
108108

109109
&-title {
110110
font-size: $quickenter-item-title-font-size;
111111
color: $quickenter-item-title-color;
112112
text-align: center;
113-
line-height: 1.4;
113+
line-height: scale-font-px(16px);
114114
// Allow multi-line if text is long, preventing truncation
115115
white-space: normal;
116116
word-wrap: break-word;
117-
width: 72px; // Allow text to be slightly wider than icon
118-
margin-left: -8px; // Center 72px title over 56px icon
119-
margin-right: -8px;
117+
width: scale-px(72px); // Allow text to be slightly wider than icon
118+
margin-left: scale-px(-8px); // Center 72px title over 56px icon
119+
margin-right: scale-px(-8px);
120120
}
121121
}
122122
}

src/packages/searchbar/demos/h5/demo6.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ const Demo6 = () => {
2020
}}
2121
list={itemList}
2222
>
23-
<div style={{ fontSize: '12px', width: '50px', display: 'flex' }}>
23+
<div
24+
style={{
25+
fontSize: '12px',
26+
width: '50px',
27+
display: 'flex',
28+
alignItems: 'center',
29+
}}
30+
>
2431
更多
2532
<ArrowDown />
2633
</div>

0 commit comments

Comments
 (0)