Skip to content

Commit 5622445

Browse files
committed
彻底重构并修复URL匹配关键字行的问号图标与输入框对齐问题
1 parent 64c4b9c commit 5622445

File tree

3 files changed

+61
-8
lines changed

3 files changed

+61
-8
lines changed

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ export const inputStyles = `
88
width: 100%;
99
display: inline-block;
1010
vertical-align: middle;
11+
line-height: normal;
1112
}
1213
1314
.js-script-hook-input-field {
1415
width: 100%;
15-
height: 30px;
16+
height: 32px; /* 与行高匹配 */
1617
padding: 0 10px;
1718
border: 1px solid #ccc;
1819
border-radius: 4px;
1920
box-sizing: border-box;
2021
font-size: 14px;
2122
background-color: white;
22-
line-height: 28px;
23+
line-height: 30px;
2324
vertical-align: middle;
2425
}
2526
@@ -39,9 +40,27 @@ export const inputStyles = `
3940
/* 确保输入框在表格中与其他元素对齐 */
4041
.debugger-component-table .js-script-hook-input-container {
4142
margin: 0;
43+
display: inline-flex;
44+
align-items: center;
45+
height: 40px;
4246
}
4347
4448
.debugger-component-table .js-script-hook-input-field {
4549
vertical-align: middle;
4650
}
51+
52+
/* 特别处理URL匹配关键字输入框 */
53+
[id$="-url-pattern-input-container"] .js-script-hook-input-container {
54+
display: inline-flex;
55+
align-items: center;
56+
}
57+
58+
[id$="-url-pattern-input-container"] .js-script-hook-input-field {
59+
height: 32px;
60+
}
61+
62+
/* 确保输入框placeholder不影响高度 */
63+
.js-script-hook-input-field::placeholder {
64+
line-height: normal;
65+
}
4766
`;

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export const tipsStyles = `
2121
position: relative;
2222
vertical-align: middle;
2323
line-height: 1;
24-
top: -1px; /* 微调图标位置,使其更好地与文本对齐 */
24+
/* 重要:精确控制图标位置,使其与输入框完美对齐 */
25+
transform: translateY(-1px);
2526
}
2627
2728
/* 确保问号图标和后面的文本对齐 */
@@ -36,6 +37,8 @@ export const tipsStyles = `
3637
/* 创建一个包装器,确保问号图标与文本在水平和垂直方向上对齐 */
3738
td[align="right"] {
3839
white-space: nowrap;
40+
height: 42px;
41+
line-height: normal;
3942
}
4043
4144
td[align="right"] .js-script-hook-tips-icon,
@@ -44,6 +47,15 @@ export const tipsStyles = `
4447
vertical-align: middle;
4548
}
4649
50+
/* URL匹配关键字行特殊处理 - 确保这行的问号图标完美对齐 */
51+
[id$="-url-pattern-input-container"] {
52+
line-height: normal !important;
53+
}
54+
55+
tr:has([id$="-url-pattern-input-container"]) td[align="right"] .js-script-hook-tips-icon {
56+
transform: translateY(0);
57+
}
58+
4759
/* 工具提示样式 */
4860
.js-script-hook-tooltip {
4961
visibility: hidden;

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

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ export const debuggerStyles = `
6060
6161
.debugger-component-table tr {
6262
height: 42px; /* 略微增加行高,给UI元素更多呼吸空间 */
63-
line-height: 42px; /* 行高与高度保持一致 */
63+
min-height: 42px; /* 确保最小高度 */
64+
line-height: normal; /* 重要:使用normal而不是固定值 */
65+
vertical-align: middle;
6466
}
6567
6668
.debugger-component-table td {
6769
padding: 6px 8px;
6870
vertical-align: middle;
6971
line-height: normal;
72+
height: 42px; /* 确保单元格高度一致 */
7073
}
7174
7275
.debugger-component-table td[align="right"] {
@@ -87,24 +90,43 @@ export const debuggerStyles = `
8790
vertical-align: middle;
8891
}
8992
93+
/* 针对特定行的特殊样式调整 */
94+
.debugger-component-table tr:has([id$="-url-pattern-input-container"]) {
95+
height: 42px;
96+
display: flex;
97+
align-items: center;
98+
}
99+
100+
.debugger-component-table tr:has([id$="-url-pattern-input-container"]) td {
101+
display: flex;
102+
align-items: center;
103+
}
104+
105+
.debugger-component-table tr:has([id$="-url-pattern-input-container"]) td[align="right"] {
106+
justify-content: flex-end;
107+
}
108+
90109
/* 修正输入框与问号图标的对齐 */
91110
.js-script-hook-input-container {
92-
display: inline-block;
111+
display: inline-flex;
93112
vertical-align: middle;
113+
align-items: center;
94114
}
95115
96116
/* 确保测试按钮与问号图标对齐 */
97117
.js-script-hook-button-container {
98-
display: inline-block;
118+
display: inline-flex;
99119
vertical-align: middle;
100120
margin: 0;
121+
align-items: center;
122+
height: 42px;
101123
}
102124
103125
/* 调整输入框的高度,使其与行高匹配 */
104126
.js-script-hook-input-field {
105127
box-sizing: border-box;
106-
height: 30px;
107-
line-height: 28px;
128+
height: 32px;
129+
line-height: 30px;
108130
padding: 0 10px;
109131
}
110132
`;

0 commit comments

Comments
 (0)