Compare commits

...

55 Commits

Author SHA1 Message Date
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
Martin Brennan abf22a6668 UX: Only hide welcome banner on mobile devices (#189) 2025-06-23 12:02:35 +02:00
chapoi c6000c996f UX: show replies in shortened form (#187)
![CleanShot 2025-06-20 at 09 52
13@2x](https://github.com/user-attachments/assets/213416c6-24a6-41e1-84d2-04d157f11999)
![CleanShot 2025-06-20 at 09 52
25@2x](https://github.com/user-attachments/assets/34384e2c-6f4e-4933-ae35-d47102982db1)
2025-06-20 11:39:31 +02:00
chapoi ffa86a0c46 UX: hide welcome banner (#188)
Until we move forward with the search-banner on mobile, the
welcome-message feels out of place. Hiding it for now.
2025-06-20 11:39:20 +02:00
Martin Brennan bb512645d1 UX: Unhide topics footer-message (#180)
This needs to be unhidden so the changes in the following core PR are
visible in horizon:

https://github.com/discourse/discourse/pull/32669
2025-06-19 12:56:37 +02:00
chapoi dac23d544c UX: Categories restyling (#184)
Some CSS sprinkling for our most used category list formats:
### Desktop: Categories and Latest Topics 
| Default | Horizon |
|--------|--------|
| ![CleanShot 2025-06-17 at 17 28
45@2x](https://github.com/user-attachments/assets/4babf4d4-9c25-4780-bb72-c37b13d6f843)|
![CleanShot 2025-06-17 at 17 28
08@2x](https://github.com/user-attachments/assets/741a24fe-fca4-4eb8-97c9-96f5eb30b575)
|

### Desktop: Boxes with Subcategories
| Default | Horizon |
|--------|--------|
| ![CleanShot 2025-06-17 at 15 09
07@2x](https://github.com/user-attachments/assets/21e71f3b-b795-44d8-b56c-7edbe8fc465c)
| ![CleanShot 2025-06-17 at 17 29
46@2x](https://github.com/user-attachments/assets/41707610-cd09-4ebd-8fee-0f637e154fbf)
|

### Mobile: Categories with Featured Topics
| Default | Horizon |
|--------|--------|
| ![CleanShot 2025-06-17 at 17 30
53@2x](https://github.com/user-attachments/assets/665b6f19-c3d3-4438-8960-2170d0c69af3)
| ![CleanShot 2025-06-17 at 17 30
27@2x](https://github.com/user-attachments/assets/ca0fd595-1b0d-4ee9-b805-c538e4cdbc90)
|
2025-06-18 15:23:24 +02:00
chapoi 1e5f71473a UX: remove default select state for keyboard nav on topic cards (#186)
The left-border select state when using keyboard navigation is already
overruled in Horizon, but when bulk-select is enabled, this still showed
up:

![CleanShot 2025-06-18 at 12 28
16@2x](https://github.com/user-attachments/assets/e1b9bfbc-aceb-429a-8890-fb56f7e12048)

Fixed:
![CleanShot 2025-06-18 at 12 29
09@2x](https://github.com/user-attachments/assets/40572de6-a316-4f7b-8786-9040f513b6c8)
2025-06-18 15:22:31 +02:00
chapoi 6d8415579e UX: fix topic cards layout for messages with has-replies class (#183)
The `grid-template-areas` were not correct on the messages page

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Martin Brennan <martin@discourse.org>
2025-06-18 13:34:26 +10:00
chapoi 2bcd04d4f4 UX: topic cards v3 (#182)
* Bringing back the OP
* Removed reason why topic appears (again) in topic list (="activity")
* Removed likes
* New layout with indention + moved all elements left (on desktop)

| Mobile | Desktop |
|--------|--------|
| ![CleanShot 2025-06-13 at 11 00
19@2x](https://github.com/user-attachments/assets/f43a773d-c8ba-4573-b16a-940e9fc3d901)
| ![CleanShot 2025-06-13 at 11 05
10@2x](https://github.com/user-attachments/assets/6bb152df-9ed3-4866-8c0a-95ddf94cd773)
|
| ![CleanShot 2025-06-13 at 11 02
25@2x](https://github.com/user-attachments/assets/3d9fb41c-a894-4b07-8737-6bd03e513f2f)
| ![CleanShot 2025-06-13 at 11 06
59@2x](https://github.com/user-attachments/assets/c54b9efe-fd1d-40aa-b8ad-2e4eab54eb90)
|
| ![CleanShot 2025-06-13 at 11 03
28@2x](https://github.com/user-attachments/assets/cdad49e8-ae6d-4f2c-9ef5-f6fa42705764)
| ![CleanShot 2025-06-13 at 11 07
10@2x](https://github.com/user-attachments/assets/91fee5ad-71b7-400c-a2c7-80339438b8de)
|
| ![CleanShot 2025-06-13 at 11 04
09@2x](https://github.com/user-attachments/assets/85296a16-f052-4787-a260-81fa54cd6191)
| ![CleanShot 2025-06-13 at 11 07
24@2x](https://github.com/user-attachments/assets/ffcaecb0-767a-4a72-8244-a3baa56d3cc2)
|
| ![CleanShot 2025-06-13 at 11 04
26@2x](https://github.com/user-attachments/assets/48a05ef5-366f-4543-bf0e-441ecae39877)
| ![CleanShot 2025-06-13 at 11 04
48@2x](https://github.com/user-attachments/assets/50499b4d-60bf-4b41-8a42-6fba8e0a41d8)
|

---------

Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
2025-06-13 11:08:57 +02:00
Jordan Vidrine 05416abe70 DEV: Topic creator fix (#181) 2025-06-11 14:03:52 -05:00
chapoi 14aa72ad99 UX: Mini fixes and tweaks (#179)
* Changing the category & tag dropdown back into their original form.
The breadcrumb idea isn't working well.

| BC | AC |
|--------|--------|
| ![CleanShot 2025-06-09 at 18 59
37@2x](https://github.com/user-attachments/assets/cbeb3aaf-ad0e-4085-8548-58ea0a521c95)
| ![CleanShot 2025-06-09 at 18 57
33@2x](https://github.com/user-attachments/assets/15db752b-4983-4b7f-b6f8-9a8ded9e6f9f)
|

* Alignment fix in chat navbar drawer

| BC | AC |
|--------|--------|
| ![CleanShot 2025-06-09 at 18 59
18@2x](https://github.com/user-attachments/assets/38c7dcee-dc77-4a44-ae8d-5ecb7910536b)
| ![CleanShot 2025-06-09 at 18 58
36@2x](https://github.com/user-attachments/assets/be699f88-4e5e-4d8c-ab4d-f6d1eca93037)
|
2025-06-09 19:41:18 +02:00
Jarek Radosz bf9fe07f67 DEV: Update linting config and run gjs-codemod (#177) 2025-06-06 12:15:57 +01:00
Jordan Vidrine 31249c4f27 UX: Remove unused line & fix ipad safari browser (#176) 2025-06-04 14:55:25 -05:00
Kris 581332c001 UX: fix mobile timeline in PWA (#174) 2025-06-04 14:55:02 -04:00
chapoi f5c4403423 UX: increase spacing of topic cards (#175)
Slightly bigger spacing to match the bigger avatars (bigger elements =>
more spacing to balance it out)
2025-06-04 16:04:11 +02:00
chapoi b72a3c1e95 UX: Topic cards v2 (#173)
This is the second iteration on the topic card design, in which we bring
back the OP and change the layout.

**Changes**:
* Show OP avatar
* Remove activity avatar and replace by reply icon
* Remove activity icon background
* Move category tag to top left
* Replace long activity copy ("…replied at…") with dot separator
* Change date formatting to `tiny`
* Adjust bulk select styling to new layout + align checkbox to top on
mobile VS keep centred on desktop

* Why: On desktop, the avatar is taking 2 lines (usually) and aligning
the checkbox vertically looks nice. Exception for excerpts, but since
that's only available for pinned topics atm that's a low occurrence. On
mobile, the topic card is 3 lines, with a smaller avatar, which makes
the checkbox "float" around a bit when centred. Hence aligning it to the
top, which for solid avatars aligns nicely too.

* CSS refactor: grid, breakpoints

Messages/bookmarks have not been changed.

| Description | Visual |
|--------|--------|
| Large topic list | ![CleanShot 2025-06-02 at 17 37
35@2x](https://github.com/user-attachments/assets/f232058e-dbf6-4689-abe3-65970464a3e3)|
| Large bulk edit | ![CleanShot 2025-06-02 at 17 37
17@2x](https://github.com/user-attachments/assets/03d86b5f-d62b-4449-9c0b-452ceb8be60c)
|
| Medium topic list | ![CleanShot 2025-06-02 at 17 39
01@2x](https://github.com/user-attachments/assets/80739641-cf8f-4095-938f-9781cac57a7d)
|
| Medium bulk edit | ![CleanShot 2025-06-02 at 17 39
24@2x](https://github.com/user-attachments/assets/6e9045af-734a-4f3f-830a-e03a2f06fdd8)
|
| Small topic list | ![CleanShot 2025-06-02 at 17 39
44@2x](https://github.com/user-attachments/assets/eeca80bc-6863-4026-8f19-b1b5cf6848f3)
|
| Small bulk edit | ![CleanShot 2025-06-02 at 17 40
00@2x](https://github.com/user-attachments/assets/cde7be08-cde2-4ff2-b81b-328d3d7be848)
|
| Messages page (remains unchanged) | ![CleanShot 2025-06-02 at 17 20
37@2x](https://github.com/user-attachments/assets/6512bfe9-a699-4c67-b709-166540ee6fde)
|
| Bookmark page (remains unchanged) | ![CleanShot 2025-06-02 at 17 21
01@2x](https://github.com/user-attachments/assets/f8f43638-e911-49cb-a0d5-ebcb51ccfba4)
|
2025-06-04 14:50:41 +02:00
Jordan Vidrine 0ed3912d63 UX: Fix topic card messages (#172) 2025-05-30 08:39:39 -05:00
Jordan Vidrine fc6d1b5b9d UX: RTL positioning of boxed view (#170) 2025-05-28 15:42:57 -05:00
Ella E. bd93d46ef4 DEV: Add screenshots (#169) 2025-05-23 21:33:01 -06:00
Kris 04d8684b59 UX: fix new topic badge in topic list (#167)
The theme implements this in a centralized way, so we need to remove the
core implementation.

before:


![image](https://github.com/user-attachments/assets/a9b37f79-d464-43e9-9298-3607180162ec)


after:


![image](https://github.com/user-attachments/assets/bd3c79b5-6371-4439-86a2-5f91e44f04ca)
2025-05-21 10:54:24 -04:00
Kris 79be7731b7 UX: adjust event date alignment with topic titles (#165)
this regressed slightly with core changes 

before:

![image](https://github.com/user-attachments/assets/550df0f8-fb8d-4af3-b4ec-5a61834d8a45)


after:

![image](https://github.com/user-attachments/assets/5c06f32d-ee31-444e-90f7-c31f9c44f642)
2025-05-21 09:59:21 -04:00
David Taylor fe1cb262dc UX: Allow clicking anywhere on the topic-list card (#166) 2025-05-21 13:37:21 +01:00
chapoi 25cc070a5b UX: fix low z-index for popup after changes to composer-drawer interaction (#164)
Fixing:
![CleanShot 2025-05-20 at 11 58
11@2x](https://github.com/user-attachments/assets/68611ead-71bf-42bf-bd87-183f589f4b82)

Consequence of #161
2025-05-20 14:22:21 +02:00
Kris 7982d60967 UX: add compatibility with the top contributors sidebar (#162)
Improves compatibility with
https://meta.discourse.org/t/top-contributors-sidebar/215110

Before:

![image](https://github.com/user-attachments/assets/08994458-0322-4725-a66b-0c91712e3a2a)


After: 

![image](https://github.com/user-attachments/assets/de231b57-d6da-42c0-852e-2bf915ee929e)

---------

Co-authored-by: Jarek Radosz <jarek@cvx.dev>
2025-05-19 11:26:11 -04:00
chapoi 90eae2d3f1 Chat drawer and peakmode (#161)
To avoid very strange positioning and sizing, I'm opting to keep the
chat in front of the composer, when in peak-mode.
Still not ideal, but better than before.

![CleanShot 2025-05-14 at 13 11
16@2x](https://github.com/user-attachments/assets/9b28f097-a63b-4bbb-a016-68cbcd04ee3c)
⬇️ 
![CleanShot 2025-05-14 at 13 10
57@2x](https://github.com/user-attachments/assets/10b9c17e-1207-4775-8933-0f6aca8c3ab6)

Due to the way peakmode positions itself, it's impossible to place the
chat flush next to it. And due to the way resizing works (frop the top
left, anchored right), it also can't be placed on any left-handed
alignment.
2025-05-16 12:24:05 +02:00
Joffrey JAFFEUX 948c60d656 FIX: do not error when no palettes are available (#160)
To repro this you had to unchecked all the "Color palette can be
selected by users" from the colors tab.
2025-05-12 19:18:15 -03:00
Kris 86d0c03b03 UX: handle opening composer from slide-in hamburger menu (#159) 2025-05-12 12:04:38 -04:00
Kris d749920db7 UX: improve mobile event badge positioning (#156) 2025-05-10 13:46:15 -04:00
Keegan George eda0db294d UX: Improve styles for add translation composer view (#158)
## 🔍 Overview
This update ensures styles in composer look appropriate for the new
composer add translation view (recently added here:
https://github.com/discourse/discourse/pull/32564)


## 📷 Screenshots

### ← Before
<img width="1473" alt="Screenshot 2025-05-08 at 11 58 54"
src="https://github.com/user-attachments/assets/76fec3f6-1cbf-4b57-a765-c2cf003ba177"
/>

### → After
<img width="1476" alt="Screenshot 2025-05-08 at 11 58 42"
src="https://github.com/user-attachments/assets/f17e8dc5-3230-4a1f-9072-28a3c7415958"
/>
2025-05-08 12:17:42 -07:00
Jarek Radosz c2b71c04a8 DEV: Update linting (#153) 2025-05-06 16:53:12 +01:00
Kris ec532d356e UX: exclude wizard from #main-outlet background styling (#155)
Only a tiny sliver of the background shows currently, which seems
accidental

Before:

![image](https://github.com/user-attachments/assets/815b9dec-7708-44a1-b360-7394e42cc4f6)


After:

![image](https://github.com/user-attachments/assets/b2eaf893-3e41-4321-b836-873b691589c5)
2025-05-05 12:35:14 -04:00
Kris 755a666dae UX: hide bootstrap mode from header (#154)
There are multiple header elements that get in the way, and we can't
really manage the position of this button well without a better
full-width solution... so I think it makes sense to hide it for now


Before:

![image](https://github.com/user-attachments/assets/07009232-d188-4a5f-9381-0e1d4479512b)

After: 

![image](https://github.com/user-attachments/assets/91a0f01a-3d12-4f89-9d7f-0050abdd47e9)
2025-05-05 12:35:00 -04:00
Keegan George 4b159e9296 UX: New topic button shouldn't appear in AI conversations page (#152)
## 🔍 Overview
This update ensures that the sidebar new topic button isn't shown on the
AI conversations sidebar. It also styles the new conversation button to
make use of Horizon's accent color

## 📸 Screenshots

### ← Before
<img width="1228" alt="Screenshot 2025-05-02 at 14 16 41"
src="https://github.com/user-attachments/assets/b187d31e-881a-4c34-b663-f4b55b8bc565"
/>

### → After
<img width="1232" alt="Screenshot 2025-05-02 at 14 15 34"
src="https://github.com/user-attachments/assets/987cfba3-ad7c-49a9-80d8-14c3e52dd5c0"
/>
2025-05-05 09:27:28 -07:00
Kris e53184ac28 UX: fix experimental new new positioning (#151)
These styles were added for bulk select positioning, but turns out they
weren't needed anyway

before:

![image](https://github.com/user-attachments/assets/bf752846-cb51-4872-9cb7-2d98ab7f5c8f)

after:

![image](https://github.com/user-attachments/assets/4a25c776-b88c-4be6-b186-31973c6b5e05)
2025-04-25 11:35:00 -04:00
Kris a6293aa24b UX: text logo line-height fix (#150)
Minor adjustment to avoid clipping descenders 


before:

![image](https://github.com/user-attachments/assets/bc68416b-ab04-4a62-8bff-ec8164284380)


after: 

![image](https://github.com/user-attachments/assets/30296e9c-4e8d-446f-8ee4-f0583e6c3e68)
2025-04-24 14:22:07 -04:00
Kris 45cc99a2e0 UX: better full-width support for wide logos (#149)
Helps avoid situations like this:


![image](https://github.com/user-attachments/assets/78adec74-8fb7-457f-b592-da1b56a98b1a)


Some examples...


text-logos

![image](https://github.com/user-attachments/assets/c87333cb-727a-4167-af76-a5db0b3cd20c)

![image](https://github.com/user-attachments/assets/8cc62ab9-4f3e-4697-a763-851dc21aa2ec)

![image](https://github.com/user-attachments/assets/e36ffa7e-a3a9-463a-b448-833da2b3bc69)

image-logos

![image](https://github.com/user-attachments/assets/962f33c1-d83c-4d74-a707-ec1fb867d557)

![image](https://github.com/user-attachments/assets/0014505a-bfab-4616-962a-c1a5fa30938e)

![image](https://github.com/user-attachments/assets/32d9730a-1a43-49ac-b160-b6dd610f4482)
2025-04-24 14:04:06 -04:00
51 changed files with 2957 additions and 2432 deletions
+2
View File
@@ -0,0 +1,2 @@
< 3.5.0.beta5-dev: 31249c4f27d93e83c6b83d42d93974522a9a612e
+60 -44
View File
@@ -1,8 +1,9 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activesupport (7.2.1.1) activesupport (8.0.2)
base64 base64
benchmark (>= 0.3)
bigdecimal bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1) concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5) connection_pool (>= 2.2.5)
@@ -12,68 +13,83 @@ GEM
minitest (>= 5.1) minitest (>= 5.1)
securerandom (>= 0.3) securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5) tzinfo (~> 2.0, >= 2.0.5)
ast (2.4.2) uri (>= 0.13.1)
base64 (0.2.0) ast (2.4.3)
bigdecimal (3.1.8) base64 (0.3.0)
concurrent-ruby (1.3.4) benchmark (0.4.1)
connection_pool (2.4.1) bigdecimal (3.2.2)
drb (2.2.1) concurrent-ruby (1.3.5)
i18n (1.14.6) connection_pool (2.5.3)
drb (2.2.3)
i18n (1.14.7)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
json (2.7.2) json (2.12.2)
language_server-protocol (3.17.0.3) language_server-protocol (3.17.0.5)
logger (1.6.1) lint_roller (1.1.0)
minitest (5.25.1) logger (1.7.0)
parallel (1.26.3) minitest (5.25.5)
parser (3.3.5.0) parallel (1.27.0)
parser (3.3.8.0)
ast (~> 2.4.1) ast (~> 2.4.1)
racc racc
prettier_print (1.2.1) prettier_print (1.2.1)
prism (1.4.0)
racc (1.8.1) racc (1.8.1)
rack (3.1.10) rack (3.1.15)
rainbow (3.1.1) rainbow (3.1.1)
regexp_parser (2.9.2) regexp_parser (2.10.0)
rubocop (1.67.0) rubocop (1.76.0)
json (~> 2.3) json (~> 2.3)
language_server-protocol (>= 3.17.0) language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.3.0.2) parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0) regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0) rubocop-ast (>= 1.45.0, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0) unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.32.3) rubocop-ast (1.45.0)
parser (>= 3.3.1.0) parser (>= 3.3.7.2)
rubocop-capybara (2.21.0) prism (~> 1.4)
rubocop (~> 1.41) rubocop-capybara (2.22.1)
rubocop-discourse (3.8.2) lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-discourse (3.12.1)
activesupport (>= 6.1) activesupport (>= 6.1)
rubocop (>= 1.59.0) lint_roller (>= 1.1.0)
rubocop-capybara (>= 2.0.0) rubocop (>= 1.73.2)
rubocop-factory_bot (>= 2.0.0) rubocop-capybara (>= 2.22.0)
rubocop-rails (>= 2.25.0) rubocop-factory_bot (>= 2.27.0)
rubocop-rails (>= 2.30.3)
rubocop-rspec (>= 3.0.1) rubocop-rspec (>= 3.0.1)
rubocop-rspec_rails (>= 2.30.0) rubocop-rspec_rails (>= 2.31.0)
rubocop-factory_bot (2.26.1) rubocop-factory_bot (2.27.1)
rubocop (~> 1.61) lint_roller (~> 1.1)
rubocop-rails (2.26.2) rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.32.0)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0) rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0) rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.1.0) rubocop-rspec (3.6.0)
rubocop (~> 1.61) lint_roller (~> 1.1)
rubocop-rspec_rails (2.30.0) rubocop (~> 1.72, >= 1.72.1)
rubocop (~> 1.61) rubocop-rspec_rails (2.31.0)
rubocop-rspec (~> 3, >= 3.0.1) lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec (~> 3.5)
ruby-progressbar (1.13.0) ruby-progressbar (1.13.0)
securerandom (0.3.1) securerandom (0.4.1)
syntax_tree (6.2.0) syntax_tree (6.2.0)
prettier_print (>= 1.2.0) prettier_print (>= 1.2.0)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0) unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
PLATFORMS PLATFORMS
ruby ruby
@@ -83,4 +99,4 @@ DEPENDENCIES
syntax_tree syntax_tree
BUNDLED WITH BUNDLED WITH
2.5.21 2.6.9
+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 主题的样式组织方式与前端扩展点。
+7 -6
View File
@@ -1,9 +1,9 @@
{ {
"name": "Horizon", "name": "Horizon-shiran",
"authors": "Design Team", "authors": "shiran",
"about_url": "https://meta.discourse.org/t/horizon-theme/360486", "about_url": "",
"license_url": "https://github.com/discourse/horizon/blob/main/LICENSE", "license_url": "https://gitea.s1f.ren/shiran/discourse_theme_ran/horizon/blob/main/LICENSE",
"learn_more": "https://meta.discourse.org/t/installing-a-theme-or-theme-component/63682", "learn_more": "",
"theme_version": "0.0.1", "theme_version": "0.0.1",
"modifiers": { "modifiers": {
"svg_icons": ["fire"], "svg_icons": ["fire"],
@@ -130,5 +130,6 @@
"header_primary": "ffffff", "header_primary": "ffffff",
"hover": "584B3E" "hover": "584B3E"
} }
} },
"screenshots": ["screenshots/light.png", "screenshots/dark.png"]
} }
+3 -5
View File
@@ -1,6 +1,7 @@
html { html {
--accent-color: #{$tertiary} !important; --accent-color: #{$tertiary} !important;
--accent-text-color: #ffffff; --accent-text-color: #fff;
// Background Colors // Background Colors
--background-color: light-dark( --background-color: light-dark(
oklch(from #{$tertiary} 96% calc(c * 0.125) h), oklch(from #{$tertiary} 96% calc(c * 0.125) h),
@@ -10,6 +11,7 @@ html {
oklch(from #{$secondary} calc(2 * l) c h), oklch(from #{$secondary} calc(2 * l) c h),
oklch(from #{$secondary} l c h) oklch(from #{$secondary} l c h)
) !important; ) !important;
// HeaderColors // HeaderColors
--header_primary-low-mid: light-dark( --header_primary-low-mid: light-dark(
oklch(from #{$tertiary} 73.5% calc(c * 0.5) h), oklch(from #{$tertiary} 73.5% calc(c * 0.5) h),
@@ -40,17 +42,14 @@ html {
oklch(from #{$tertiary} 92% calc(c * 0.5) h), oklch(from #{$tertiary} 92% calc(c * 0.5) h),
oklch(from #{$tertiary} calc(l * 0.7) calc(c * 0.25) h) oklch(from #{$tertiary} calc(l * 0.7) calc(c * 0.25) h)
) !important; ) !important;
--d-nav-color--active: light-dark( --d-nav-color--active: light-dark(
oklch(from #{$tertiary} l c h), oklch(from #{$tertiary} l c h),
oklch(from #{$tertiary} calc(l * 1.2) c h) oklch(from #{$tertiary} calc(l * 1.2) c h)
) !important; ) !important;
--d-nav-color--hover: light-dark( --d-nav-color--hover: light-dark(
oklch(from #{$tertiary} l c h), oklch(from #{$tertiary} l c h),
oklch(from #{$tertiary} calc(l * 1.2) c h) oklch(from #{$tertiary} calc(l * 1.2) c h)
) !important; ) !important;
--link-color: light-dark( --link-color: light-dark(
oklch(from #{$tertiary} l c h), oklch(from #{$tertiary} l c h),
oklch(from #{$tertiary} calc(l * 0.95) c h) oklch(from #{$tertiary} calc(l * 0.95) c h)
@@ -78,7 +77,6 @@ html {
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 0.35) h), oklch(from #{$tertiary} calc(l * 1.5) calc(c * 0.35) h),
oklch(from #{$tertiary} calc(l * 0.75) calc(c * 0.5) h) oklch(from #{$tertiary} calc(l * 0.75) calc(c * 0.5) h)
) !important; ) !important;
--d-sidebar-highlight-hover-icon: var(--d-sidebar-link-color) !important; --d-sidebar-highlight-hover-icon: var(--d-sidebar-link-color) !important;
--d-sidebar-highlight-hover-background: var(--d-selected) !important; --d-sidebar-highlight-hover-background: var(--d-selected) !important;
--d-sidebar-link-icon-color: var(--d-sidebar-link-color) !important; --d-sidebar-link-icon-color: var(--d-sidebar-link-color) !important;
+2
View File
@@ -1,6 +1,7 @@
@import "box-view"; @import "box-view";
@import "buttons"; @import "buttons";
@import "chat"; @import "chat";
@import "categories-view";
@import "color-choice"; @import "color-choice";
@import "composer"; @import "composer";
@import "composer-peek-mode"; @import "composer-peek-mode";
@@ -17,3 +18,4 @@
@import "topic"; @import "topic";
@import "topic-cards"; @import "topic-cards";
@import "variables"; @import "variables";
@import "self";
+3 -2
View File
@@ -1,6 +1,7 @@
<script> <script>
if(!CSS.supports("(color: hsl(from white h s l))")){ if (!CSS.supports("(color: hsl(from white h s l))")) {
window.unsupportedBrowser = true; window.unsupportedBrowser = true;
window.I18n.translations[I18n.locale].js.browser_update = 'The Horizon theme does not support your browser. Please update your browser, or <a href="?safe_mode=no_themes">switch to safe mode</a>.'; window.I18n.translations[I18n.locale].js.browser_update =
'The Horizon theme does not support your browser. Please update your browser, or <a href="?safe_mode=no_themes">switch to safe mode</a>.';
} }
</script> </script>
@@ -0,0 +1,10 @@
import { apiInitializer } from "discourse/lib/api";
export default apiInitializer("0.8", (api) => {
api.registerValueTransformer(
"hamburger-dropdown-click-outside-exceptions",
({ value }) => {
return [...value, ".topic-drafts-menu-content"];
}
);
});
@@ -1,9 +1,6 @@
import Component from "@glimmer/component"; import Component from "@glimmer/component";
import avatar from "discourse/helpers/avatar";
import concatClass from "discourse/helpers/concat-class"; import concatClass from "discourse/helpers/concat-class";
import icon from "discourse/helpers/d-icon";
import formatDate from "discourse/helpers/format-date"; import formatDate from "discourse/helpers/format-date";
import { i18n } from "discourse-i18n";
export default class TopicActivityColumn extends Component { export default class TopicActivityColumn extends Component {
get topicUser() { get topicUser() {
@@ -27,37 +24,25 @@ export default class TopicActivityColumn extends Component {
}; };
} else if (this.args.topic.posts_count === 1) { } else if (this.args.topic.posts_count === 1) {
return { return {
user: this.args.topic.creator, user: this.args.topic.firstPosterUser,
username: this.args.topic.creator.username, username: this.args.topic.last_poster_username,
activityText: "user_posted", class: "--created",
class: "--posted",
}; };
} else {
return;
} }
} }
<template> <template>
<span class={{concatClass "topic-activity" this.topicUser.class}}> <span class={{concatClass "topic-activity" this.topicUser.class}}>
<div class="topic-activity__user">
{{#if this.topicUser.user}}
{{avatar this.topicUser.user imageSize="small"}}
{{else}}
{{icon "pencil"}}
{{/if}}
</div>
{{#if this.topicUser.username}} {{#if this.topicUser.username}}
<span <span
class="topic-activity__username" class="topic-activity__username"
>{{this.topicUser.username}}</span> >{{this.topicUser.username}}</span>
<span class="dot-separator"></span>
{{/if}} {{/if}}
<div class="topic-activity__reason">
{{i18n (themePrefix this.topicUser.activityText)}}
</div>
<div class="topic-activity__time"> <div class="topic-activity__time">
{{formatDate {{formatDate @topic.bumpedAt leaveAgo="true" format="tiny"}}
@topic.bumpedAt
leaveAgo="true"
format="medium-with-ago-and-on"
}}
</div> </div>
</span> </span>
</template> </template>
@@ -0,0 +1,17 @@
import Component from "@glimmer/component";
import avatar from "discourse/helpers/avatar";
export default class TopicCreatorColumn extends Component {
get topicCreator() {
return {
user: this.args.topic.creator,
class: "--topic-creator",
};
}
<template>
<div class={{this.topicCreator.class}}>
{{avatar this.topicCreator.user}}
</div>
</template>
}
@@ -1,9 +1,12 @@
import { gt } from "truth-helpers";
import icon from "discourse/helpers/d-icon"; import icon from "discourse/helpers/d-icon";
import gt from "truth-helpers/helpers/gt"; import number from "discourse/helpers/number";
const TopicRepliesColumn = <template> const TopicRepliesColumn = <template>
{{#if (gt @topic.replyCount 1)}} {{#if (gt @topic.replyCount 1)}}
<span class="topic-replies">{{icon "reply"}}{{@topic.posts_count}}</span> <span class="topic-replies">{{icon "reply"}}{{number
@topic.posts_count
}}</span>
{{/if}} {{/if}}
</template>; </template>;
@@ -30,7 +30,9 @@ export default class TopicStatusColumn extends Component {
{{#if this.badge}} {{#if this.badge}}
<span class="topic-status-card {{this.badge.className}}">{{icon <span class="topic-status-card {{this.badge.className}}">{{icon
this.badge.icon this.badge.icon
}}{{i18n (themePrefix this.badge.text)}}</span> }}<p class="topic-status-card__name">{{i18n
(themePrefix this.badge.text)
}}</p></span>
{{/if}} {{/if}}
</template> </template>
} }
@@ -10,6 +10,7 @@ const DO_NOT_RENDER_LIST = ["login"];
export default class ExperimentalScreen extends Component { export default class ExperimentalScreen extends Component {
@service router; @service router;
@tracked left = 0; @tracked left = 0;
@tracked right = 0; @tracked right = 0;
resizeObserver; resizeObserver;
@@ -3,16 +3,18 @@ import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object"; import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert"; import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import didUpdate from "@ember/render-modifiers/modifiers/did-update"; import didUpdate from "@ember/render-modifiers/modifiers/did-update";
import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { gt } from "truth-helpers"; import { gt, not } from "truth-helpers";
import CreateTopicButton from "discourse/components/create-topic-button"; import CreateTopicButton from "discourse/components/create-topic-button";
import not from "truth-helpers/helpers/not";
export default class SidebarNewTopicButton extends Component { export default class SidebarNewTopicButton extends Component {
@service composer; @service composer;
@service currentUser; @service currentUser;
@service siteSettings; @service siteSettings;
@service router; @service router;
@service header;
@service appEvents;
@tracked category; @tracked category;
@tracked tag; @tracked tag;
@@ -74,12 +76,30 @@ export default class SidebarNewTopicButton extends Component {
this.tag = this.router.currentRoute.attributes?.tag || null; this.tag = this.router.currentRoute.attributes?.tag || null;
} }
@action
watchForComposer() {
// this covers opening drafts from the hamburger menu
this.appEvents.on("composer:will-open", this, this.closeHamburger);
}
@action
stopWatchingForComposer() {
this.appEvents.off("composer:will-open", this, this.closeHamburger);
}
@action
closeHamburger() {
this.header.hamburgerVisible = false;
}
<template> <template>
{{#if this.shouldRender}} {{#if this.shouldRender}}
<div <div
class="sidebar-new-topic-button__wrapper" class="sidebar-new-topic-button__wrapper"
{{didInsert this.getCategoryandTag}} {{didInsert this.getCategoryandTag}}
{{didUpdate this.getCategoryandTag this.router.currentRoute}} {{didUpdate this.getCategoryandTag this.router.currentRoute}}
{{didInsert this.watchForComposer}}
{{willDestroy this.stopWatchingForComposer}}
> >
<CreateTopicButton <CreateTopicButton
@canCreateTopic={{this.canCreateTopic}} @canCreateTopic={{this.canCreateTopic}}
@@ -31,13 +31,14 @@ export default class UserColorPaletteSelector extends Component {
@service site; @service site;
@service session; @service session;
@service interfaceColor; @service interfaceColor;
@tracked anonColorPaletteId = this.#loadAnonColorPalette(); @tracked anonColorPaletteId = this.#loadAnonColorPalette();
@tracked userColorPaletteId = this.session.userColorSchemeId; @tracked userColorPaletteId = this.session.userColorSchemeId;
@tracked cssLoaded = true; @tracked cssLoaded = true;
get userColorPalettes() { get userColorPalettes() {
const availablePalettes = listColorSchemes(this.site) const availablePalettes = listColorSchemes(this.site)
.map((userPalette) => { ?.map((userPalette) => {
return { return {
...userPalette, ...userPalette,
accent: `#${ accent: `#${
@@ -55,7 +56,7 @@ export default class UserColorPaletteSelector extends Component {
// Match the light scheme with the corresponding dark id based in the name // Match the light scheme with the corresponding dark id based in the name
return ( return (
availablePalettes availablePalettes
.map((palette) => { ?.map((palette) => {
if (palette.is_dark) { if (palette.is_dark) {
return palette; return palette;
} }
@@ -1,7 +1,7 @@
import { withPluginApi } from "discourse/lib/plugin-api"; import { withPluginApi } from "discourse/lib/plugin-api";
import TopicActivityColumn from "../components/card/topic-activity-column"; import TopicActivityColumn from "../components/card/topic-activity-column";
import TopicCategoryColumn from "../components/card/topic-category-column"; import TopicCategoryColumn from "../components/card/topic-category-column";
import TopicLikesColumn from "../components/card/topic-likes-column"; import TopicCreatorColumn from "../components/card/topic-creator-column";
import TopicRepliesColumn from "../components/card/topic-replies-column"; import TopicRepliesColumn from "../components/card/topic-replies-column";
import TopicStatusColumn from "../components/card/topic-status-column"; import TopicStatusColumn from "../components/card/topic-status-column";
@@ -23,13 +23,18 @@ const TopicCategory = <template>
</td> </td>
</template>; </template>;
const TopicLikesReplies = <template> const TopicReplies = <template>
<td class="topic-likes-replies-data"> <td class="topic-likes-replies-data">
<TopicLikesColumn @topic={{@topic}} />
<TopicRepliesColumn @topic={{@topic}} /> <TopicRepliesColumn @topic={{@topic}} />
</td> </td>
</template>; </template>;
const TopicCreator = <template>
<td class="topic-creator-data">
<TopicCreatorColumn @topic={{@topic}} />
</td>
</template>;
export default { export default {
name: "topic-list-customizations", name: "topic-list-customizations",
@@ -49,7 +54,11 @@ export default {
}); });
columns.add("topic-likes-replies", { columns.add("topic-likes-replies", {
item: TopicLikesReplies, item: TopicReplies,
after: "topic-author-avatar",
});
columns.add("topic-creator", {
item: TopicCreator,
after: "topic-author-avatar", after: "topic-author-avatar",
}); });
columns.delete("views"); columns.delete("views");
@@ -76,6 +85,9 @@ export default {
) { ) {
classes.push("--has-status-card"); classes.push("--has-status-card");
} }
if (context.topic.replyCount > 1) {
classes.push("has-replies");
}
return classes; return classes;
} }
); );
@@ -83,6 +95,34 @@ export default {
api.registerValueTransformer("topic-list-item-mobile-layout", () => { api.registerValueTransformer("topic-list-item-mobile-layout", () => {
return false; return false;
}); });
api.registerBehaviorTransformer(
"topic-list-item-click",
({ context: { event }, next }) => {
if (event.target.closest("a, button, input")) {
return next();
}
event.preventDefault();
event.stopPropagation();
const topicLink = event.target
.closest("tr")
.querySelector("a.raw-topic-link");
// Redespatch the click on the topic link, so that all key-handing is sorted
topicLink.dispatchEvent(
new MouseEvent("click", {
ctrlKey: event.ctrlKey,
metaKey: event.metaKey,
shiftKey: event.shiftKey,
button: event.button,
bubbles: true,
cancelable: true,
})
);
}
);
}); });
}, },
}; };
+1 -2
View File
@@ -1,9 +1,8 @@
en: en:
theme_metadata: theme_metadata:
description: "A simple, beautiful theme that improves the out of the box experience for Discourse sites." description: "(DEPRECATED: Use the Horizon theme that is now preinstalled on your Discourse site). A simple, beautiful theme that improves the out of the box experience for Discourse sites."
topic_pinned: "Pinned" topic_pinned: "Pinned"
topic_hot: "Hot" topic_hot: "Hot"
user_replied: "replied" user_replied: "replied"
user_posted: "posted" user_posted: "posted"
user_updated: "updated" user_updated: "updated"
+6 -5
View File
@@ -1,13 +1,14 @@
{ {
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"@discourse/lint-configs": "2.4.0", "@discourse/lint-configs": "2.25.0",
"ember-template-lint": "6.1.0", "ember-template-lint": "7.8.1",
"eslint": "9.19.0", "eslint": "9.28.0",
"prettier": "2.8.8" "prettier": "3.5.3",
"stylelint": "16.20.0"
}, },
"engines": { "engines": {
"node": ">= 18", "node": ">= 22",
"npm": "please-use-pnpm", "npm": "please-use-pnpm",
"yarn": "please-use-pnpm", "yarn": "please-use-pnpm",
"pnpm": "9.x" "pnpm": "9.x"
+1089 -1770
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

View File
+62 -21
View File
@@ -1,4 +1,6 @@
@media screen and (min-width: 1300px) { @use "lib/viewport";
@media screen and (width >= 1300px) {
#main-outlet { #main-outlet {
border-top-right-radius: var(--d-border-radius-large); border-top-right-radius: var(--d-border-radius-large);
border-top-left-radius: var(--d-border-radius-large); border-top-left-radius: var(--d-border-radius-large);
@@ -19,40 +21,46 @@
.has-full-page-chat .chat-replying-indicator-container { .has-full-page-chat .chat-replying-indicator-container {
margin-bottom: var(--main-grid-gap); margin-bottom: var(--main-grid-gap);
@include breakpoint(medium) {
@include viewport.until(lg) {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.has-full-page-chat .chat-selection-management { .has-full-page-chat .chat-selection-management {
margin-bottom: var(--main-grid-gap); margin-bottom: var(--main-grid-gap);
@include breakpoint(medium) {
@include viewport.until(lg) {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.experimental-screen { .experimental-screen {
@include breakpoint(medium) {
display: none;
}
max-width: unset !important; max-width: unset !important;
width: 100%; width: 100%;
display: block; display: block;
margin: 0; margin: 0;
padding: 0; padding: 0;
position: relative; position: relative;
container: content-width / inline-size;
@media screen and (max-width: 488px) { @include viewport.until(lg) {
display: none; display: none;
} }
@include breakpoint(tablet) {
@media screen and (width <= 488px) {
display: none; display: none;
} }
@include viewport.until(md) {
display: none;
}
li { li {
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
&__top-left, &__top-left,
&__top-right, &__top-right,
&__bottom-left, &__bottom-left,
@@ -68,38 +76,39 @@
transparent var(--d-border-radius-large), transparent var(--d-border-radius-large),
black var(--d-border-radius-large) black var(--d-border-radius-large)
); );
-webkit-mask: radial-gradient(
circle at var(--d-border-radius-large) var(--d-border-radius-large),
transparent var(--d-border-radius-large),
transparent var(--d-border-radius-large),
black var(--d-border-radius-large)
);
} }
&__top-left { &__top-left {
top: var(--header-offset); top: var(--header-offset);
left: var(--left-distance); left: var(--left-distance);
} }
&__top-right { &__top-right {
top: var(--header-offset); top: var(--header-offset);
transform: rotate(90deg); transform: rotate(90deg);
left: calc(var(--right-distance) - var(--d-border-radius-large)); left: calc(var(--right-distance) - var(--d-border-radius-large));
} }
&__bottom-left { &__bottom-left {
transform: rotate(-90deg); transform: rotate(-90deg);
bottom: var(--main-grid-gap); bottom: var(--main-grid-gap);
left: var(--left-distance); left: var(--left-distance);
@media screen and (max-width: 768px) {
@media screen and (width <= 768px) {
bottom: calc(var(--d-border-radius-large) * 2); bottom: calc(var(--d-border-radius-large) * 2);
} }
} }
&__bottom-right { &__bottom-right {
transform: rotate(180deg); transform: rotate(180deg);
bottom: var(--main-grid-gap); bottom: var(--main-grid-gap);
left: calc(var(--right-distance) - var(--d-border-radius-large)); left: calc(var(--right-distance) - var(--d-border-radius-large));
@media screen and (max-width: 768px) {
@media screen and (width <= 768px) {
bottom: calc(var(--d-border-radius-large) * 2); bottom: calc(var(--d-border-radius-large) * 2);
} }
} }
&__bottom-bar { &__bottom-bar {
position: fixed; position: fixed;
width: 100%; width: 100%;
@@ -108,16 +117,48 @@
bottom: 0; bottom: 0;
left: var(--left-distance); left: var(--left-distance);
height: var(--main-grid-gap); height: var(--main-grid-gap);
@media screen and (max-width: 768px) {
@media screen and (width <= 768px) {
height: calc(var(--d-border-radius-large) * 2); height: calc(var(--d-border-radius-large) * 2);
} }
@container content-width (width > 1px) { @container content-width (width > 1px) {
width: 100cqw; width: 100cqw;
} }
} }
} }
@media screen and (min-width: 768px) { .rtl .experimental-screen {
&__top-left {
right: var(--left-distance);
left: unset;
}
&__top-right {
transform: rotate(-90deg) !important;
right: calc(var(--right-distance) - var(--d-border-radius-large));
left: unset;
}
&__bottom-left {
transform: rotate(90deg);
right: var(--left-distance);
left: unset;
}
&__bottom-right {
transform: rotate(180deg);
left: unset;
right: calc(var(--right-distance) - var(--d-border-radius-large));
}
&__bottom-bar {
right: var(--left-distance);
left: unset;
}
}
@media screen and (width >= 768px) {
.with-topic-progress { .with-topic-progress {
bottom: calc( bottom: calc(
env(safe-area-inset-bottom) + var(--composer-height, 0px) + env(safe-area-inset-bottom) + var(--composer-height, 0px) +
@@ -126,7 +167,7 @@
} }
} }
@media screen and (max-width: 768px) { @media screen and (width <= 768px) {
.with-topic-progress { .with-topic-progress {
bottom: calc( bottom: calc(
env(safe-area-inset-bottom) + var(--composer-height, 0px) + env(safe-area-inset-bottom) + var(--composer-height, 0px) +
@@ -135,7 +176,7 @@
} }
} }
@media screen and (max-width: 400px) { @media screen and (width <= 400px) {
.with-topic-progress { .with-topic-progress {
bottom: calc(env(safe-area-inset-bottom) + var(--composer-height, 0px)); bottom: calc(env(safe-area-inset-bottom) + var(--composer-height, 0px));
} }
+19 -5
View File
@@ -8,11 +8,13 @@
.sidebar-new-topic-button__wrapper .topic-drafts-menu-trigger.btn.no-text { .sidebar-new-topic-button__wrapper .topic-drafts-menu-trigger.btn.no-text {
background: var(--accent-color); background: var(--accent-color);
&:hover, &:hover,
&:focus-visible { &:focus-visible {
background: oklch(from var(--accent-color) 40% c h) !important; background: oklch(from var(--accent-color) 40% c h) !important;
box-shadow: none; box-shadow: none;
} }
.d-icon { .d-icon {
color: var(--accent-text-color); color: var(--accent-text-color);
} }
@@ -26,31 +28,37 @@
.discourse-no-touch .btn-default, .discourse-no-touch .btn-default,
.discourse-no-touch .select-kit .select-kit-header.btn-default { .discourse-no-touch .select-kit .select-kit-header.btn-default {
background: var(--primary-100); background: var(--primary-100);
.d-icon { .d-icon {
color: var(--accent-color); color: var(--accent-color);
} }
&:hover { &:hover {
border-color: transparent; border-color: transparent;
box-shadow: 0px 0px 8px 1px var(--button-box-shadow); box-shadow: 0 0 8px 1px var(--button-box-shadow);
background: var(--d-content-background); background: var(--d-content-background);
color: var(--accent-color); color: var(--accent-color);
.d-icon { .d-icon {
color: var(--accent-color); color: var(--accent-color);
} }
} }
&:focus-visible { &:focus-visible {
background: var(--d-content-background); background: var(--d-content-background);
color: var(--accent-color); color: var(--accent-color);
box-shadow: 0px 0px 0px 3px var(--button-box-shadow); box-shadow: 0 0 0 3px var(--button-box-shadow);
.d-icon { .d-icon {
color: var(--accent-color); color: var(--accent-color);
} }
} }
&:active:not(:hover, :focus) { &:active:not(:hover, :focus) {
color: var(--primary); color: var(--primary);
background: var(--tertiary-300); background: var(--tertiary-300);
background-image: none; background-image: none;
.d-icon { .d-icon {
color: var(--tertiary-high); color: var(--tertiary-high);
} }
@@ -58,35 +66,41 @@
} }
.btn-primary, .btn-primary,
#create-topic.btn { #create-topic.btn,
.discourse-no-touch .btn-default.ai-new-question-button {
background-color: var(--accent-color); background-color: var(--accent-color);
color: var(--accent-text-color); color: var(--accent-text-color);
.d-icon { .d-icon {
color: var(--accent-text-color); color: var(--accent-text-color);
} }
&:hover { &:hover {
.discourse-no-touch & { .discourse-no-touch & {
background: light-dark( background: light-dark(
oklch(from var(--accent-color) 40% c h), oklch(from var(--accent-color) 40% c h),
oklch(from var(--accent-color) 50% c h) oklch(from var(--accent-color) 50% c h)
); );
box-shadow: 0px 0px 6px 1px var(--button-box-shadow); box-shadow: 0 0 6px 1px var(--button-box-shadow);
color: var(--accent-text-color); color: var(--accent-text-color);
.d-icon { .d-icon {
color: var(--accent-text-color); color: var(--accent-text-color);
} }
} }
} }
&:focus-visible { &:focus-visible {
.discourse-no-touch & { .discourse-no-touch & {
background: light-dark( background: light-dark(
oklch(from var(--accent-color) 40% c h), oklch(from var(--accent-color) 40% c h),
oklch(from var(--accent-color) 50% c h) oklch(from var(--accent-color) 50% c h)
); );
box-shadow: 0px 0px 0px 4px var(--button-box-shadow); box-shadow: 0 0 0 4px var(--button-box-shadow);
color: var(--accent-text-color); color: var(--accent-text-color);
} }
} }
&:active { &:active {
background: light-dark( background: light-dark(
oklch(from var(--accent-color) 40% c h), oklch(from var(--accent-color) 40% c h),
+363
View File
@@ -0,0 +1,363 @@
@use "lib/viewport";
.categories-and-latest {
.category-list {
border-collapse: separate;
th.topics,
.category-logo {
display: none;
}
thead tr th {
font-size: var(--font-up-1-rem);
font-weight: bold;
}
tbody {
display: flex;
flex-direction: column;
gap: 1em;
padding-top: 1em;
border: 0;
}
tbody tr {
display: grid;
grid-template-areas:
"title topics"
"category category"
"subcategory subcategory";
row-gap: 1em;
border: 1px solid var(--primary-300);
border-radius: var(--d-border-radius-large);
box-shadow: 0 0 12px 1px var(--topic-card-shadow);
}
td.category {
display: contents;
border-top-left-radius: var(--d-border-radius-large);
border-bottom-left-radius: var(--d-border-radius-large);
border-width: 2px;
padding: 1em 1.5rem;
}
tbody h3 {
grid-area: title;
padding: 1em 0 0 1.5rem;
font-size: var(--font-up-1-rem);
.category-name {
display: flex;
align-self: center;
}
.badge-category {
gap: 0.25em;
align-items: center;
font-size: var(--font-up-1-rem);
.d-icon:first-of-type:not(.d-icon-lock),
&.--style-square::before,
&.--style-emoji .emoji {
width: 1.25em;
height: 1.25em;
margin-right: 0.25em;
}
&.--style-square::before {
border-radius: 6px;
}
}
.d-icon.d-icon-lock {
order: 1;
}
}
.topics {
width: auto;
padding: 1em 1.5rem 0 0;
display: flex;
align-items: center;
justify-content: end;
}
.category-description {
grid-area: category;
padding: 0 1.5rem;
margin: 0;
font-size: var(--font-down-1-rem);
}
.subcategories {
grid-area: subcategory;
gap: 0.25em 0.5em;
padding: 0 1.5rem 1em;
margin: 0;
.badge-category__wrapper {
background-color: light-dark(
oklch(from var(--category-badge-color) 98% calc(c * 0.2) h),
oklch(from var(--category-badge-color) 45% calc(c * 0.5) h)
);
padding: 0.25em 0.5rem;
border-radius: var(--d-border-radius);
}
.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)
);
}
.badge-category.--style-square::before {
border-radius: 3px;
}
}
}
.latest-topic-list {
.table-heading {
border: 0;
font-size: var(--font-up-1-rem);
font-weight: bold;
}
&-item {
display: grid;
grid-template-columns: min-content min-content auto min-content;
grid-template-areas:
"creator title title status"
". category activity activity";
grid-column-gap: 0.75rem;
grid-row-gap: 0.5rem;
background: var(--d-content-background);
box-shadow: 0 0 12px 1px var(--topic-card-shadow);
text-overflow: ellipsis;
padding: 0.75em 1rem;
border: 1px solid var(--primary-300);
border-radius: var(--d-border-radius-large);
margin-top: 1em;
}
.main-link,
.topic-stats {
display: contents;
}
.top-row {
grid-area: title;
}
.bottom-row {
grid-area: category;
.discourse-tags {
display: none;
}
}
.badge-category__wrapper {
border-radius: var(--d-border-radius);
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)
);
@include viewport.until(md) {
padding: 0.25em 0.5rem;
font-size: var(--font-down-2);
}
.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)
);
}
}
.topic-list-data {
grid-area: likes-replies;
}
.num.posts-map {
display: none;
}
.topic-last-activity {
grid-area: activity;
display: flex;
align-items: center;
text-align: left;
font-size: var(--font-down-1-rem);
&::before {
content: "";
display: inline-block;
width: 0.25em;
height: 0.25em;
background-color: var(--primary-500);
border-radius: 100%;
margin-right: 0.5em;
}
}
.topic-poster {
grid-area: creator;
width: auto;
align-self: flex-start;
.avatar {
height: 24px;
width: 24px;
border-radius: var(--d-border-radius-small);
}
}
}
}
@include viewport.until(sm) {
.category-list.with-topics {
margin-inline: 1rem;
.num.posts,
.category-topics-count,
.category-logo {
display: none;
}
.category-list {
&-item {
padding-top: 0;
padding-bottom: 0;
border-top: 0 !important;
border-bottom: 0 !important;
}
}
tbody {
display: flex;
flex-direction: column;
tr:first-of-type {
order: -2;
}
tr.subcategories-list {
order: -1;
}
tr:nth-last-of-type(2) {
border-bottom: 0;
}
}
th.main-link {
padding-top: 0;
}
}
}
.category-boxes.with-subcategories {
.category-logo {
display: none;
}
@include viewport.from(sm) {
margin-top: 0;
}
@include viewport.until(md) {
padding-inline: 1rem;
box-sizing: border-box;
}
.category {
border: 0;
&-box-inner {
border-radius: var(--d-border-radius-large);
border: 1px solid var(--primary-300);
background: var(--d-content-background);
box-shadow: 0 0 12px 1px var(--topic-card-shadow);
&:hover {
.discourse-no-touch & {
border-color: var(--accent-color);
background: var(--d-content-background);
}
}
&.selected {
box-shadow:
0 0 0 2px var(--accent-color),
0 0 12px 1px var(--topic-card-shadow);
}
}
&-details {
display: flex;
flex-direction: column;
gap: 1rem;
height: 100%;
}
&-box-heading {
h3 {
text-align: left;
}
.badge-category {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: 1em;
justify-content: space-between;
width: 100%;
&__wrapper {
display: flex;
}
&.--style-square::before {
aspect-ratio: 1 / 1;
height: auto;
width: 13%;
border-radius: var(--d-border-radius);
}
&__name {
flex-basis: 100%;
font-size: var(--font-up-1-rem);
}
.d-icon:not(.d-icon-lock),
img.emoji {
aspect-ratio: 1 / 1;
height: auto;
width: 13%;
}
}
}
.description {
text-align: left;
margin: 0;
font-size: var(--font-down-1-rem);
}
.subcategories {
margin-top: auto;
row-gap: 0.5em;
.subcategory {
margin-bottom: 0;
font-size: var(--font-down-1);
}
}
}
}
+34 -2
View File
@@ -1,9 +1,13 @@
@use "lib/viewport";
.full-page-chat.full-page-chat-sidebar-enabled { .full-page-chat.full-page-chat-sidebar-enabled {
border: none; border: none;
} }
.c-navbar-container { .c-navbar-container {
.full-page-chat & {
padding: 0 1.5em; padding: 0 1.5em;
}
background-color: var(--d-content-background); background-color: var(--d-content-background);
} }
@@ -13,21 +17,43 @@ body.has-full-page-chat {
.chat-drawer-container { .chat-drawer-container {
.is-expanded & { .is-expanded & {
box-shadow: 0px 0px 0px 2px var(--tertiary-medium); box-shadow: 0 0 0 2px var(--tertiary-medium);
} }
.chat-drawer.is-expanded & { .chat-drawer.is-expanded & {
border: none; border: none;
} }
.c-navbar__title {
padding-left: 0.33em; // visual alignment for chat index, which does not havea a backarrow
}
} }
.chat-drawer-outlet-container { .chat-drawer-outlet-container {
z-index: z("composer", "content"); z-index: z("composer", "content");
.peek-mode-active & {
padding-bottom: 0;
left: unset;
right: var(--main-grid-gap);
&:has(.is-expanded) {
z-index: calc(z("composer", "dropdown") + 1);
}
}
}
.chat-drawer {
.peek-mode-active & {
max-width: 90vw;
}
} }
.chat-drawer .channels-list-container .chat-channel-row { .chat-drawer .channels-list-container .chat-channel-row {
margin-bottom: var(--spacing-block-xs); margin-bottom: var(--spacing-block-xs);
font-size: var(--font-up-1); font-size: var(--font-up-1);
border-bottom: none; border-bottom: none;
&:hover { &:hover {
background-color: var(--d-sidebar-active-background); background-color: var(--d-sidebar-active-background);
} }
@@ -52,5 +78,11 @@ body.has-full-page-chat {
} }
.chat-drawer-active.chat-drawer-expanded .chat-composer-dropdown__menu-content { .chat-drawer-active.chat-drawer-expanded .chat-composer-dropdown__menu-content {
z-index: z("composer", "content") + 1; z-index: z("modal", "dialog");
}
.chat-replying-indicator-container {
@include viewport.from(sm) {
margin-left: calc(0.65em + 0.2rem);
}
} }
+4
View File
@@ -4,17 +4,21 @@
width: 100%; width: 100%;
justify-content: flex-start; justify-content: flex-start;
} }
&__item .btn-icon-text.btn-flat:hover { &__item .btn-icon-text.btn-flat:hover {
background-color: var(--d-selected); background-color: var(--d-selected);
box-shadow: none; box-shadow: none;
color: var(--primary); color: var(--primary);
} }
&__item .btn-icon-text.btn-flat:hover svg { &__item .btn-icon-text.btn-flat:hover svg {
color: var(--icon-color); color: var(--icon-color);
} }
&__item .btn-icon-text.btn-flat svg { &__item .btn-icon-text.btn-flat svg {
color: var(--icon-color); color: var(--icon-color);
} }
&__item-choice.active.btn-icon-text.btn-flat { &__item-choice.active.btn-icon-text.btn-flat {
background-color: var(--d-selected); background-color: var(--d-selected);
} }
+1 -1
View File
@@ -6,7 +6,7 @@
--d-sidebar-header-icon-color: var(--d-sidebar-link-color); --d-sidebar-header-icon-color: var(--d-sidebar-link-color);
--d-sidebar-active-suffix-color: var(--d-sidebar-suffix-color); --d-sidebar-active-suffix-color: var(--d-sidebar-suffix-color);
--d-sidebar-background: var(--background-color); --d-sidebar-background: var(--background-color);
--d-sidebar-footer-fade: rgba(var(--tertiary-50-rgb), 1); --d-sidebar-footer-fade: rgb(var(--tertiary-50-rgb), 1);
--d-sidebar-prefix-background: var(--d-selected); --d-sidebar-prefix-background: var(--d-selected);
--d-sidebar-active-prefix-background: light-dark( --d-sidebar-active-prefix-background: light-dark(
oklch(from var(--d-selected) calc(l * 0.85) c h), oklch(from var(--d-selected) calc(l * 0.85) c h),
+2 -1
View File
@@ -2,7 +2,7 @@
display: none; display: none;
} }
@media screen and (min-width: 1300px) { @media screen and (width >= 1300px) {
html:not(.fullscreen-composer) { html:not(.fullscreen-composer) {
.peek-mode-toggle svg { .peek-mode-toggle svg {
transform: scaleX(-1); transform: scaleX(-1);
@@ -18,6 +18,7 @@
transition: none; transition: none;
box-shadow: none; box-shadow: none;
border-radius: var(--d-border-radius-large); border-radius: var(--d-border-radius-large);
.grippie { .grippie {
display: none; display: none;
} }
+34 -3
View File
@@ -1,8 +1,11 @@
@use "lib/viewport";
#reply-control #reply-control
.select-kit.dropdown-select-box.composer-actions .select-kit.dropdown-select-box.composer-actions
.select-kit-header { .select-kit-header {
border: 1px solid var(--tertiary-700); border: 1px solid var(--tertiary-700);
background: var(--secondary); background: var(--secondary);
&:hover { &:hover {
.d-icon { .d-icon {
color: var(--accent-color); color: var(--accent-color);
@@ -11,14 +14,15 @@
} }
#reply-control.hide-preview:not(.draft) { #reply-control.hide-preview:not(.draft) {
@include breakpoint("mobile-extra-large", $rule: min-width) { @include viewport.from(sm) {
background: var(--d-content-background); background: var(--d-content-background);
border-top-right-radius: var(--d-border-radius); border-top-right-radius: var(--d-border-radius);
border-top-left-radius: var(--d-border-radius); border-top-left-radius: var(--d-border-radius);
.grippie { .grippie {
background: var(--tertiary-low); background: var(--tertiary-low);
border-top-right-radius: var(--d-border-radius);
border-top-left-radius: var(--d-border-radius);
} }
.user-selector, .user-selector,
@@ -43,6 +47,7 @@
.reply-area { .reply-area {
padding-inline: 0; padding-inline: 0;
} }
.reply-to, .reply-to,
.submit-panel { .submit-panel {
padding-inline: var(--spacing-inline-sm); padding-inline: var(--spacing-inline-sm);
@@ -59,6 +64,7 @@
} }
} }
} }
.d-editor-button-bar { .d-editor-button-bar {
.btn:hover, .btn:hover,
.toolbar-popup-menu-options.is-expanded { .toolbar-popup-menu-options.is-expanded {
@@ -70,11 +76,12 @@
color: inherit; color: inherit;
} }
//to have parity with regular select-kit styling used elsewhere // to have parity with regular select-kit styling used elsewhere
.select-kit-row { .select-kit-row {
.d-icon { .d-icon {
color: var(--primary-high); color: var(--primary-high);
} }
&:hover { &:hover {
.d-icon { .d-icon {
color: var(--primary); color: var(--primary);
@@ -88,3 +95,27 @@
border-radius: var(--d-border-radius); border-radius: var(--d-border-radius);
} }
} }
.discourse-no-touch .translation-selector-dropdown {
.select-kit-header.btn-default {
background: var(--background-color);
}
}
#reply-control.composer-action-add_translation {
.d-editor-preview .d-editor-translation-preview-wrapper {
border-color: var(--d-sidebar-border-color);
}
.d-editor-preview .d-editor-translation-preview-wrapper__header {
top: 6.5rem;
padding: 0.25rem 0.75rem;
background: var(--background-color);
color: var(--accent-color);
border-radius: var(--d-border-radius-large);
}
.topic-title-translator input {
width: 47.25vw;
}
}
+32 -11
View File
@@ -1,3 +1,5 @@
@use "lib/viewport";
// Full width layout. Ported from the Discourse Full Width theme component here // Full width layout. Ported from the Discourse Full Width theme component here
// https://meta.discourse.org/t/discourse-full-width-component/292496, which we // https://meta.discourse.org/t/discourse-full-width-component/292496, which we
// intend to move into core over time. // intend to move into core over time.
@@ -13,12 +15,31 @@ $sidebar-width: 17em;
} }
.d-header #site-logo { .d-header #site-logo {
// constraining the logo to fit its grid container
// this prevents the logo from shifting header content // this prevents the logo from shifting header content
// when the sidebar is opened // when the sidebar is opened
max-height: 100%; max-height: 100%;
max-width: 100%; max-width: 100%;
object-fit: contain; // contains logo without squishing/stretching object-fit: contain; // contains logo without squishing/stretching
// allows some flexibility for wide logos
body:not(.has-sidebar-page) & {
max-width: unset;
@include viewport.until(sm) {
max-width: 25vw;
}
}
}
.d-header #site-text-logo {
font-size: clamp(var(--font-0), 2.5vw, var(--font-up-2));
.has-sidebar-page & {
white-space: wrap;
line-height: var(--line-height-medium);
@include line-clamp(2);
}
} }
#main-outlet-wrapper { #main-outlet-wrapper {
@@ -84,7 +105,7 @@ $sidebar-width: 17em;
grid-area: extra-info; grid-area: extra-info;
white-space: nowrap; white-space: nowrap;
@include breakpoint("tablet") { @include viewport.until(md) {
display: none; display: none;
} }
} }
@@ -108,7 +129,7 @@ $sidebar-width: 17em;
// at narrower widths, when 1fr = 0 // at narrower widths, when 1fr = 0
// we can center without matching the sidebar's width // we can center without matching the sidebar's width
// which allows the title to take up the remaining width // which allows the title to take up the remaining width
@media screen and (max-width: 1400px) { @media screen and (width <= 1400px) {
grid-template-columns: grid-template-columns:
calc(var(--d-sidebar-width) - 11px) calc(var(--d-sidebar-width) - 11px)
1fr 1fr
@@ -117,7 +138,7 @@ $sidebar-width: 17em;
auto; auto;
} }
@media screen and (max-width: 1000px) { @media screen and (width <= 1000px) {
gap: 0.5em; gap: 0.5em;
} }
@@ -138,7 +159,7 @@ $sidebar-width: 17em;
.d-header-mode { .d-header-mode {
.bootstrap-mode { .bootstrap-mode {
margin: 0; display: none;
} }
} }
@@ -150,7 +171,7 @@ $sidebar-width: 17em;
overflow: visible; overflow: visible;
.title { .title {
flex: 1 0 auto; flex: 1 1 auto;
} }
} }
@@ -170,11 +191,11 @@ $sidebar-width: 17em;
.header-search--enabled .floating-search-input-wrapper { .header-search--enabled .floating-search-input-wrapper {
grid-area: extra-info; grid-area: extra-info;
@include breakpoint(tablet) { @include viewport.until(md) {
grid-area: rspace; grid-area: rspace;
} }
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
display: none; display: none;
} }
} }
@@ -189,7 +210,7 @@ body.has-sidebar-page {
padding: 0; padding: 0;
} }
@media screen and (min-width: calc($reply-area-max-width + ($sidebar-width * 2))) { @media screen and (width >= calc($reply-area-max-width + ($sidebar-width * 2))) {
#reply-control.show-preview { #reply-control.show-preview {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
@@ -200,7 +221,7 @@ body.has-sidebar-page {
} }
} }
@media screen and (max-width: calc($reply-area-max-width + ($sidebar-width * 2))) and (min-width: calc($reply-area-max-width + calc($sidebar-width / 2))) { @media screen and (width <= calc($reply-area-max-width + ($sidebar-width * 2))) and (width >= calc($reply-area-max-width + calc($sidebar-width / 2))) {
#reply-control.show-preview:not(.fullscreen) { #reply-control.show-preview:not(.fullscreen) {
margin-left: $sidebar-width; margin-left: $sidebar-width;
width: auto; width: auto;
@@ -246,7 +267,7 @@ body.sidebar-animate {
} }
// provides some extra space for login buttons // provides some extra space for login buttons
@media screen and (min-width: 1400px) { @media screen and (width >= 1400px) {
.anon { .anon {
.d-header .panel { .d-header .panel {
grid-column-start: -4; grid-column-start: -4;
+34 -15
View File
@@ -1,10 +1,11 @@
// Fixing bulk select (only needed for desktop) // Fixing bulk select (only needed for desktop)
.bulk-select-enabled { .bulk-select-enabled {
.topic-list-header .topic-list-data.default { .topic-list-header {
position: sticky; position: relative;
top: 10em; top: 0;
z-index: 2;
} }
.topic-author-avatar-data { .topic-author-avatar-data {
display: none; display: none;
} }
@@ -13,8 +14,9 @@
grid-area: bulk-select; grid-area: bulk-select;
margin-left: -0.5em; margin-left: -0.5em;
@media screen and (max-width: 576px) { @media screen and (width <= 576px) {
margin-top: 0; margin-top: 0;
label { label {
padding-block: 0.345em; padding-block: 0.345em;
} }
@@ -27,20 +29,29 @@
} }
.topic-list-header { .topic-list-header {
position: relative;
margin-bottom: 0.35rem;
tr { tr {
border: none; border: none;
} }
.topic-list-data { .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) { &:not(.default) {
display: none; display: none;
} }
&.default { &.default {
position: absolute; border-radius: var(--d-border-radius);
right: 0;
.bulk-select, .bulk-select,
span:not(.bulk-select-topics, .d-button-label) { span:not(.bulk-select-topics, .d-button-label) {
display: none; display: none;
@@ -48,17 +59,25 @@
} }
} }
// bulk select
.bulk-select-topics { .bulk-select-topics {
position: absolute; position: absolute;
right: -1em; right: 0.25rem;
background: var(--secondary); top: 50%;
border-radius: 0 0 0 var(--d-border-radius); transform: translateY(-50%);
padding: 1em; background: color-mix(in srgb, var(--d-content-background) 88%, white 12%);
@media screen and (max-width: 1048px) { border: 1px solid var(--primary-200);
right: 0; border-radius: 999px;
} box-shadow: 0 6px 18px -12px rgb(10 18 35 / 35%);
display: flex;
gap: 0.5rem;
margin: 0;
padding: 0.25rem;
button { button {
white-space: nowrap; white-space: nowrap;
margin: 0;
border-radius: 999px;
} }
} }
} }
+6 -5
View File
@@ -1,7 +1,10 @@
@use "lib/viewport";
.d-header { .d-header {
box-shadow: none; box-shadow: none;
background: var(--background-color); background: var(--background-color);
@include breakpoint(extra-large, $rule: min-width) {
@include viewport.from(xl) {
padding-bottom: var(--main-grid-gap); padding-bottom: var(--main-grid-gap);
} }
} }
@@ -48,8 +51,10 @@
.discourse-no-touch .interface-color-selector-content { .discourse-no-touch .interface-color-selector-content {
border: none; border: none;
border-radius: var(--d-border-radius); border-radius: var(--d-border-radius);
.btn { .btn {
border: none; border: none;
&:hover { &:hover {
box-shadow: none; box-shadow: none;
} }
@@ -59,10 +64,6 @@
.drop-down-mode .d-header-icons .active .icon, .drop-down-mode .d-header-icons .active .icon,
.drop-down-mode .d-header-icons .header-color-scheme-toggle .-expanded { .drop-down-mode .d-header-icons .header-color-scheme-toggle .-expanded {
border-color: transparent; border-color: transparent;
}
.drop-down-mode .d-header-icons .active .icon,
.drop-down-mode .d-header-icons .header-color-scheme-toggle .-expanded {
background-color: transparent; background-color: transparent;
} }
+1 -3
View File
@@ -2,8 +2,6 @@
.list-controls #create-topic, .list-controls #create-topic,
.notifications-button-footer .reason .text, .notifications-button-footer .reason .text,
.pinned-button .reason .text, .pinned-button .reason .text,
.more-topics__browse-more, .more-topics__browse-more {
//footer-message might cause issues, not sure what possible stuff can be in there, but the general idea is to hide it bcs having an ugly H3 (what?) CTA at the bottom is just ugly imo
.footer-message {
display: none; display: none;
} }
+1
View File
@@ -6,6 +6,7 @@ body.static-login {
"sidebar below-content"; "sidebar below-content";
grid-template-rows: auto 1fr auto; grid-template-rows: auto 1fr auto;
} }
.login-welcome { .login-welcome {
border-radius: none; border-radius: none;
border: none; border: none;
+96 -14
View File
@@ -1,21 +1,87 @@
@use "lib/viewport";
:root { :root {
--main-grid-gap: 0.5em; --main-grid-gap: 0.5em;
--dream-glow-a: rgb(var(--tertiary-rgb) / 0.24);
--dream-glow-b: rgb(var(--tertiary-rgb) / 0.18);
} }
html:not(:has(.has-full-page-chat)) { html:not(:has(.has-full-page-chat)) {
background-color: var(--background-color); background-color: var(--background-color);
@include breakpoint("mobile-extra-large") { @include viewport.until(sm) {
background-color: var(--d-content-background); background-color: var(--d-content-background);
} }
} }
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
@include breakpoint("mobile-extra-large") { position: relative;
@include viewport.until(sm) {
background-color: var(--d-content-background); background-color: var(--d-content-background);
} }
} }
body:not(.has-full-page-chat, .wizard)::before,
body:not(.has-full-page-chat, .wizard)::after {
content: "";
position: fixed;
width: min(42vw, 32rem);
aspect-ratio: 1 / 1;
border-radius: 999px;
filter: blur(56px);
pointer-events: none;
z-index: 0;
}
body:not(.has-full-page-chat, .wizard)::before {
top: 5rem;
left: -8rem;
background: radial-gradient(circle at 30% 30%, var(--dream-glow-a), transparent 62%);
animation: dreamy-float-a 18s ease-in-out infinite alternate;
}
body:not(.has-full-page-chat, .wizard)::after {
right: -6rem;
bottom: 2rem;
background: radial-gradient(circle at 65% 35%, var(--dream-glow-b), transparent 58%);
animation: dreamy-float-b 22s ease-in-out infinite alternate;
}
.d-header-wrap,
#main-outlet-wrapper,
.sidebar-wrapper,
.sidebar-hamburger-dropdown {
position: relative;
z-index: 1;
}
@keyframes dreamy-float-a {
from {
transform: translate3d(0, 0, 0) scale(1);
}
to {
transform: translate3d(3rem, -1.5rem, 0) scale(1.08);
}
}
@keyframes dreamy-float-b {
from {
transform: translate3d(0, 0, 0) scale(1);
}
to {
transform: translate3d(-2.5rem, 2rem, 0) scale(1.1);
}
}
@media (prefers-reduced-motion: reduce) {
body:not(.has-full-page-chat, .wizard)::before,
body:not(.has-full-page-chat, .wizard)::after {
animation: none;
}
}
#main-outlet-wrapper { #main-outlet-wrapper {
gap: var(--main-grid-gap); gap: var(--main-grid-gap);
} }
@@ -29,52 +95,61 @@ body.has-full-page-chat:not(.has-sidebar-page) {
.d-header { .d-header {
background-color: var(--background-color); background-color: var(--background-color);
} }
#main-outlet-wrapper { #main-outlet-wrapper {
gap: var(--main-grid-gap); gap: var(--main-grid-gap);
@include breakpoint(medium) {
@include viewport.until(lg) {
gap: 0; gap: 0;
} }
} }
} }
body.has-sidebar-page #main-outlet-wrapper { body.has-sidebar-page #main-outlet-wrapper {
grid-template-columns: var(--d-sidebar-width) minmax(0, 1fr) 0px; grid-template-columns: var(--d-sidebar-width) minmax(0, 1fr) 0;
#main-outlet { #main-outlet {
max-width: unset; max-width: unset;
} }
} }
body:not(.has-sidebar-page) #main-outlet-wrapper { body:not(.has-sidebar-page) #main-outlet-wrapper {
@include breakpoint(medium, $rule: min-width) { @include viewport.from(lg) {
grid-template-columns: 0px minmax(0, 1fr) 0px; grid-template-columns: 0 minmax(0, 1fr) 0;
} }
} }
body:not(.has-full-page-chat) { body:not(.has-full-page-chat, .wizard) {
@include breakpoint(extra-large, $rule: min-width) { @include viewport.from(xl) {
background-color: var(--background-color); background-color: var(--background-color);
} }
#main-outlet-wrapper { #main-outlet-wrapper {
@include breakpoint(medium) { @include viewport.until(lg) {
--main-grid-gap: 0; --main-grid-gap: 0;
} }
@media screen and (min-width: 768px) {
@media screen and (width >= 768px) {
gap: var(--main-grid-gap); gap: var(--main-grid-gap);
} }
#main-outlet { #main-outlet {
width: 100%; width: 100%;
max-width: unset; max-width: unset;
padding-bottom: var(--spacing-block-l); padding-bottom: var(--spacing-block-l);
border-radius: var(--d-border-radius-large); border-radius: var(--d-border-radius-large);
background-color: var(--d-content-background); background-color: var(--d-content-background);
@include breakpoint(medium) {
border-radius: 0px; @include viewport.until(lg) {
border-radius: 0;
} }
html.composer-open & { html.composer-open & {
padding-bottom: var(--composer-height); padding-bottom: var(--composer-height);
} }
> *:not(.experimental-screen, .activate-account) { > *:not(.experimental-screen, .activate-account) {
@include breakpoint(medium, $rule: min-width) { @include viewport.from(lg) {
box-sizing: border-box; box-sizing: border-box;
max-width: 1000px; max-width: 1000px;
margin-inline: auto; margin-inline: auto;
@@ -85,9 +160,15 @@ body:not(.has-full-page-chat) {
} }
} }
@include viewport.until(sm) {
.welcome-banner {
display: none;
}
}
#list-area { #list-area {
.show-more.has-topics { .show-more.has-topics {
@include breakpoint(medium, $rule: min-width) { @include viewport.from(lg) {
width: auto; width: auto;
right: 50%; right: 50%;
transform: translateX(50%); transform: translateX(50%);
@@ -99,6 +180,7 @@ body:not(.has-full-page-chat) {
} }
} }
} }
.topic-list-body { .topic-list-body {
padding-top: var(--spacing-block-m); padding-top: var(--spacing-block-m);
} }
+36 -2
View File
@@ -1,3 +1,5 @@
@use "lib/viewport";
.user-main .about.collapsed-info .details { .user-main .about.collapsed-info .details {
background: var(--d-content-background); background: var(--d-content-background);
} }
@@ -69,7 +71,7 @@ input[type="color"]:focus,
background-color: var(--background-color); background-color: var(--background-color);
} }
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
// pinned topic excerpts are hidden on small screens too // pinned topic excerpts are hidden on small screens too
.fk-d-menu__trigger.topic-list-layout-trigger { .fk-d-menu__trigger.topic-list-layout-trigger {
display: none; display: none;
@@ -85,7 +87,7 @@ input[type="color"]:focus,
.user-main .about .details { .user-main .about .details {
padding: 1em 1em 0; padding: 1em 1em 0;
border-bottom: 0px; border-bottom: 0;
border-radius: var(--d-border-radius); border-radius: var(--d-border-radius);
background-color: var(--primary-50); background-color: var(--primary-50);
} }
@@ -105,3 +107,35 @@ input[type="color"]:focus,
.period-chooser-header { .period-chooser-header {
border-radius: 0; border-radius: 0;
} }
// compatibility with the top contributors sidebar theme component
// https://meta.discourse.org/t/top-contributors-sidebar/215110
.list-container
#list-area
> .contents
> .topic-list:has(.discourse-top-contributors) {
grid-template-areas: "head head" "body sidebar";
grid-template-rows: auto 1fr;
@include viewport.until(lg) {
grid-template-areas: "head head" "body body";
}
tbody {
display: flex;
}
.discourse-top-contributors {
width: auto;
box-sizing: border-box;
@include viewport.until(lg) {
display: none;
}
.top-contributors-heading {
font-size: var(--font-up-2);
padding-bottom: 0.5em;
}
}
}
+51 -22
View File
@@ -1,77 +1,93 @@
//temp sepeate file to avoid merge hell… to be distributed later @use "lib/viewport";
@include breakpoint(medium) {
// temp separate file to avoid merge hell… to be distributed later
@include viewport.until(lg) {
html, html,
.d-header { .d-header {
background-color: var(--d-content-background); background-color: var(--d-content-background);
} }
} }
#main-outlet-wrapper { #main-outlet-wrapper {
*[class*="navigation-"] & { *[class*="navigation-"] & {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
padding: 0; padding: 0;
} }
} }
} }
#main-outlet { #main-outlet {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
padding-top: var(--spacing-block-sm); padding-top: var(--spacing-block-sm);
} }
.list-controls { .list-controls {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
padding-inline: var( padding-inline: var(
--spacing-inline-m --spacing-inline-m
) !important; //override will be fixed when the whole chat page shenanigans is resolved ) !important; // override will be fixed when the whole chat page shenanigans is resolved
padding-block: var(--spacing-block-s); padding-block: var(--spacing-block-s);
border-bottom: 1px solid var(--primary-200); border-bottom: 1px solid var(--primary-200);
} }
.navigation-container { .navigation-container {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
gap: var(--spacing-inline-s); gap: var(--spacing-inline-s);
//dont know why we even hide this crucial navigation on mobile
.category-breadcrumb.hidden, .category-breadcrumb.hidden,
.category-breadcrumb { .category-breadcrumb {
display: flex !important; display: flex !important;
column-gap: var(--spacing-inline-s); column-gap: var(--spacing-inline-m);
row-gap: var(--spacing-block-xs); row-gap: var(--spacing-block-xs);
flex-basis: 100%; flex-basis: 100%;
li { li {
margin-right: 0; margin-right: 0;
margin-left: calc( margin-left: calc(
(var(--spacing-block-s) - 2px) * -1 (var(--spacing-block-s) - 2px) * -1
); // 2px is width of the outline ); // 2px is width of the outline
} }
.select-kit-header-wrapper {
gap: 0.25em;
}
.select-kit-header { .select-kit-header {
background: var(--d-content-background); background: var(--d-content-background);
border: 0;
} }
} }
.btn-default { .btn-default {
border: 0; border: 0;
margin-right: 0; margin-right: 0;
.d-icon { .d-icon {
font-size: var(--font-up-1); font-size: var(--font-up-1);
} }
} }
.fk-d-button-tooltip { .fk-d-button-tooltip {
margin-right: 0; margin-right: 0;
margin-left: var( margin-left: var(
--spacing-inline-xs --spacing-inline-xs
); //pure visual correction for horitzontal alignment ); // pure visual correction for horizontal alignment
&:has(#create-topic) { &:has(#create-topic) {
order: 1; order: 1;
} }
} }
} }
#navigation-bar, #navigation-bar,
.navigation-controls, .navigation-controls,
.category-breadcrumb { .category-breadcrumb {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.navigation-controls { .navigation-controls {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
gap: var(--spacing-inline-s); gap: var(--spacing-inline-s);
} }
} }
@@ -79,12 +95,12 @@
} }
.list-container { .list-container {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
padding-inline: 0 !important; padding-inline: 0 !important;
} }
.topic-list-body { .topic-list-body {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
border-top: 0; border-top: 0;
padding-top: 0; padding-top: 0;
} }
@@ -92,16 +108,18 @@
} }
#topic-title { #topic-title {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
padding-inline: var(--spacing-inline-s) !important; padding-inline: var(--spacing-inline-s) !important;
.title-wrapper { .title-wrapper {
gap: var(--spacing-block-s); gap: var(--spacing-block-s);
} }
.topic-category { .topic-category {
order: -1; order: -1;
} }
//make mixin of this
// make mixin of this
.badge-category__wrapper { .badge-category__wrapper {
font-size: var(--font-down-2-rem); font-size: var(--font-down-2-rem);
border-radius: var(--d-border-radius); border-radius: var(--d-border-radius);
@@ -123,12 +141,15 @@
oklch(from var(--category-badge-color) 100% calc(c * 0.9) h) oklch(from var(--category-badge-color) 100% calc(c * 0.9) h)
); );
} }
.discourse-tags { .discourse-tags {
gap: var(--spacing-inline-xs); gap: var(--spacing-inline-xs);
&__tag-separator { &__tag-separator {
display: none; display: none;
} }
} }
.discourse-tag { .discourse-tag {
font-size: var(--font-down-2-rem); font-size: var(--font-down-2-rem);
padding: var(--spacing-inline-xs) var(--spacing-inline-s); padding: var(--spacing-inline-xs) var(--spacing-inline-s);
@@ -139,8 +160,9 @@
} }
} }
} }
.container.posts { .container.posts {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
padding-inline: var(--spacing-inline-xs) !important; padding-inline: var(--spacing-inline-xs) !important;
.main-avatar .avatar { .main-avatar .avatar {
@@ -154,18 +176,22 @@
font-size: var(--font-0-rem); font-size: var(--font-0-rem);
} }
} }
.contents { .contents {
padding-top: var(--spacing-block-m); padding-top: var(--spacing-block-m);
} }
} }
.small-action { .small-action {
&-desc { &-desc {
padding: var(--spacing-block-xs) 0; padding: var(--spacing-block-xs) 0;
} }
//for core eventually, better way imo
// for core eventually, better way imo
.topic-avatar { .topic-avatar {
padding-top: 0; padding-top: 0;
align-items: center; align-items: center;
.d-icon { .d-icon {
font-size: var(--font-up-1); font-size: var(--font-up-1);
} }
@@ -175,29 +201,32 @@
} }
#topic-footer-buttons { #topic-footer-buttons {
@include breakpoint(mobile-extra-large) { @include viewport.until(sm) {
padding-inline: var(--spacing-inline-xs) !important; padding-inline: var(--spacing-inline-xs) !important;
} }
} }
} }
//should be changed in core, should not be a primary btn // should be changed in core, should not be a primary btn
//changing this into straight buttons to match the progress one, which doesnt work well with rounded corners // changing this into straight buttons to match the progress one, which doesn't work well with rounded corners
#topic-progress-wrapper { #topic-progress-wrapper {
.progress-back-container { .progress-back-container {
margin-right: 0; margin-right: 0;
margin-bottom: var(--spacing-block-xs); margin-bottom: var(--spacing-block-xs);
.btn-primary.progress-back { .btn-primary.progress-back {
border-radius: 0; border-radius: 0;
background: var(--secondary); background: var(--secondary);
border: 1px solid var(--tertiary-low); border: 1px solid var(--tertiary-low);
color: var(--accent-color); color: var(--accent-color);
padding: var(--spacing-inline-s) var(--spacing-inline-m); padding: var(--spacing-inline-s) var(--spacing-inline-m);
.d-icon { .d-icon {
color: var(--accent-color); color: var(--accent-color);
} }
} }
} }
.topic-admin-menu-trigger { .topic-admin-menu-trigger {
border-radius: 0; border-radius: 0;
background: var(--secondary); background: var(--secondary);
+10 -3
View File
@@ -8,29 +8,35 @@
.navigation-container { .navigation-container {
gap: 1rem; gap: 1rem;
.category-breadcrumb { .category-breadcrumb {
order: 1; order: 1;
} }
} }
.combo-box .combo-box-header { .combo-box .combo-box-header {
// needs more specificy than just in the button file // needs more specificity than just in the button file
background-color: var(--secondary); background-color: var(--secondary);
border-radius: var(--d-border-radius-large); border-radius: var(--d-border-radius);
border: 1px solid var(--primary-300); border: 1px solid var(--primary-300);
&:hover { &:hover {
border: 1px solid var(--accent-color); border: 1px solid var(--accent-color);
} }
&:focus-visible { &:focus-visible {
.discourse-no-touch & { .discourse-no-touch & {
background: var(--secondary); background: var(--secondary);
color: var(--accent-color); color: var(--accent-color);
box-shadow: 0px 0px 0px 3px var(--button-box-shadow); box-shadow: 0 0 0 3px var(--button-box-shadow);
.d-icon { .d-icon {
color: var(--accent-color); color: var(--accent-color);
} }
} }
} }
} }
.select-kit.combo-box.category-drop.has-selection .select-kit.combo-box.category-drop.has-selection
.category-drop-header:hover { .category-drop-header:hover {
border-color: transparent; border-color: transparent;
@@ -47,6 +53,7 @@
.discourse-no-touch & { .discourse-no-touch & {
background: transparent; background: transparent;
color: var(--d-nav-color--hover); color: var(--d-nav-color--hover);
&::after { &::after {
content: ""; content: "";
position: absolute; position: absolute;
+66
View File
@@ -0,0 +1,66 @@
@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;
isolation: isolate;
}
.container.list-container::before{
position: absolute;
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background:
linear-gradient(
180deg,
rgb(var(--secondary-rgb) / 0.46) 0%,
rgb(var(--secondary-rgb) / 0.34) 100%
);
border-radius: var(--d-border-radius);
backdrop-filter: blur(8px);
box-shadow: rgb(0 0 0 / 28%) 0 10px 26px -16px;
pointer-events: none;
z-index: 0;
}
.container.list-container > * {
position: relative;
z-index: 1;
}
.topic-list-header{
background-color: transparent;
}
.list-controls, .search-container{
border-radius: var(--d-border-radius);
}
.welcome-banner {
padding: 0 !important;
box-shadow: #00000094 0 0 11px 0;
}
#list-area{
background-color: transparent;
}
.regular.ember-view{
background-color: rgb(var(--secondary-rgb) / 0.58);
border-radius: var(--d-border-radius);
backdrop-filter: blur(10px);
box-shadow: rgb(0 0 0 / 24%) 0 10px 24px -14px;
padding: 24px;
}
+7
View File
@@ -5,6 +5,12 @@
} }
} }
.has-ai-conversations-sidebar {
.sidebar-new-topic-button__wrapper {
display: none;
}
}
.sidebar-new-topic-button { .sidebar-new-topic-button {
flex: 1 1 auto; flex: 1 1 auto;
@@ -45,6 +51,7 @@
border-radius: 0 var(--d-button-border-radius) border-radius: 0 var(--d-button-border-radius)
var(--d-button-border-radius) 0; var(--d-button-border-radius) 0;
padding-right: 0.65em; padding-right: 0.65em;
.d-icon { .d-icon {
color: var(--secondary); color: var(--secondary);
} }
+27 -7
View File
@@ -1,18 +1,24 @@
@use "lib/viewport";
.sidebar-wrapper, .sidebar-wrapper,
.sidebar-hamburger-dropdown { .sidebar-hamburger-dropdown {
@include breakpoint(medium) { @include viewport.until(lg) {
background: var(--secondary); background: var(--secondary);
.sidebar-footer-wrapper { .sidebar-footer-wrapper {
background: var(--secondary); background: var(--secondary);
.sidebar-footer-container::before { .sidebar-footer-container::before {
display: none; display: none;
} }
} }
} }
.has-full-page-chat &, .has-full-page-chat &,
.has-full-page-chat & .sidebar-footer-wrapper { .has-full-page-chat & .sidebar-footer-wrapper {
background: transparent; background: transparent;
} }
.sidebar-container { .sidebar-container {
border-right: none; border-right: none;
} }
@@ -20,31 +26,38 @@
.sidebar-sections { .sidebar-sections {
padding: 0; padding: 0;
} }
.sidebar-section-link { .sidebar-section-link {
transition: none; transition: none;
border-radius: var(--d-border-radius); border-radius: var(--d-border-radius);
} }
.dropdown-menu__item .sidebar-section-link { .dropdown-menu__item .sidebar-section-link {
border-radius: 0px; border-radius: 0;
} }
} }
.sidebar-section-wrapper { .sidebar-section-wrapper {
@include breakpoint(extra-large, $rule: min-width) { @include viewport.from(xl) {
padding-block: 0.45em; padding-block: 0.45em;
} }
@include breakpoint(mobile-extra-large) {
@include viewport.until(sm) {
.hamburger-panel .revamped & { .hamburger-panel .revamped & {
margin-bottom: var(--spacing-block-m); margin-bottom: var(--spacing-block-m);
} }
} }
.sidebar-section-header { .sidebar-section-header {
font-size: var(--font-down-2); font-size: var(--font-down-2);
} }
.sidebar-section-content { .sidebar-section-content {
margin: 0; margin: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@include breakpoint(extra-large, $rule: min-width) {
@include viewport.from(xl) {
gap: var(--spacing-block-xs); gap: var(--spacing-block-xs);
} }
} }
@@ -52,6 +65,7 @@
.sidebar-wrapper .sidebar-sections { .sidebar-wrapper .sidebar-sections {
--scrollbarThumbBg: var(--d-selected); --scrollbarThumbBg: var(--d-selected);
padding: 0 1rem;
} }
.sidebar-section-link-wrapper .sidebar-section-link:focus, .sidebar-section-link-wrapper .sidebar-section-link:focus,
@@ -63,11 +77,17 @@
.sidebar-new-topic-button__wrapper { .sidebar-new-topic-button__wrapper {
margin: 0 var(--spacing-inline-m) var(--spacing-block-l); margin: 0 var(--spacing-inline-m) var(--spacing-block-l);
.sidebar-new-topic-button .d-icon { .sidebar-new-topic-button .d-icon {
display: none; display: none;
} }
} }
.sidebar-wrapper .sidebar-sections { // put the draft menu above the slide-out hamburger on small desktop screens
padding: 0 1rem; @include viewport.until(md) {
html:not(.mobile-view) {
.topic-drafts-menu-content {
z-index: z("modal", "overlay");
}
}
} }
+565 -401
View File
File diff suppressed because it is too large Load Diff
+11 -13
View File
@@ -1,3 +1,5 @@
@use "lib/viewport";
.post-stream { .post-stream {
.contents { .contents {
font-size: var(--font-up-1); font-size: var(--font-up-1);
@@ -6,21 +8,14 @@
} }
} }
.container.posts .topic-navigation:not(.with-topic-progress) {
// super fragile because new sticky topic title doesnt have a calculated value (= 53px with this font and size but…)
top: calc(
var(--header-offset, 60px) + 53px + calc(var(--spacing-block-l) * 2)
);
z-index: 300;
}
.timeline-container .topic-timeline { .timeline-container .topic-timeline {
min-width: unset; // why we have this? min-width: unset; // why we have this?
.timeline-scrollarea { .timeline-scrollarea {
border-left: 1px solid var(--accent-color); border-left: 1px solid var(--accent-color);
.timeline-scroller { .timeline-scroller {
@include breakpoint("medium", $rule: min-width) { @include viewport.from(lg) {
margin-left: -4.5px; margin-left: -4.5px;
background: var(--d-content-background); background: var(--d-content-background);
height: 40px !important; // height is coming from element style have no other choice height: 40px !important; // height is coming from element style have no other choice
@@ -31,9 +26,11 @@
line-height: 1; line-height: 1;
} }
} }
.timeline-handle { .timeline-handle {
background-color: var(--accent-color); background-color: var(--accent-color);
@include breakpoint("medium", $rule: min-width) {
@include viewport.from(lg) {
width: 8px; width: 8px;
border-radius: 10px; border-radius: 10px;
height: calc(100% - 6px); height: calc(100% - 6px);
@@ -42,9 +39,9 @@
} }
} }
//should probably get rid of this extra specificity class in core? // should probably get rid of this extra specificity class in core?
.timeline-container.timeline-fullscreen { .timeline-container.timeline-fullscreen {
@include breakpoint("medium", $rule: max-width) { @include viewport.until(lg) {
.topic-timeline .topic-timeline
.timeline-scrollarea .timeline-scrollarea
.timeline-scroller .timeline-scroller
@@ -56,7 +53,8 @@
.container.posts { .container.posts {
grid-template-columns: auto 8em; grid-template-columns: auto 8em;
@media screen and (max-width: 924px) {
@media screen and (width <= 924px) {
grid-template-columns: auto auto; grid-template-columns: auto auto;
} }
+2 -2
View File
@@ -3,8 +3,8 @@
--d-border-radius-large: 20px; --d-border-radius-large: 20px;
--d-border-radius: 8px; --d-border-radius: 8px;
--d-input-border-radius: 6px; --d-input-border-radius: 6px;
// --d-sidebar-row-height: 2.8em;
//the idea is: block spacing can grow with font-size, but inline spacing should not to maintain horizontal (text) alignment // the idea is: block spacing can grow with font-size, but inline spacing should not to maintain horizontal (text) alignment
--spacing-block-xs: 0.25em; --spacing-block-xs: 0.25em;
--spacing-block-s: 0.5em; --spacing-block-s: 0.5em;
--spacing-block-sm: 0.75em; --spacing-block-sm: 0.75em;
+27 -11
View File
@@ -1,3 +1,5 @@
@use "lib/viewport";
.welcome-banner { .welcome-banner {
&__wrap { &__wrap {
display: grid; display: grid;
@@ -9,11 +11,11 @@
padding: 1.5em 0 2.5em; padding: 1.5em 0 2.5em;
margin-bottom: 0; margin-bottom: 0;
@media screen and (max-width: 768px) { @media screen and (width <= 768px) {
padding: 1em; padding: 1em;
} }
@include breakpoint("mobile-extra-large") { @include viewport.until(sm) {
display: block; display: block;
padding: 0.5em; padding: 0.5em;
margin-top: 0; margin-top: 0;
@@ -24,22 +26,27 @@
grid-row: 1/-1; grid-row: 1/-1;
width: 100%; width: 100%;
align-self: center; align-self: center;
@media screen and (max-width: 1028px) {
@media screen and (width <= 1028px) {
grid-row: 2/-1; grid-row: 2/-1;
grid-column: 1/-1; grid-column: 1/-1;
} }
@media screen and (max-width: 768px) {
@media screen and (width <= 768px) {
grid-column: 2/-1; grid-column: 2/-1;
grid-row: 1/-1; grid-row: 1/-1;
} }
@media screen and (max-width: 600px) {
@media screen and (width <= 600px) {
grid-row: 2/-1; grid-row: 2/-1;
grid-column: 1/-1; grid-column: 1/-1;
} }
@include breakpoint("mobile-extra-large") {
@include viewport.until(sm) {
display: none; display: none;
} }
} }
p { p {
display: none; display: none;
} }
@@ -49,24 +56,29 @@
.search-menu-container .search-input { .search-menu-container .search-input {
background: var(--d-content-background); background: var(--d-content-background);
border: 1px solid var(--search-color); border: 1px solid var(--search-color);
box-shadow: 0 4px 10px rgba(52, 6, 121, 15%); box-shadow: 0 4px 10px rgb(52, 6, 121, 15%);
} }
.search-menu .search-input:focus-within, .search-menu .search-input:focus-within,
.search-menu-container .search-input:focus-within { .search-menu-container .search-input:focus-within {
border: 1px solid var(--search-color); border: 1px solid var(--search-color);
outline: 2px solid var(--search-color); outline: 2px solid var(--search-color);
} }
.search-menu .d-icon, .search-menu .d-icon,
.search-menu .searching .d-icon, .search-menu .searching .d-icon,
.search-menu .searching .show-advanced-search .d-icon { .search-menu .searching .show-advanced-search .d-icon {
color: var(--search-color); color: var(--search-color);
} }
.panel-body { .panel-body {
z-index: z("dropdown"); z-index: z("dropdown");
} }
.results { .results {
background: var(--d-content-background); background: var(--d-content-background);
} }
&__title { &__title {
grid-column: 1/2; grid-column: 1/2;
grid-row: 1/-1; grid-row: 1/-1;
@@ -75,26 +87,30 @@
margin: 0; margin: 0;
font-weight: 400; font-weight: 400;
color: var(--search-color); color: var(--search-color);
@media screen and (max-width: 1028px) {
@media screen and (width <= 1028px) {
font-size: var(--font-up-4); font-size: var(--font-up-4);
grid-column: 1/-1; grid-column: 1/-1;
grid-row: 1; grid-row: 1;
text-align: center; text-align: center;
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
@media screen and (max-width: 768px) {
@media screen and (width <= 768px) {
text-align: left; text-align: left;
grid-column: 1/2; grid-column: 1/2;
grid-row: 1/-1; grid-row: 1/-1;
font-size: var(--font-up-3); font-size: var(--font-up-3);
} }
@media screen and (max-width: 600px) {
@media screen and (width <= 600px) {
grid-column: 1/-1; grid-column: 1/-1;
grid-row: 1; grid-row: 1;
text-align: center; text-align: center;
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
@include breakpoint("mobile-extra-large") {
@include viewport.until(sm) {
font-size: var(--font-up-2); font-size: var(--font-up-2);
} }
} }
+6
View File
@@ -9,3 +9,9 @@ search_experience:
- search_field - search_field
- search_icon - search_icon
description: "Overrides the core `search experience` site setting" description: "Overrides the core `search experience` site setting"
home_bg_image:
type: upload
default: ""
description: "首页背景图"
+2 -3
View File
@@ -36,9 +36,8 @@ describe "Horizon theme | High level", type: :system do
expect(topic_item.all("td").map { |el| el["class"] }).to eq( expect(topic_item.all("td").map { |el| el["class"] }).to eq(
[ [
"main-link topic-list-data", "main-link topic-list-data",
"topic-status-data",
"topic-category-data", "topic-category-data",
"topic-likes-replies-data", "topic-creator-data",
"topic-activity-data", "topic-activity-data",
], ],
) )
@@ -49,7 +48,7 @@ describe "Horizon theme | High level", type: :system do
# Can change site colors from the sidebar palette, which are remembered # Can change site colors from the sidebar palette, which are remembered
# across page reloads. # across page reloads.
marigold_palette = ColorScheme.find_by(name: "Marigold") marigold_palette = theme.color_schemes.find_by(name: "Marigold")
palette_selector.open_palette_menu palette_selector.open_palette_menu
palette_selector.click_palette_menu_item(marigold_palette.name) palette_selector.click_palette_menu_item(marigold_palette.name)
expect(palette_selector).to have_no_palette_menu expect(palette_selector).to have_no_palette_menu
@@ -26,7 +26,9 @@ module PageObjects
end end
def has_selected_palette?(palette) def has_selected_palette?(palette)
has_css?(".user-color-palette-selector[data-selected-color-palette-id='#{palette.id}']") has_css?(
".user-color-palette-selector-trigger[data-selected-color-palette-id=\"#{palette.id}\"]",
)
end end
def has_loaded_css? def has_loaded_css?
@@ -6,7 +6,7 @@ describe "Horizon theme | User color palette selector", type: :system do
let(:set_theme_as_default) { true } let(:set_theme_as_default) { true }
let!(:theme) do let!(:theme) do
horizon_theme = upload_theme(set_theme_as_default: set_theme_as_default) horizon_theme = upload_theme(set_theme_as_default: set_theme_as_default)
ColorScheme.where(theme_id: horizon_theme.id).update_all(user_selectable: true) horizon_theme.color_schemes.update_all(user_selectable: true)
horizon_theme horizon_theme
end end
fab!(:current_user) { Fabricate(:user) } fab!(:current_user) { Fabricate(:user) }
@@ -16,8 +16,8 @@ describe "Horizon theme | User color palette selector", type: :system do
let(:interface_color_selector) do let(:interface_color_selector) do
PageObjects::Components::InterfaceColorSelector.new(".sidebar-footer-actions") PageObjects::Components::InterfaceColorSelector.new(".sidebar-footer-actions")
end end
let(:marigold_palette) { ColorScheme.find_by(name: "Marigold") } let(:marigold_palette) { theme.color_schemes.find_by(name: "Marigold") }
let(:marigold_palette_dark) { ColorScheme.find_by(name: "Marigold Dark") } let(:marigold_palette_dark) { theme.color_schemes.find_by(name: "Marigold Dark") }
before { SiteSetting.interface_color_selector = "sidebar_footer" } before { SiteSetting.interface_color_selector = "sidebar_footer" }
+3
View File
@@ -0,0 +1,3 @@
export default {
extends: ["@discourse/lint-configs/stylelint"],
};