From 1cbc0c6ed89323d2c9167a0a40f729d320d04a80 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Sep 2026 10:28:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(payment):=20=E6=8E=92=E5=BA=8F=E7=AE=AD?= =?UTF-8?q?=E5=A4=B4=E6=94=B9=E4=B8=BA=E5=9F=BA=E7=BA=BF=E9=94=9A=E5=AE=9A?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=AD=A3=E8=A1=A8=E5=A4=B4=E7=AE=AD=E5=A4=B4?= =?UTF-8?q?=E7=9B=B8=E5=AF=B9=E6=96=87=E5=AD=97=E5=81=8F=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .orderby-but 从「无尺寸 inline 宿主 + 依赖绝对定位静态位置 + 固定 translateY(-3px)/6px」改为「零尺寸 inline-block 宿主 + bottom 锚定 + translateY(50%)」。 原理:空 inline-block 的基线即其下边缘,会与同行文字基线对齐,于是箭头盒可用 bottom 精确锚定到「基线以上 N em」;translateY(50%) 抵消箭头自身高度,使盒中心恒等于 bottom 值, 与 dashicons 盒高无关。两枚箭头中心分别落在基线以上 .725em / .075em,对称于文字视觉中心。 旧写法的问题:绝对定位元素未指定 top/bottom 时,其位置来自静态位置(容器内容盒顶部), 该值与表头字体/行高联动;在真实后台 CJK 字体度量下整体偏下。 量测(无头 Chrome + 真实 wp-admin common.css/list-tables.css + 真实表头标记): - 旧写法:箭头簇中心相对文字中心 +2.0px(复现用户反馈的「偏下一点」) - 新写法:-0.09px;两箭头相对文字中心 -4.64 / +4.46,居中对称 - 表头行高两版均为 36.59px,无行高副作用 契约测试同步收紧:断言 bottom 锚定写法,并禁止回归到无 bottom 的固定像素位移。 --- src/Admin/Native/PayChargeCards.php | 15 ++++++++----- .../admin/charge-cards-page-contract.test.cjs | 22 ++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/Admin/Native/PayChargeCards.php b/src/Admin/Native/PayChargeCards.php index 49655b21..7e518f8b 100644 --- a/src/Admin/Native/PayChargeCards.php +++ b/src/Admin/Native/PayChargeCards.php @@ -1031,12 +1031,15 @@ class PayChargeCards {