Compare commits

...

59 Commits

Author SHA1 Message Date
shiran d1ce649fb2 feat(cursor): 添加多种自定义光标样式支持
Discourse Theme / ci (push) Failing after 0s
- 将原有的 custom_cursor 重命名为 default_cursor,并实现默认光标功能
- 新增 hover_cursor 配置,为链接和按钮元素提供悬停光标效果
- 新增 pointer_cursor 配置,为链接元素提供专用指针光标
- 新增 text_cursor 配置,为输入框和文本域提供文本编辑光标
- 在 settings.yml 中添加对应的配置项和描述信息
- 实现多层级光标样式的 SCSS 逻辑处理
2026-02-26 15:48:21 +08:00
shiran b6e54e3cbd feat(theme): 添加自定义光标功能
Discourse Theme / ci (push) Failing after 1s
- 在 SCSS 中实现条件编译以支持自定义光标
- 添加 $custom_cursor 变量控制光标样式
- 在 settings.yml 中增加 custom_cursor 配置项
- 支持上传 SVG 文件作为自定义光标
- 默认值设为空字符串以保持向后兼容性
2026-02-26 15:37:57 +08:00
shiran eb3f4efe2c feat(style): 添加自定义鼠标指针样式
Discourse Theme / ci (push) Failing after 0s
- 在全局范围内应用自定义 SVG 指针
- 设置指针热点位置为 1,1 坐标
- 保留默认指针作为备选方案
- 隐藏 Discourse 功能标识元素
2026-02-26 15:32:48 +08:00
shiran 2f5c4b2989 style(scss): 移除按钮悬停背景色过渡效果
Discourse Theme / ci (push) Failing after 0s
- 移除了按钮元素的 hover 状态背景色变化
- 删除了 transition 属性相关的悬停动画效果
- 简化了按钮样式代码结构
2026-02-26 15:26:05 +08:00
shiran 15ec4e326a style(css): 更新样式选择器以匹配管理员容器布局
Discourse Theme / ci (push) Failing after 2s
- 添加 .admin-container>.container.groups-index 选择器到现有的背景样式规则
- 保持与现有 .ember-view.group-box 样式的一致性
- 确保管理员组索引页面的视觉统一性
2026-02-26 15:22:04 +08:00
shiran 0c85709857 fix(style): 修复群组页面容器背景样式
Discourse Theme / ci (push) Failing after 1s
- 修正了群组索引页面的选择器以正确应用背景样式
- 确保群组页面容器具有正确的背景颜色和圆角效果
2026-02-26 15:19:58 +08:00
shiran 7f87145998 style(css): 添加群组容器样式支持
Discourse Theme / ci (push) Failing after 0s
- 为 .container.group 添加背景色、圆角和模糊效果样式
- 扩展 backdrop-filter 应用范围到群组相关容器
- 保持一致的视觉风格和透明度效果
2026-02-26 14:49:20 +08:00
shiran 2f7bd50a36 style(css): 更新SCSS样式以添加新组件背景样式
Discourse Theme / ci (push) Failing after 0s
- 为 .ember-view.group-box 添加背景、圆角和阴影样式
- 统一主题帖子、搜索头部、管理员插件配置页面背景样式
- 应用变量 --d-chat-input-bg-color 和 --d-border-radius
- 添加黑色半透明阴影效果 box-shadow: #00000024 0 0 7px 2px
2026-02-26 14:47:44 +08:00
shiran d5f84bc7fc style(scss): 更新背景样式配置
Discourse Theme / ci (push) Failing after 2s
- 为 .container.groups-index 添加背景色、圆角和模糊效果
- 统一多个选择器的视觉样式表现
2026-02-26 14:46:29 +08:00
shiran 1e2fc63ed1 feat(style): 添加用户卡片悬停效果
Discourse Theme / ci (push) Failing after 1s
- 为用户卡片添加背景色过渡动画
- 实现悬停时背景色变化效果
- 使用 CSS 变量保持主题一致性
- 优化用户体验的视觉反馈
2026-02-26 14:44:18 +08:00
shiran 241f251c3a refactor(style): 重构CSS类选择器以优化样式应用
Discourse Theme / ci (push) Failing after 0s
- 移除 .user-main .about.collapsed-info .details 从背景色透明样式规则中
- 将 .user-main .about.collapsed-info .details 添加到背景变量样式规则中
- 优化了CSS选择器的分组和结构
- 统一了相关组件的视觉样式表现
2026-02-26 14:40:55 +08:00
shiran 9154d84663 style(css): 格式化CSS选择器以符合团队样式指南
Discourse Theme / ci (push) Failing after 0s
- 将长的选择器列表按行分割以提高可读性
- 在每个选择器后添加适当的换行和缩进
- 遵循团队的代码格式化规范
- 保持CSS代码的一致性和整洁性
- 便于后续维护和审查
2026-02-26 14:37:52 +08:00
shiran 7d30ebd133 fix(style): 更新CSS选择器以正确应用背景样式
Discourse Theme / ci (push) Failing after 0s
- 修改了.edit-category类的选择器定位方式
- 从直接类选择器改为ID选择器配合后代选择器
- 确保编辑分类页面的背景色和圆角样式正确应用
- 保持原有的毛玻璃效果和透明度设置不变
2026-02-26 14:33:10 +08:00
shiran 3330d0056b docs(theme): 更新主题描述为中文
Discourse Theme / ci (push) Failing after 0s
- 将主题描述从英文更改为中文描述
- 移除已弃用的提示信息
- 简化描述内容为自制二次元主题说明
2026-02-26 14:30:56 +08:00
shiran 4f5ff0fb73 style(theme): 更新CSS样式以包含新类别编辑组件
Discourse Theme / ci (push) Failing after 0s
- 为.edit-category类添加白色半透明背景
- 应用相同的边框圆角和背景模糊效果
- 确保新组件与其他页面元素保持一致的视觉风格
2026-02-26 14:25:06 +08:00
shiran 45baef8a01 style(scss): 隐藏 Discourse 标识显示
Discourse Theme / ci (push) Failing after 2s
- 在 self.scss 中新增 .powered-by-discourse 类
- 设置 display: none 属性隐藏相关元素
- 保持原有的用户内容背景样式设置
- 添加空行优化代码结构可读性
2026-02-24 09:45:30 +08:00
shiran 3e2d5f455c style(theme): 更新CSS样式以支持用户目录页面
Discourse Theme / ci (push) Failing after 0s
- 为.users-directory类添加背景色、圆角和模糊效果样式
- 保持与其他页面组件一致的视觉风格
2026-02-24 09:38:43 +08:00
shiran 97d33974c9 style(theme): 更新CSS样式以包含新类名
Discourse Theme / ci (push) Failing after 1s
- 为.show-badge类添加背景色和圆角样式
- 统一应用半透明白色背景和模糊效果
- 保持与其他容器元素一致的视觉风格
- 确保新类名在主题系统中的兼容性
2026-02-24 09:37:07 +08:00
shiran 14b8fd2048 style(scss): 添加溢出隐藏样式
Discourse Theme / ci (push) Failing after 2s
- 在用户内容区域添加 overflow: hidden 样式
- 防止内容超出容器边界显示
2026-02-24 09:23:39 +08:00
shiran f6cbd5eccf style(css): 更新样式表中的选择器以增强主题一致性
Discourse Theme / ci (push) Failing after 0s
- 为 .admin-detail 添加背景颜色重置规则
- 将 .admin-detail 替换为 .admin-plugin-config-page__content 以改进插件配置页面样式
- 确保主题背景和边框半径在整个管理界面中保持一致
2026-02-24 09:16:24 +08:00
shiran d11c87a060 style(css): 更新CSS选择器样式
Discourse Theme / ci (push) Failing after 1s
- 将.admin-plugin-config-page__content选择器替换为.admin-detail
- 保持相同的背景色、圆角和阴影样式定义
2026-02-24 09:13:39 +08:00
shiran f876f44c84 style(scss): 更新样式表以支持管理员插件配置页面内容区域
Discourse Theme / ci (push) Failing after 0s
- 为 .admin-plugin-config-page__content 类添加背景、边框半径和阴影样式
- 统一管理插件配置页面内容区域的视觉外观
- 保持与其他内容区域样式的一致性
2026-02-24 09:11:48 +08:00
shiran b1d9fdd058 style(css): 更新样式文件中的选择器定义
Discourse Theme / ci (push) Failing after 1s
- 为 .search-header 添加与 .topic-post 和 .post-list-item 相同的背景、圆角和阴影样式
- 统一搜索头部与其他帖子项目的视觉外观
- 保持一致的设计风格和用户体验
2026-02-24 09:05:18 +08:00
shiran cddf2f9f84 style(theme): 更新搜索容器样式并调整背景模糊效果
Discourse Theme / ci (push) Failing after 2s
- 为搜索容器添加白色半透明背景
- 将背景模糊效果从 16px 增加到 32px
- 保持现有的边框圆角和阴影效果
- 确保所有相关页面元素具有一致的视觉样式
2026-02-24 09:03:55 +08:00
shiran 57cfd7eaae style(layout): 更新CSS选择器以改进页面背景样式
Discourse Theme / ci (push) Failing after 0s
- 添加.contents.clearfix.body-page选择器到现有样式规则
- 保持背景颜色透明度和边框半径一致性
- 维持毛玻璃效果以确保视觉统一性
2026-02-24 09:00:46 +08:00
shiran c12464bc7d style(layout): 更新盒子样式和添加用户内容背景
Discourse Theme / ci (push) Failing after 0s
- 调整盒子内边距从 0 12px 到 16px 12px
- 添加 .user-content 类设置背景颜色为无样式
2026-02-24 08:43:20 +08:00
shiran 1d94f2ed88 style(css): 更新主题帖子样式选择器
Discourse Theme / ci (push) Failing after 0s
- 扩展 .topic-post.clearfix.regular 选择器以包含 .post-list-item.user-stream-item
- 保持相同的背景、圆角和阴影样式属性
- 确保用户流项目具有与主题帖子相同的视觉外观
2026-02-23 09:09:23 +08:00
shiran a8f730a1f6 style(topic-cards): 移除悬停状态下的触摸设备样式
Discourse Theme / ci (push) Failing after 1s
- 移除了 .discourse-no-touch 类的选择器包装
- 简化了悬停时的背景和阴影样式应用逻辑
- 保持了选中状态样式的完整性
2026-02-23 09:02:49 +08:00
shiran a45b6c0cbc style(topic-post): 添加主题帖子样式定义
Discourse Theme / ci (push) Failing after 0s
- 为 .topic-post.clearfix.regular 类添加背景色样式
- 设置圆角边框样式
- 添加阴影效果
- 定义外边距和内边距
- 设置相对定位样式
2026-02-23 08:57:23 +08:00
shiran 808d195332 style(scss): 更新样式选择器以支持主题列表头部
Discourse Theme / ci (push) Failing after 0s
- 将 #list-area 选择器扩展为同时包含 .topic-list-header 类
- 移除背景颜色的强制设置以支持主题定制
- 保持现有的阴影效果和其他样式属性不变
2026-02-22 11:42:58 +08:00
shiran 8b0584a87e style(scss): 更新样式表以改进用户界面元素的边框半径和背景色
Discourse Theme / ci (push) Failing after 1s
- 为 .user-content 和 .details 类添加边框半径变量
- 将 .regular.ember-view, .user-main, .reviewable, .admin-content
  的背景色设置为带透明度的白色
