From d1ce649fb236dbd5a83be870ac60f6c965fe93bc Mon Sep 17 00:00:00 2001 From: shiran <2488252513@qq.com> Date: Thu, 26 Feb 2026 15:48:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(cursor):=20=E6=B7=BB=E5=8A=A0=E5=A4=9A?= =?UTF-8?q?=E7=A7=8D=E8=87=AA=E5=AE=9A=E4=B9=89=E5=85=89=E6=A0=87=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将原有的 custom_cursor 重命名为 default_cursor,并实现默认光标功能 - 新增 hover_cursor 配置,为链接和按钮元素提供悬停光标效果 - 新增 pointer_cursor 配置,为链接元素提供专用指针光标 - 新增 text_cursor 配置,为输入框和文本域提供文本编辑光标 - 在 settings.yml 中添加对应的配置项和描述信息 - 实现多层级光标样式的 SCSS 逻辑处理 --- scss/self.scss | 42 ++++++++++++++++++++++++++++++++++++++++-- settings.yml | 19 +++++++++++++++++-- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/scss/self.scss b/scss/self.scss index 47c9d9c..cf8c525 100644 --- a/scss/self.scss +++ b/scss/self.scss @@ -82,8 +82,46 @@ display: none; } -@if $custom_cursor != "" { +// 默认光标 +@if $default_cursor != "" { * { - cursor: url($custom_cursor) 1 1, auto; + cursor: url($default_cursor) 1 1, auto; + } +} + +// 悬停光标 +@if $hover_cursor != "" { + a, + button, + [role="button"], + input[type="button"], + input[type="submit"], + .btn, + .clickable { + cursor: url($hover_cursor) 1 1, auto; + } +} + +// 链接光标 +@if $pointer_cursor != "" { + a[href], + button, + [role="button"], + label, + input[type="button"], + input[type="submit"], + .pointer { + cursor: url($pointer_cursor) 1 1, pointer; + } +} + +// 文本光标 +@if $text_cursor != "" { + input[type="text"], + input[type="email"], + input[type="password"], + input[type="search"], + textarea { + cursor: url($text_cursor) 1 1, text; } } diff --git a/settings.yml b/settings.yml index 74b3025..d096c08 100644 --- a/settings.yml +++ b/settings.yml @@ -15,8 +15,23 @@ home_bg_image: default: "" description: "首页背景图" -custom_cursor: +default_cursor: type: upload default: "" - description: "自定义光标 SVG 文件" + description: "默认光标 SVG 文件" + +hover_cursor: + type: upload + default: "" + description: "悬停光标 SVG 文件" + +pointer_cursor: + type: upload + default: "" + description: "链接光标 SVG 文件" + +text_cursor: + type: upload + default: "" + description: "文本光标 SVG 文件"