From dc39e468bb2d078725ca15766a39d8f22f108b00 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Mon, 21 Sep 2026 12:42:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20iOS=20=E8=81=9A=E7=84=A6?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E5=AF=BC=E8=87=B4=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=94=BE=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 输入控件字号统一提到 16px,规避 iOS Safari 的聚焦自动缩放 - maximum-scale/user-scalable 对 iOS 无效,仅作为其他浏览器兜底 - 用 !important 压过 Element Plus 的 is-small / --small 变体(13~14px) --- index.html | 2 +- src/styles/theme.css | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 2354333..4af6b98 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ - + LionWebsite diff --git a/src/styles/theme.css b/src/styles/theme.css index 8a7bd5e..433471a 100644 --- a/src/styles/theme.css +++ b/src/styles/theme.css @@ -1073,3 +1073,21 @@ body { padding: 10px 12px 8px; } } + +/* ========== iOS focus-zoom guard ========== + iOS Safari 会在聚焦字号小于 16px 的输入控件时放大整个页面,而且会忽略 + viewport 里的 user-scalable=no / maximum-scale。把可聚焦控件的字号固定到 + 16px 才是可靠解法;按钮、标签等展示型元素不受影响。 + + 这里用 !important 是必要的:Element Plus 的 .el-select--small / .el-input--small + 等变体自带 13~14px 规则,优先级高于普通选择器。 */ +input:not([type="checkbox"]):not([type="radio"]), +textarea, +select, +.el-input__inner, +.el-textarea__inner, +.el-select__input, +.el-select__wrapper, +.el-input-number .el-input__inner { + font-size: 16px !important; +}