From 42fcf3bbce14928d83da921bd5b3dada3d7a7c35 Mon Sep 17 00:00:00 2001 From: augushong Date: Fri, 9 Oct 2026 13:24:18 +0000 Subject: [PATCH] =?UTF-8?q?fix(theme):=20=E6=B8=85=E7=88=BD=E7=9A=AE?= =?UTF-8?q?=E8=82=A4primary=E5=A4=8D=E9=80=89=E6=A1=86=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E6=96=87=E5=AD=97=E4=B8=8D=E5=86=8D=E6=9C=89=E8=93=9D=E5=BA=95?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E4=B8=BA=E6=97=A0=E5=BA=95=E8=93=9D=E5=AD=97?= =?UTF-8?q?=EF=BC=88pro#7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/css/theme/_fresh.scss | 14 ++++++++++++-- public/static/common/css/theme/index.css | 7 +++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/public/static/common/css/theme/_fresh.scss b/public/static/common/css/theme/_fresh.scss index cb67958..f13bd5a 100644 --- a/public/static/common/css/theme/_fresh.scss +++ b/public/static/common/css/theme/_fresh.scss @@ -593,8 +593,12 @@ $shadow-pop: 0 6px 16px rgba(31, 35, 41, .08); border-color: $main; } -.layui-form-checked > div, -.layui-form-checked:hover > div { +// 老式 pill 风格(显式 lay-skin="checkbox")的文字底接管,primary 必须排除(issue #7): +// layui 原版绿底规则 (0,1,1) 打不过 primary 文字重置 (0,2,1),故原版 primary 勾选文字无底色; +// 包装后若不排除则与重置 (0,2,1) 打平且靠加载顺序取胜(layui.css 经 public.css 顶部 @import +// 引入,本文件在后),会把 primary 勾选文字染成蓝底灰字。:not 收窄后仅 pill 风格命中。 +.layui-form-checkbox:not([lay-skin=primary]).layui-form-checked > div, +.layui-form-checkbox:not([lay-skin=primary]).layui-form-checked:hover > div { background-color: $main; } @@ -609,6 +613,12 @@ $shadow-pop: 0 6px 16px rgba(31, 35, 41, .08); color : #fff; } +// primary 勾选态文字(issue #7 定案:无背景色——背景交给 layui 重置的 background:0 0, +// 仅文字颜色变化;包裹后 (0,3,1) 稳赢重置 (0,2,1),未选中态不受影响) +.layui-form-checked[lay-skin=primary] > div { + color: $main; +} + // G2 单选与开关 .layui-form-radioed, .layui-form-radioed > i { diff --git a/public/static/common/css/theme/index.css b/public/static/common/css/theme/index.css index cefedee..a57d527 100644 --- a/public/static/common/css/theme/index.css +++ b/public/static/common/css/theme/index.css @@ -2549,8 +2549,8 @@ .elem-style-fresh .layui-form-checked:hover { border-color: #1E9FFF; } -.elem-style-fresh .layui-form-checked > div, -.elem-style-fresh .layui-form-checked:hover > div { +.elem-style-fresh .layui-form-checkbox:not([lay-skin=primary]).layui-form-checked > div, +.elem-style-fresh .layui-form-checkbox:not([lay-skin=primary]).layui-form-checked:hover > div { background-color: #1E9FFF; } .elem-style-fresh .layui-form-checked > i, @@ -2562,6 +2562,9 @@ background-color: #1E9FFF; color: #fff; } +.elem-style-fresh .layui-form-checked[lay-skin=primary] > div { + color: #1E9FFF; +} .elem-style-fresh .layui-form-radioed, .elem-style-fresh .layui-form-radioed > i { color: #1E9FFF;