Skip to content

Commit 64c4b9c

Browse files
committed
彻底修复断点列表中问号提示图标与输入框高度对齐问题
1 parent adebfc2 commit 64c4b9c

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed

src/config/ui/component/basic/input/styles.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@
44
export const inputStyles = `
55
.js-script-hook-input-container {
66
position: relative;
7-
margin: 8px 0;
7+
margin: 0;
88
width: 100%;
9+
display: inline-block;
10+
vertical-align: middle;
911
}
1012
1113
.js-script-hook-input-field {
1214
width: 100%;
13-
padding: 8px 10px;
15+
height: 30px;
16+
padding: 0 10px;
1417
border: 1px solid #ccc;
1518
border-radius: 4px;
1619
box-sizing: border-box;
1720
font-size: 14px;
1821
background-color: white;
22+
line-height: 28px;
23+
vertical-align: middle;
1924
}
2025
2126
.js-script-hook-input-field:focus {
@@ -30,4 +35,13 @@ export const inputStyles = `
3035
margin-bottom: 4px;
3136
display: block;
3237
}
38+
39+
/* 确保输入框在表格中与其他元素对齐 */
40+
.debugger-component-table .js-script-hook-input-container {
41+
margin: 0;
42+
}
43+
44+
.debugger-component-table .js-script-hook-input-field {
45+
vertical-align: middle;
46+
}
3347
`;

src/config/ui/component/basic/tips/styles.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export const tipsStyles = `
99
justify-content: center;
1010
width: 16px;
1111
height: 16px;
12+
min-width: 16px;
13+
min-height: 16px;
1214
border-radius: 50%;
1315
background-color: #007bff;
1416
color: white;
@@ -19,6 +21,7 @@ export const tipsStyles = `
1921
position: relative;
2022
vertical-align: middle;
2123
line-height: 1;
24+
top: -1px; /* 微调图标位置,使其更好地与文本对齐 */
2225
}
2326
2427
/* 确保问号图标和后面的文本对齐 */
@@ -30,6 +33,17 @@ export const tipsStyles = `
3033
height: 100%;
3134
}
3235
36+
/* 创建一个包装器,确保问号图标与文本在水平和垂直方向上对齐 */
37+
td[align="right"] {
38+
white-space: nowrap;
39+
}
40+
41+
td[align="right"] .js-script-hook-tips-icon,
42+
td[align="right"] span {
43+
display: inline-block;
44+
vertical-align: middle;
45+
}
46+
3347
/* 工具提示样式 */
3448
.js-script-hook-tooltip {
3549
visibility: hidden;

src/config/ui/component/debugger/styles.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ export const debuggerStyles = `
5555
width: 100%;
5656
border-spacing: 0;
5757
border-collapse: separate;
58+
table-layout: fixed; /* 固定表格布局,减少重排 */
5859
}
5960
6061
.debugger-component-table tr {
61-
height: 40px; /* 设置固定的行高 */
62+
height: 42px; /* 略微增加行高,给UI元素更多呼吸空间 */
63+
line-height: 42px; /* 行高与高度保持一致 */
6264
}
6365
6466
.debugger-component-table td {
65-
padding: 8px;
67+
padding: 6px 8px;
6668
vertical-align: middle;
6769
line-height: normal;
6870
}
@@ -72,6 +74,7 @@ export const debuggerStyles = `
7274
text-align: right;
7375
padding-right: 15px;
7476
white-space: nowrap; /* 防止文本换行 */
77+
overflow: visible; /* 确保提示图标不被截断 */
7578
}
7679
7780
.debugger-component-table td[align="left"] {
@@ -83,4 +86,25 @@ export const debuggerStyles = `
8386
.debugger-component-table td > * {
8487
vertical-align: middle;
8588
}
89+
90+
/* 修正输入框与问号图标的对齐 */
91+
.js-script-hook-input-container {
92+
display: inline-block;
93+
vertical-align: middle;
94+
}
95+
96+
/* 确保测试按钮与问号图标对齐 */
97+
.js-script-hook-button-container {
98+
display: inline-block;
99+
vertical-align: middle;
100+
margin: 0;
101+
}
102+
103+
/* 调整输入框的高度,使其与行高匹配 */
104+
.js-script-hook-input-field {
105+
box-sizing: border-box;
106+
height: 30px;
107+
line-height: 28px;
108+
padding: 0 10px;
109+
}
86110
`;

0 commit comments

Comments
 (0)