- 为多个用户界面组件统一应用边框半径和背景模糊效果
- 调整 CSS 选择器顺序以优化样式覆盖逻辑
2026-02-21 11:12:36 +08:00
shiran b3f2686970 style(theme): 更新CSS选择器以改进页面样式
Discourse Theme / ci (push) Failing after 0s
- 为.regular.ember-view, .user-main, .user-content, .details, .reviewable, .admin-content添加背景色
- 为相关元素添加圆角样式
- 为页面内容添加毛玻璃效果
2026-02-21 10:19:20 +08:00
shiran 09e5f27aaa style(scss): 更新CSS选择器以适配更多页面元素
Discourse Theme / ci (push) Failing after 0s
- 为.regular.ember-view, .user-main, .reviewable, .admin-content类添加背景样式
- 统一应用白色半透明背景、圆角和模糊效果
- 替换原有的.container选择器为更通用的页面容器类名
2026-02-21 10:16:07 +08:00
shiran ba0a46820a style(css): 更新样式类选择器以包含容器元素
Discourse Theme / ci (push) Failing after 0s
- 将 .container 类添加到 .regular.ember-view 选择器中
- 保持相同的背景颜色、边框半径和背景模糊效果
- 确保容器元素具有与现有视图组件相同的视觉样式
2026-02-21 10:13:39 +08:00
shiran c472e537a3 style(topic-cards): 更新主题卡片样式以使用新的颜色变量和阴影效果
Discourse Theme / ci (push) Failing after 1s
- 将背景渐变从 --d-sidebar-active-background 替换为 --active-color
- 更新悬停状态的背景色为 --active-color
- 修改盒阴影语法以提高兼容性
- 调整悬停状态的边框颜色透明度
- 简化了阴影效果的数值表示方式
2026-02-21 10:11:28 +08:00
shiran ac2bb8084b style(topic-cards): 更新主题卡片边框颜色样式
Discourse Theme / ci (push) Failing after 0s
- 将主题卡片左侧边框颜色从变量 --d-button-danger-icon-color 改为 #0008
2026-02-21 10:07:22 +08:00
shiran b83d1c4de9 style(css): 移除梦幻效果并优化主题样式
Discourse Theme / ci (push) Failing after 0s
- 删除了全局的梦幻光晕效果和相关动画
- 移除了话题卡片的渐变背景和发光效果
- 简化了列表容器的背景样式和阴影效果
- 调整了话题卡片悬停状态的视觉效果
- 优化了分类标签的颜色配置方式
- 更新了选中状态的边框颜色和透明度设置
2026-02-21 10:03:46 +08:00
shiran 1fb6a7b5a1 Merge remote-tracking branch 'origin/main'
Discourse Theme / ci (push) Failing after 0s
2026-02-21 09:59:32 +08:00
shiran d87e9a30d5 style(scss): 添加主出口包装器的z-index样式
- 在self.scss中添加#main-outlet-wrapper的z-index: 0样式
- 保持其他样式定义不变
2026-02-21 09:59:21 +08:00
shiran baf01610e4 style(theme): 更新主题样式和视觉效果
Discourse Theme / ci (push) Failing after 1s
- 替换梦幻光效变量为基于三级颜色的新配色方案
- 调整模糊滤镜强度从48px增加到56px
- 修改径向渐变透明度值以优化视觉层次
- 在列表容器中添加隔离层以改善渲染性能
- 更新话题卡片背景渐变使用RGB颜色变量
- 调整阴影效果和透明度以增强深度感
- 优化选中状态边框颜色使用三级颜色变量
- 添加悬停状态变换效果提升交互体验
2026-02-20 21:54:43 +08:00
shiran 10639d6ddf style(topic-cards): 更新话题卡片悬停样式
Discourse Theme / ci (push) Failing after 1s
- 移除旧的背景渐变效果,改用 --active_color 变量
- 简化阴影效果,从双层阴影改为单层阴影
- 添加左侧边框以增强视觉效果
- 移除悬停时的垂直位移变换效果
2026-02-20 21:48:19 +08:00
shiran ff29cd0652 style(ui): 添加梦幻视觉效果和优化话题卡片样式
Discourse Theme / ci (push) Failing after 1s
- 新增梦幻发光效果变量和动画实现
- 为主题背景添加浮动光晕装饰元素
- 重构话题卡片渐变背景和交互效果
- 实现卡片悬停时的平滑变换动画
- 添加响应式设计和可访问性支持
- 优化主题样式层级和渲染性能
2026-02-20 21:39:22 +08:00
shiran 48c4a39647 style(css): 统一搜索容器样式并移除话题卡片变换效果
Discourse Theme / ci (push) Failing after 0s
- 为搜索容器添加与列表控件相同的圆角样式
- 移除话题卡片的 translateY 变换效果以简化视觉表现
2026-02-20 21:34:22 +08:00
shiran aafa92430a style(scss): 更新样式规则以改进背景和阴影属性
Discourse Theme / ci (push) Failing after 1s
- 为 regular.ember-view 添加 !important 修饰符以确保背景色优先级
- 移除 box-shadow 属性上的 !important 修饰符以优化样式继承
- 保持模糊效果和内边距设置不变
2026-02-20 21:32:11 +08:00
shiran 0ca608ab91 style(scss): 添加重要样式覆盖规则
Discourse Theme / ci (push) Failing after 0s
- 在box-shadow属性上添加!important标记以确保样式覆盖
- 保持原有的背景色、圆角和模糊效果设置不变
- 确保元素具有24px的内边距设置
2026-02-20 21:30:57 +08:00
shiran bee984881e refactor(styles): 更新选择器以提高样式一致性
Discourse Theme / ci (push) Failing after 1s
- 将 ID 选择器 #ember155 替换为类选择器 .regular.ember-view
- 保持相同的背景颜色、边框圆角和背景模糊效果
- 提高样式的可重用性和维护性
2026-02-20 21:28:33 +08:00
shiran ea810552db style(homepage): 更新背景和组件样式
Discourse Theme / ci (push) Failing after 1s
- 添加固定背景附件属性
- 为列表控件添加阴影效果
- 移除话题列表头部背景色
- 更新欢迎横幅内边距和阴影
- 为 ember155 元素添加背景、圆角、模糊滤镜和阴影
2026-02-20 21:26:03 +08:00
shiran 275945ce1a feat(common): 添加自定义样式模块
Discourse Theme / ci (push) Failing after 1s
- 在 common.scss 中导入新的 self 样式模块
- 扩展公共样式体系以支持个性化定制需求
2026-02-20 21:07:47 +08:00
shiran 6119211ff4 style(ui): 优化话题列表界面样式
Discourse Theme / ci (push) Failing after 1s
- 为话题列表头部添加 z-index 层级控制
- 调整话题列表头部间距和内边距
- 设置话题列表数据项颜色、字体大小和粗细
- 将话题列表数据项设为大写字母并添加背景透明效果
- 为默认话题列表项添加圆角边框
- 重新定位批量选择控件位置并更新样式
- 更新批量选择按钮的圆角样式
- 新增自定义背景图片和容器样式
- 为主题卡片渐变背景替换为线性渐变效果
- 调整主题卡片悬停状态下的背景色和阴影效果
- 为主题卡片添加左侧边框高亮效果
- 移除废弃的主题卡片相关样式代码
2026-02-20 21:04:14 +08:00
shiran 2e967617af style(topic-cards): 更新卡片样式添加圆角和模糊效果
Discourse Theme / ci (push) Failing after 1s
- 为话题卡片添加 border-radius 样式
- 实现 backdrop-filter 模糊背景效果
- 提升卡片视觉层次和美观度
2026-02-20 13:21:14 +08:00
shiran 3efe032ebf style(topic-cards): 移除卡片背景遮罩层并重置列表区域背景色
Discourse Theme / ci (push) Failing after 1s
- 移除了卡片元素的负z-index背景遮罩层
- 为列表区域添加了背景色重置样式
- 解决了背景颜色覆盖问题
- 优化了卡片显示效果
2026-02-20 13:19:24 +08:00
shiran 7cdbcb539e feat(theme): 添加首页背景图片功能
Discourse Theme / ci (push) Failing after 0s
- 在设置中新增 home_bg_image 配置选项
- 实现主题 SCSS 中的背景图片样式逻辑
- 添加对首页背景图片的条件渲染支持
- 集成上传功能以支持自定义背景图片
- 设置默认值为空字符串以避免初始加载问题
- 添加中文描述文档以便用户理解功能用途
2026-02-20 13:16:48 +08:00
shiran ddf40963aa style(topic-cards): 优化卡片样式和过渡效果
Discourse Theme / ci (push) Failing after 1s
- 将过渡属性从特定属性改为 all 以简化动画效果
- 移除复杂的径向渐变背景和遮罩组合效果
- 添加列表容器的基础样式定义
- 为列表容器添加半透明白色背景层
2026-02-20 13:11:43 +08:00
shiran d3bb44d636 refactor(horizon): 移除管理员通知并简化主题初始化逻辑
Discourse Theme / ci (push) Failing after 1s
- 删除了管理员使用Horizon主题时的全局通知功能
- 移除了主题ID获取和URL构建相关代码
- 简化了API初始化器中的条件判断逻辑
- 保留了实验性屏幕组件和用户颜色选择器的渲染功能
2026-02-20 09:41:57 +08:00
shiran a1bdaa8052 chore(theme): 更新主题配置信息
Discourse Theme / ci (push) Failing after 0s
- 修改主题名称为 Horizon-shiran
- 更新作者信息为 shiran
- 移除 about_url 链接
- 更新 license_url 指向新的代码仓库地址
- 移除 learn_more 链接
- 保持主题版本号为 0.0.1
- 保留 svg 图标配置
2026-02-20 09:40:08 +08:00
shiran 9e9ec24d56 style(topic-cards): 更新话题卡片样式以增强视觉效果
Discourse Theme / ci (push) Failing after 1s
- 移除话题列表项的底部边框
- 替换原有的阴影效果为更现代的多层阴影设计
- 移除卡片边框并添加渐变背景遮罩层
- 添加悬停时的变换动画和阴影过渡效果
- 优化选中状态的阴影和高亮显示
- 调整悬停和选中状态的颜色与透明度参数
2026-02-20 09:36:53 +08:00
shiran f9130b87b5 docs(readme): 更新 README 文档以详细说明 Horizon 主题源码结构
Discourse Theme / ci (push) Failing after 1s
- 添加项目作用说明,包括视觉改造、交互增强、页面体验调整等功能描述
- 新增目录结构详解,涵盖 .github、assets、common、desktop、javascripts 等目录作用
- 添加 locales、scss、screenshots、spec、test 等目录的详细功能说明
- 新增根目录文件作用介绍,包括 about.json、settings.yml、package.json 等配置文件
- 添加关键功能对应关系表格,便于快速定位配色切换、侧边栏按钮、卡片化等功能实现
- 保留原 DEPRECATED 说明,并补充当前仓库的学习参考价值说明
2026-02-20 09:32:21 +08:00
Martin Brennan c01e0da0ea DEV: Deprecate theme, add admin notice (#190)
The Horizon theme will soon be installed by default in Discourse, and
all development will be done there. This commit shows a warning for
admins telling them to switch to the new theme.
2025-06-30 09:22:29 +10:00
chapoi 35d4103757 UX: hide category image on categories page (#192) 2025-06-27 18:25:48 +02:00
9 changed files with 371 additions and 37 deletions
+150 -2
View File
@@ -1,3 +1,151 @@
Horizon is a simple, beautiful theme that improves the out-of-the-box experience for Discourse sites.
# discourse_theme_ranHorizon 主题源码)
https://meta.discourse.org/t/horizon-theme/360486
> 该仓库是 Discourse `Horizon (beta)` 主题的源码副本。仓库内原 README 已标注该主题已并入 Discourse Core。
## 1. 项目作用
这是一个 Discourse 主题项目,核心目标是:
- 改造论坛整体视觉(卡片化主题列表、圆角、配色系统、侧边栏样式)
- 增强交互(侧边栏新建主题按钮、颜色方案切换、Composer Peek 模式)
- 调整不同页面体验(分类页、主题页、聊天页、登录页、移动端)
- 提供系统测试,验证主题关键行为
---
## 2. 目录结构与作用
### `.github/`
- `workflows/discourse-theme.yml`CI 配置,复用 Discourse 官方主题工作流。
### `assets/`
- `.gitkeep`:占位目录,预留静态资源(当前无实际资源文件)。
### `common/`
- `common.scss`:公共样式入口,按模块聚合 `scss/` 下样式。
- `color_definitions.scss`:主题色变量定义(基于 tertiary 推导背景、链接、侧边栏等)。
- `head_tag.html`:注入浏览器兼容检测脚本,不支持 `hsl(from ...)` 时提示升级浏览器。
### `desktop/`
- `desktop.scss`:桌面端样式入口。
- `desktop-full-width.scss`:全宽布局与头部网格布局规则。
- `desktop-horizon-fixes.scss`:桌面端修复(如 bulk select 样式/布局修正)。
### `javascripts/`
- `.gitkeep`:占位。
- `discourse/api-initializers/`:通过 Discourse API 注入主题行为。
- `horizon.gjs`:主题主初始化器;注册实验装饰层、配色选择器、站点设置覆盖、管理员弃用提示。
- `sidebar-new-topic-button-connector.js`:把自定义“新建主题”按钮渲染到侧边栏。
- `composer-peek-toggle-connector.js`:把 Peek 模式切换按钮挂到 composer 工具区。
- `full-width-logo-behavior.js`:侧边栏展开时控制 Logo 最小化行为。
- `reposition-bulk-select.js`:将批量选择入口放到导航控制区。
- `hamburger-click-outside-transformer.js`:扩展汉堡菜单“点击外部关闭”例外元素。
- `discourse/components/`Glimmer 组件。
- `experimental-screen.gjs`:主内容四角/底部装饰层组件(根据容器位置实时计算)。
- `sidebar-new-topic-button.gjs`:侧边栏新建主题按钮逻辑(权限、分类只读、草稿、关闭汉堡菜单)。
- `composer-peek-mode-toggle.gjs`Composer Peek 模式开关,偏好写入 `keyValueStore`
- `user-color-palette-selector.gjs`:用户配色切换主组件(支持匿名/登录、明暗配套、CSS 热替换)。
- `user-color-palette-menu-item.gjs`:配色菜单项。
- `discourse/components/card/`:主题列表卡片列组件。
- `topic-status-column.gjs`Pinned/Hot 状态徽章。
- `topic-category-column.gjs`:分类列。
- `topic-creator-column.gjs`:主题创建者头像列。
- `topic-replies-column.gjs`:回复数列。
- `topic-likes-column.gjs`:点赞数列(当前主题列表布局中未启用展示)。
- `topic-activity-column.gjs`:最近活动信息(回复/创建/更新与时间)。
- `discourse/initializers/topic-list-columns.gjs`:重排主题列表列、注入卡片列、改写点击行为与移动布局策略。
### `locales/`
- `en.yml`:主题文案与元数据(如 `topic_hot``topic_pinned`、描述文本)。
### `scss/`
按功能拆分的样式模块(由 `common/common.scss``desktop/desktop.scss` 聚合):
- `variables.scss`:全局尺寸/圆角/间距变量。
- `main.scss`:页面主体容器网格与背景结构。
- `topic-cards.scss`:主题列表卡片化布局核心样式。
- `topic.scss`:主题阅读页、时间线、帖子流样式。
- `categories-view.scss`:分类页与分类+最新混合页样式。
- `sidebar.scss`:侧边栏容器/section/链接样式。
- `sidebar-new-topic-button.scss`:侧边栏新建主题按钮视觉与状态。
- `header.scss`:顶部栏、通知菜单、图标交互样式。
- `nav-pills.scss`:列表导航区(sticky、tab/下拉)样式。
- `buttons.scss`:按钮体系(默认/主按钮 hover、focus、active)。
- `composer.scss`:编辑器外观与工具条、翻译 composer 相关样式。
- `composer-peek-mode.scss`Peek 模式下 composer 与主布局联动。
- `chat.scss`:聊天页/聊天抽屉适配。
- `welcome-banner.scss`:欢迎横幅和搜索区域样式。
- `mobile-stuff.scss`:移动端/小屏布局调整。
- `login.scss`:登录类页面布局样式。
- `misc.scss`:分散组件兼容/补丁样式。
- `hiddenstuff.scss`:隐藏部分原生 UI 元素。
- `color-choice.scss`:配色切换菜单样式。
- `color-exploration.scss`:侧边栏等颜色变量实验定义。
- `box-view.scss`:实验装饰层(四角遮罩)与聊天相关视觉细节。
- `desktop-full-width.scss``desktop-horizon-fixes.scss`:虽然在 `scss/` 目录下存在同名文件,实际桌面入口使用 `desktop/` 目录版本。
### `screenshots/`
- `light.png``dark.png`:主题明/暗模式截图,供主题元信息展示。
### `spec/`
系统测试(RSpec + Capybara):
- `system/core_features_spec.rb`:主题与核心能力兼容性基础测试。
- `system/horizon_high_level_spec.rb`:高层端到端流程(主题列表、导航、配色切换)。
- `system/sidebar_topic_button_spec.rb`:侧边栏新建主题按钮行为测试。
- `system/composer_peek_spec.rb`Peek 模式可见性与持久化测试。
- `system/user_color_palette_selector_spec.rb`:配色切换在匿名/登录/深色模式下的行为测试。
- `system/page_objects/components/user_color_palette_selector.rb`:配色选择器的 PageObject 封装。
- `.gitkeep`:占位。
### `test/`
- `acceptance/.gitkeep`:预留前端测试目录(当前无具体测试文件)。
---
## 3. 根目录文件作用
- `about.json`:主题元数据(名称、作者、链接、版本、颜色方案、截图、modifiers)。
- `settings.yml`:主题设置项(欢迎横幅开关、搜索体验模式)。
- `README.md`:项目说明文档(本文件)。
- `LICENSE`MIT 许可证。
- `package.json`:前端开发依赖与 Node/pnpm 版本约束。
- `pnpm-lock.yaml`:前端依赖锁定文件。
- `Gemfile` / `Gemfile.lock`Ruby 工具链依赖(rubocop-discourse、syntax_tree 等)。
- `.discourse-compatibility`:与 Discourse 版本兼容映射。
- `eslint.config.mjs`ESLint 配置(继承 `@discourse/lint-configs`)。
- `stylelint.config.mjs`Stylelint 配置。
- `.template-lintrc.cjs`Ember Template Lint 配置。
- `.prettierrc.cjs`Prettier 配置。
- `.rubocop.yml`Rubocop 配置(Discourse 规则)。
- `.streerc`Syntax Tree 格式化配置。
- `.npmrc`:npm 行为约束(严格引擎、禁自动 peer 安装)。
- `.gitignore`Git 忽略规则。
---
## 4. 关键功能对应关系(便于快速定位)
- 主题配色切换:
- 逻辑:`javascripts/discourse/components/user-color-palette-selector.gjs`
- 菜单样式:`scss/color-choice.scss`
- 颜色定义:`about.json` + `common/color_definitions.scss`
- 侧边栏新建主题按钮:
- 逻辑:`javascripts/discourse/components/sidebar-new-topic-button.gjs`
- 挂载:`javascripts/discourse/api-initializers/sidebar-new-topic-button-connector.js`
- 样式:`scss/sidebar-new-topic-button.scss`
- 主题列表卡片化:
- 列注册:`javascripts/discourse/initializers/topic-list-columns.gjs`
- 各列组件:`javascripts/discourse/components/card/*.gjs`
- 主样式:`scss/topic-cards.scss`
- Composer Peek 模式:
- 逻辑:`javascripts/discourse/components/composer-peek-mode-toggle.gjs`
- 挂载:`javascripts/discourse/api-initializers/composer-peek-toggle-connector.js`
- 样式:`scss/composer-peek-mode.scss`
---
## 5. 说明
- 此仓库 README 原文已声明:该主题已并入 Discourse Core,生产环境优先使用 Core 内置 Horizon 主题。
- 当前仓库更适合作为学习/二次开发参考,用于理解 Discourse 主题的样式组织方式与前端扩展点。
+5 -5
View File
@@ -1,9 +1,9 @@
{
"name": "Horizon",
"authors": "Design Team",
"about_url": "https://meta.discourse.org/t/horizon-theme/360486",
"license_url": "https://github.com/discourse/horizon/blob/main/LICENSE",
"learn_more": "https://meta.discourse.org/t/installing-a-theme-or-theme-component/63682",
"name": "Horizon-shiran",
"authors": "shiran",
"about_url": "",
"license_url": "https://gitea.s1f.ren/shiran/discourse_theme_ran/horizon/blob/main/LICENSE",
"learn_more": "",
"theme_version": "0.0.1",
"modifiers": {
"svg_icons": ["fire"],
+1
View File
@@ -18,3 +18,4 @@
@import "topic";
@import "topic-cards";
@import "variables";
@import "self";
+1 -1
View File
@@ -1,6 +1,6 @@
en:
theme_metadata:
description: "A simple, beautiful theme that improves the out of the box experience for Discourse sites."
description: "自制二次元的半透明主题"
topic_pinned: "Pinned"
topic_hot: "Hot"
user_replied: "replied"
+8 -2
View File
@@ -4,7 +4,8 @@
.category-list {
border-collapse: separate;
th.topics {
th.topics,
.category-logo {
display: none;
}
@@ -224,7 +225,8 @@
margin-inline: 1rem;
.num.posts,
.category-topics-count {
.category-topics-count,
.category-logo {
display: none;
}
@@ -261,6 +263,10 @@
}
.category-boxes.with-subcategories {
.category-logo {
display: none;
}
@include viewport.from(sm) {
margin-top: 0;
}
+23 -5
View File
@@ -3,6 +3,7 @@
.topic-list-header {
position: relative;
top: 0;
z-index: 2;
}
.topic-author-avatar-data {
@@ -28,18 +29,29 @@
}
.topic-list-header {
position: relative;
margin-bottom: 0.35rem;
tr {
border: none;
}
.topic-list-data {
padding: 0;
padding: 0.25rem 0;
color: var(--primary-600);
font-size: var(--font-down-2);
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
background: transparent;
&:not(.default) {
display: none;
}
&.default {
border-radius: var(--d-border-radius);
.bulk-select,
span:not(.bulk-select-topics, .d-button-label) {
display: none;
@@ -50,16 +62,22 @@
// bulk select
.bulk-select-topics {
position: absolute;
right: 0;
background: var(--secondary);
border-radius: 0 0 0 var(--d-border-radius);
right: 0.25rem;
top: 50%;
transform: translateY(-50%);
background: color-mix(in srgb, var(--d-content-background) 88%, white 12%);
border: 1px solid var(--primary-200);
border-radius: 999px;
box-shadow: 0 6px 18px -12px rgb(10 18 35 / 35%);
display: flex;
gap: 0.5rem;
margin: 0.5rem;
margin: 0;
padding: 0.25rem;
button {
white-space: nowrap;
margin: 0;
border-radius: 999px;
}
}
}
+127
View File
@@ -0,0 +1,127 @@
@use "lib/viewport";
#main-outlet {
@if $home_bg_image != "" {
background-image: url($home_bg_image);
background-size: cover;
background-position: center;
background-attachment: fixed;
}
}
.container.list-container{
position: relative;
}
.container.list-container::before{
position: absolute;
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background-color: #fff9;
border-radius: var(--d-border-radius);
backdrop-filter: blur(10px);
box-shadow: #00000077 0 0 19px 0;
}
.topic-list-header{
background-color: unset;
}
.list-controls, .search-container{
border-radius: var(--d-border-radius);
}
.welcome-banner {
padding: 0 !important;
box-shadow: #00000094 0 0 11px 0;
}
#list-area, .topic-list-header, .admin-detail{
background-color: unset !important;
}
.user-content, .details{
border-radius: var(--d-border-radius);
}
.regular.ember-view, .user-main, .reviewable,
.admin-content, .contents.clearfix.body-page,
.search-container, .show-badge, .users-directory, #main-outlet>.edit-category,
#main-outlet>.container.groups-index,
.container.group{
background-color: #ffffffa8 !important;
border-radius: var(--d-border-radius);
backdrop-filter: blur(32px);
box-shadow: #00000077 0 0 19px 0;
padding: 24px;
}
.topic-post.clearfix.regular, .post-list-item.user-stream-item,
.search-header, .admin-plugin-config-page__content,
.user-main .about.collapsed-info .details,
.ember-view.group-box, .admin-container>.container.groups-index{
background: var(--d-chat-input-bg-color);
border-radius: var(--d-border-radius);
box-shadow: #00000024 0 0 7px 2px;
margin: 10px 0;
position: relative;
padding: 16px 12px;
overflow: hidden;
transition: background-color 0.2s ease-in-out;
}
.user-content{
background-color: unset;
}
.powered-by-discourse{
display: none;
}
// 默认光标
@if $default_cursor != "" {
* {
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;
}
}
+30 -22
View File
@@ -9,11 +9,7 @@
}
.topic-list > .topic-list-body > .topic-list-item.last-visit {
border-bottom: 1px solid var(--primary-300);
&:hover {
border-color: var(--accent-color);
}
border-bottom: none;
}
.topic-list,
@@ -22,8 +18,8 @@
border-radius: var(--d-border-radius);
padding: 3px 6px;
background-color: light-dark(
oklch(from var(--category-badge-color) 97% calc(c * 0.3) h),
oklch(from var(--category-badge-color) 45% calc(c * 0.5) h)
oklch(from var(--category-badge-color) 97% calc(c * 0.3) h),
oklch(from var(--category-badge-color) 45% calc(c * 0.5) h)
);
@include viewport.until(md) {
@@ -33,8 +29,8 @@
.badge-category__name {
color: light-dark(
oklch(from var(--category-badge-color) 20% calc(c * 1) h),
oklch(from var(--category-badge-color) 100% calc(c * 0.9) h)
oklch(from var(--category-badge-color) 20% calc(c * 1) h),
oklch(from var(--category-badge-color) 100% calc(c * 0.9) h)
);
}
}
@@ -72,11 +68,11 @@
.topic-list-body .topic-list-item {
position: relative;
background: var(--d-content-background);
box-shadow: 0 0 12px 1px var(--topic-card-shadow);
background: linear-gradient(45deg, var(--active-color), rgb(255 255 255 / 25%));
box-shadow: 4px 4px 6px 0px rgba(10, 18, 35, .38), 0 6px 16px -10px var(--topic-card-shadow);
text-overflow: ellipsis;
padding: var(--space-3);
border: 1px solid var(--primary-300);
border: none;
display: grid;
grid-template-columns: min-content min-content min-content auto min-content;
grid-template-areas:
@@ -85,6 +81,18 @@
grid-gap: var(--space-3);
border-radius: var(--d-border-radius);
cursor: pointer;
transition:
all 0.2s ease;
&::before {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
padding: 1px;
mask-composite: exclude;
pointer-events: none;
}
&.has-replies {
grid-template-areas:
@@ -144,16 +152,16 @@
}
&:hover {
.discourse-no-touch & {
border-color: var(--accent-color);
background: var(--d-content-background);
}
background: var(--active-color);
box-shadow: 4px 5px 3px 1px rgba(0, 0, 0, .2), 0 8px 20px -10px var(--topic-card-shadow);
border-left: 5px solid #0006;
}
&.selected {
box-shadow:
0 0 0 2px var(--accent-color),
0 0 12px 1px var(--topic-card-shadow);
0 14px 32px -14px rgb(10 18 35 / 48%),
0 0 0 2px oklch(from var(--accent-color) l calc(c * 0.45) h / 0.28),
0 0 0 8px oklch(from var(--accent-color) l calc(c * 0.2) h / 0.14);
}
&.excerpt-expanded {
@@ -235,8 +243,8 @@
}
padding: 0.25em 0.5rem;
background-color: light-dark(
oklch(from var(--category-badge-color) 97% calc(c * 0.3) h),
oklch(from var(--category-badge-color) 45% calc(c * 0.5) h)
oklch(from var(--category-badge-color) 97% calc(c * 0.3) h),
oklch(from var(--category-badge-color) 45% calc(c * 0.5) h)
);
@include viewport.until(md) {
@@ -251,8 +259,8 @@
.badge-category__name {
font-size: var(--font-down-1);
color: light-dark(
oklch(from var(--category-badge-color) 20% calc(c * 1) h),
oklch(from var(--category-badge-color) 100% calc(c * 0.9) h)
oklch(from var(--category-badge-color) 20% calc(c * 1) h),
oklch(from var(--category-badge-color) 100% calc(c * 0.9) h)
);
min-width: 0;
overflow: hidden;
+26
View File
@@ -9,3 +9,29 @@ search_experience:
- search_field
- search_icon
description: "Overrides the core `search experience` site setting"
home_bg_image:
type: upload
default: ""
description: "首页背景图"
default_cursor:
type: upload
default: ""
description: "默认光标 SVG 文件"
hover_cursor:
type: upload
default: ""
description: "悬停光标 SVG 文件"
pointer_cursor:
type: upload
default: ""
description: "链接光标 SVG 文件"
text_cursor:
type: upload
default: ""
description: "文本光标 SVG 文件"