Files
BYW-VoiceHub/app/assets/css/theme-protection.css
T
Henry_Du 3eff710d5d feat(微信订阅): 接入歌曲排期模板并加固部署流程
订阅消息(小程序侧唯一能主动触达用户的通道):
- 新增 server/utils/wechatSubscribeFields.ts:按微信字段类型裁剪值(thing≤20、
  phrase 必须 5 个汉字、time/date/character_string 各自上限),空白压成一行,
  北京时间 time 由 playTime 的开始时间生成,解析不出退化为当天 00:00。
- wechatSubscribeService 内置 SONG_SELECTED 模板(站长新给的那个模板 ID),
  并转发上述纯函数;notificationService.createSongSelectedNotification 现在会带上
  playDate/playTime/sequence,三个排期接口(schedule / publish / bulk-publish)补传 sequence。
- 新增 test/wechatSubscribeFields.test.mjs(10 例,node --test 全绿)。
- test-subscribe 管理接口支持 vars 覆盖并返回真实发送值,方便站长核对字段名。

部署流程(Gitea Actions 容器里没有 buildx 插件,旧流程在此硬失败):
- 每个 job 各自安装/探测 docker-buildx(v0.19.3,走 gh-proxy 再退直连),
  不把 `buildx version` 当唯一依据;装不上时降级为普通 `docker build` 继续发布,
  不再因为缺插件整条流水线失败。

注意:SONG_SELECTED 的字段名(thing2/date4/time1/character_string3/phrase5)是按常见
命名推断的,需在公众平台后台核对;不一致时用环境变量覆盖,模板 ID 变更后老用户需重新授权。
2026-10-11 00:04:14 +08:00

102 lines
2.4 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* 温和的浏览器主题保护样式 */
/* 只保护关键元素,不干扰正常的CSS,并且根据 data-theme 动态切换 */
/* 全局颜色方案声明:移动端优先遵循 data-theme,其次才用系统色 */
:root {
color-scheme: light dark;
}
/* 深色主题时,显式声明 color-scheme = dark,解决 iOS / Chrome 移动端原生控件浅色的问题 */
:root[data-theme='dark'],
:root[data-theme='MidnightDark'],
:root[data-theme='ModernDark'],
:root[data-theme='ClassicDark'] {
color-scheme: dark;
}
/* 浅色主题时,显式声明 color-scheme = light */
:root[data-theme='light'],
:root[data-theme='ClassicLight'],
:root[data-theme='ModernLight'] {
color-scheme: light;
}
/* 保护表单元素外观,但不强锁 color-scheme = none(none 会导致控件 fallback 到浅色) */
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='url'],
input[type='tel'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='datetime-local'],
input[type='month'],
input[type='week'],
textarea,
select {
/* 禁用浏览器默认样式(保留我们自定义的背景色与文字颜色) */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
/* 在移动端根据主题继承 color-scheme,使原生滚动条/弹出控件正确变深色或浅色 */
color-scheme: inherit;
}
/* 深色主题下专门修复表单控件与浏览器原生 UI 的颜色方案 */
@media (prefers-color-scheme: dark) {
:root:not([data-theme='light']):not([data-theme='ClassicLight']):not([data-theme='ModernLight']) {
color-scheme: dark;
}
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='url'],
input[type='tel'],
input[type='number'],
input[type='date'],
input[type='time'],
input[type='datetime-local'],
input[type='month'],
input[type='week'],
textarea,
select {
color-scheme: dark;
}
}
/* 保护按钮外观 */
button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
/* 保护选中文本颜色 */
::selection {
background-color: rgba(79, 70, 229, 0.3);
color: inherit;
}
::-moz-selection {
background-color: rgba(79, 70, 229, 0.3);
color: inherit;
}
/* 保护占位符颜色 */
::placeholder {
opacity: 0.6;
}
/* 高对比度模式下的调整 */
@media (prefers-contrast: high) {
input,
textarea,
select,
button {
border-width: 2px;
}
}