Compare commits

..

1 Commits

Author SHA1 Message Date
Jordan Vidrine 4e6b4a6c80 add radius to modals 2025-05-13 14:25:08 -05:00
40 changed files with 1490 additions and 1807 deletions
-2
View File
@@ -1,2 +0,0 @@
< 3.5.0.beta5-dev: 31249c4f27d93e83c6b83d42d93974522a9a612e
+13 -13
View File
@@ -15,16 +15,16 @@ GEM
tzinfo (~> 2.0, >= 2.0.5) tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1) uri (>= 0.13.1)
ast (2.4.3) ast (2.4.3)
base64 (0.3.0) base64 (0.2.0)
benchmark (0.4.1) benchmark (0.4.0)
bigdecimal (3.2.2) bigdecimal (3.1.9)
concurrent-ruby (1.3.5) concurrent-ruby (1.3.5)
connection_pool (2.5.3) connection_pool (2.5.3)
drb (2.2.3) drb (2.2.1)
i18n (1.14.7) i18n (1.14.7)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
json (2.12.2) json (2.11.3)
language_server-protocol (3.17.0.5) language_server-protocol (3.17.0.4)
lint_roller (1.1.0) lint_roller (1.1.0)
logger (1.7.0) logger (1.7.0)
minitest (5.25.5) minitest (5.25.5)
@@ -35,10 +35,10 @@ GEM
prettier_print (1.2.1) prettier_print (1.2.1)
prism (1.4.0) prism (1.4.0)
racc (1.8.1) racc (1.8.1)
rack (3.1.15) rack (3.1.13)
rainbow (3.1.1) rainbow (3.1.1)
regexp_parser (2.10.0) regexp_parser (2.10.0)
rubocop (1.76.0) rubocop (1.75.4)
json (~> 2.3) json (~> 2.3)
language_server-protocol (~> 3.17.0.2) language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0) lint_roller (~> 1.1.0)
@@ -46,10 +46,10 @@ GEM
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.9.3, < 3.0) regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.45.0, < 2.0) rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0) unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.45.0) rubocop-ast (1.44.1)
parser (>= 3.3.7.2) parser (>= 3.3.7.2)
prism (~> 1.4) prism (~> 1.4)
rubocop-capybara (2.22.1) rubocop-capybara (2.22.1)
@@ -67,12 +67,12 @@ GEM
rubocop-factory_bot (2.27.1) rubocop-factory_bot (2.27.1)
lint_roller (~> 1.1) lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1) rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.32.0) rubocop-rails (2.31.0)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
lint_roller (~> 1.1) lint_roller (~> 1.1)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0) rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0) rubocop-ast (>= 1.38.0, < 2.0)
rubocop-rspec (3.6.0) rubocop-rspec (3.6.0)
lint_roller (~> 1.1) lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1) rubocop (~> 1.72, >= 1.72.1)
@@ -99,4 +99,4 @@ DEPENDENCIES
syntax_tree syntax_tree
BUNDLED WITH BUNDLED WITH
2.6.9 2.6.8
+2 -150
View File
@@ -1,151 +1,3 @@
# discourse_theme_ranHorizon 主题源码) Horizon is a simple, beautiful theme that improves the out-of-the-box experience for Discourse sites.
> 该仓库是 Discourse `Horizon (beta)` 主题的源码副本。仓库内原 README 已标注该主题已并入 Discourse Core。 https://meta.discourse.org/t/horizon-theme/360486
## 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 主题的样式组织方式与前端扩展点。
+9 -8
View File
@@ -1,12 +1,14 @@
{ {
"name": "Horizon-shiran", "name": "Horizon",
"authors": "shiran", "authors": "Design Team",
"about_url": "", "about_url": "https://meta.discourse.org/t/horizon-theme/360486",
"license_url": "https://gitea.s1f.ren/shiran/discourse_theme_ran/horizon/blob/main/LICENSE", "license_url": "https://github.com/discourse/horizon/blob/main/LICENSE",
"learn_more": "", "learn_more": "https://meta.discourse.org/t/installing-a-theme-or-theme-component/63682",
"theme_version": "0.0.1", "theme_version": "0.0.1",
"modifiers": { "modifiers": {
"svg_icons": ["fire"], "svg_icons": [
"fire"
],
"serialize_topic_is_hot": true "serialize_topic_is_hot": true
}, },
"color_schemes": { "color_schemes": {
@@ -130,6 +132,5 @@
"header_primary": "ffffff", "header_primary": "ffffff",
"hover": "584B3E" "hover": "584B3E"
} }
}, }
"screenshots": ["screenshots/light.png", "screenshots/dark.png"]
} }
-2
View File
@@ -1,7 +1,6 @@
@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";
@@ -18,4 +17,3 @@
@import "topic"; @import "topic";
@import "topic-cards"; @import "topic-cards";
@import "variables"; @import "variables";
@import "self";
+1 -2
View File
@@ -1,7 +1,6 @@
<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 = 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>.';
'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>
@@ -1,6 +1,9 @@
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() {
@@ -24,25 +27,37 @@ 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.firstPosterUser, user: this.args.topic.creator,
username: this.args.topic.last_poster_username, username: this.args.topic.creator.username,
class: "--created", activityText: "user_posted",
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 @topic.bumpedAt leaveAgo="true" format="tiny"}} {{formatDate
@topic.bumpedAt
leaveAgo="true"
format="medium-with-ago-and-on"
}}
</div> </div>
</span> </span>
</template> </template>
@@ -1,17 +0,0 @@
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,12 +1,9 @@
import { gt } from "truth-helpers";
import icon from "discourse/helpers/d-icon"; import icon from "discourse/helpers/d-icon";
import number from "discourse/helpers/number"; import gt from "truth-helpers/helpers/gt";
const TopicRepliesColumn = <template> const TopicRepliesColumn = <template>
{{#if (gt @topic.replyCount 1)}} {{#if (gt @topic.replyCount 1)}}
<span class="topic-replies">{{icon "reply"}}{{number <span class="topic-replies">{{icon "reply"}}{{@topic.posts_count}}</span>
@topic.posts_count
}}</span>
{{/if}} {{/if}}
</template>; </template>;
@@ -30,9 +30,7 @@ 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
}}<p class="topic-status-card__name">{{i18n }}{{i18n (themePrefix this.badge.text)}}</span>
(themePrefix this.badge.text)
}}</p></span>
{{/if}} {{/if}}
</template> </template>
} }
@@ -5,8 +5,9 @@ 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 willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
import { service } from "@ember/service"; import { service } from "@ember/service";
import { gt, not } from "truth-helpers"; import { gt } 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;
@@ -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 TopicCreatorColumn from "../components/card/topic-creator-column"; import TopicLikesColumn from "../components/card/topic-likes-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,18 +23,13 @@ const TopicCategory = <template>
</td> </td>
</template>; </template>;
const TopicReplies = <template> const TopicLikesReplies = <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",
@@ -54,11 +49,7 @@ export default {
}); });
columns.add("topic-likes-replies", { columns.add("topic-likes-replies", {
item: TopicReplies, item: TopicLikesReplies,
after: "topic-author-avatar",
});
columns.add("topic-creator", {
item: TopicCreator,
after: "topic-author-avatar", after: "topic-author-avatar",
}); });
columns.delete("views"); columns.delete("views");
@@ -85,9 +76,6 @@ 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;
} }
); );
@@ -95,34 +83,6 @@ 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 -1
View File
@@ -1,6 +1,6 @@
en: en:
theme_metadata: theme_metadata:
description: "自制二次元的半透明主题" description: "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"
+4 -4
View File
@@ -1,11 +1,11 @@
{ {
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"@discourse/lint-configs": "2.25.0", "@discourse/lint-configs": "2.11.1",
"ember-template-lint": "7.8.1", "ember-template-lint": "7.0.1",
"eslint": "9.28.0", "eslint": "9.22.0",
"prettier": "3.5.3", "prettier": "3.5.3",
"stylelint": "16.20.0" "stylelint": "16.16.0"
}, },
"engines": { "engines": {
"node": ">= 22", "node": ">= 22",
+873 -326
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

+13 -44
View File
@@ -1,6 +1,4 @@
@use "lib/viewport"; @media screen and (min-width: 1300px) {
@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);
@@ -22,7 +20,7 @@
.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 viewport.until(lg) { @include breakpoint(medium) {
margin-bottom: 0; margin-bottom: 0;
} }
} }
@@ -30,7 +28,7 @@
.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 viewport.until(lg) { @include breakpoint(medium) {
margin-bottom: 0; margin-bottom: 0;
} }
} }
@@ -42,16 +40,17 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
position: relative; position: relative;
container: content-width / inline-size;
@include viewport.until(lg) { @include breakpoint(medium) {
display: none; display: none;
} }
@media screen and (width <= 488px) { @media screen and (max-width: 488px) {
display: none; display: none;
} }
@include viewport.until(md) { @include breakpoint(tablet) {
display: none; display: none;
} }
@@ -94,7 +93,7 @@
bottom: var(--main-grid-gap); bottom: var(--main-grid-gap);
left: var(--left-distance); left: var(--left-distance);
@media screen and (width <= 768px) { @media screen and (max-width: 768px) {
bottom: calc(var(--d-border-radius-large) * 2); bottom: calc(var(--d-border-radius-large) * 2);
} }
} }
@@ -104,7 +103,7 @@
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 (width <= 768px) { @media screen and (max-width: 768px) {
bottom: calc(var(--d-border-radius-large) * 2); bottom: calc(var(--d-border-radius-large) * 2);
} }
} }
@@ -118,7 +117,7 @@
left: var(--left-distance); left: var(--left-distance);
height: var(--main-grid-gap); height: var(--main-grid-gap);
@media screen and (width <= 768px) { @media screen and (max-width: 768px) {
height: calc(var(--d-border-radius-large) * 2); height: calc(var(--d-border-radius-large) * 2);
} }
@@ -128,37 +127,7 @@
} }
} }
.rtl .experimental-screen { @media screen and (min-width: 768px) {
&__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) +
@@ -167,7 +136,7 @@
} }
} }
@media screen and (width <= 768px) { @media screen and (max-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) +
@@ -176,7 +145,7 @@
} }
} }
@media screen and (width <= 400px) { @media screen and (max-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));
} }
-363
View File
@@ -1,363 +0,0 @@
@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);
}
}
}
}
+1 -31
View File
@@ -1,13 +1,9 @@
@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);
} }
@@ -23,30 +19,10 @@ body.has-full-page-chat {
.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 {
@@ -78,11 +54,5 @@ 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("modal", "dialog"); z-index: z("composer", "content") + 1;
}
.chat-replying-indicator-container {
@include viewport.from(sm) {
margin-left: calc(0.65em + 0.2rem);
}
} }
+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: rgb(var(--tertiary-50-rgb), 1); --d-sidebar-footer-fade: rgba(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),
+1 -1
View File
@@ -2,7 +2,7 @@
display: none; display: none;
} }
@media screen and (width >= 1300px) { @media screen and (min-width: 1300px) {
html:not(.fullscreen-composer) { html:not(.fullscreen-composer) {
.peek-mode-toggle svg { .peek-mode-toggle svg {
transform: scaleX(-1); transform: scaleX(-1);
+1 -5
View File
@@ -1,5 +1,3 @@
@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 {
@@ -14,15 +12,13 @@
} }
#reply-control.hide-preview:not(.draft) { #reply-control.hide-preview:not(.draft) {
@include viewport.from(sm) { @include breakpoint("mobile-extra-large", $rule: min-width) {
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,
+9 -11
View File
@@ -1,5 +1,3 @@
@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.
@@ -25,7 +23,7 @@ $sidebar-width: 17em;
body:not(.has-sidebar-page) & { body:not(.has-sidebar-page) & {
max-width: unset; max-width: unset;
@include viewport.until(sm) { @include breakpoint("mobile-extra-large") {
max-width: 25vw; max-width: 25vw;
} }
} }
@@ -105,7 +103,7 @@ $sidebar-width: 17em;
grid-area: extra-info; grid-area: extra-info;
white-space: nowrap; white-space: nowrap;
@include viewport.until(md) { @include breakpoint("tablet") {
display: none; display: none;
} }
} }
@@ -129,7 +127,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 (width <= 1400px) { @media screen and (max-width: 1400px) {
grid-template-columns: grid-template-columns:
calc(var(--d-sidebar-width) - 11px) calc(var(--d-sidebar-width) - 11px)
1fr 1fr
@@ -138,7 +136,7 @@ $sidebar-width: 17em;
auto; auto;
} }
@media screen and (width <= 1000px) { @media screen and (max-width: 1000px) {
gap: 0.5em; gap: 0.5em;
} }
@@ -191,11 +189,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 viewport.until(md) { @include breakpoint(tablet) {
grid-area: rspace; grid-area: rspace;
} }
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
display: none; display: none;
} }
} }
@@ -210,7 +208,7 @@ body.has-sidebar-page {
padding: 0; padding: 0;
} }
@media screen and (width >= calc($reply-area-max-width + ($sidebar-width * 2))) { @media screen and (min-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;
@@ -221,7 +219,7 @@ body.has-sidebar-page {
} }
} }
@media screen and (width <= calc($reply-area-max-width + ($sidebar-width * 2))) and (width >= calc($reply-area-max-width + calc($sidebar-width / 2))) { @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))) {
#reply-control.show-preview:not(.fullscreen) { #reply-control.show-preview:not(.fullscreen) {
margin-left: $sidebar-width; margin-left: $sidebar-width;
width: auto; width: auto;
@@ -267,7 +265,7 @@ body.sidebar-animate {
} }
// provides some extra space for login buttons // provides some extra space for login buttons
@media screen and (width >= 1400px) { @media screen and (min-width: 1400px) {
.anon { .anon {
.d-header .panel { .d-header .panel {
grid-column-start: -4; grid-column-start: -4;
+13 -31
View File
@@ -1,9 +1,8 @@
// 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-header .topic-list-data.default {
position: relative; position: sticky;
top: 0; top: 10em;
z-index: 2;
} }
.topic-author-avatar-data { .topic-author-avatar-data {
@@ -14,7 +13,7 @@
grid-area: bulk-select; grid-area: bulk-select;
margin-left: -0.5em; margin-left: -0.5em;
@media screen and (width <= 576px) { @media screen and (max-width: 576px) {
margin-top: 0; margin-top: 0;
label { label {
@@ -29,29 +28,18 @@
} }
.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.25rem 0; padding: 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 {
border-radius: var(--d-border-radius);
.bulk-select, .bulk-select,
span:not(.bulk-select-topics, .d-button-label) { span:not(.bulk-select-topics, .d-button-label) {
display: none; display: none;
@@ -59,25 +47,19 @@
} }
} }
// bulk select
.bulk-select-topics { .bulk-select-topics {
position: absolute; position: absolute;
right: 0.25rem; right: -1em;
top: 50%; background: var(--secondary);
transform: translateY(-50%); border-radius: 0 0 0 var(--d-border-radius);
background: color-mix(in srgb, var(--d-content-background) 88%, white 12%); padding: 1em;
border: 1px solid var(--primary-200);
border-radius: 999px; @media screen and (max-width: 1048px) {
box-shadow: 0 6px 18px -12px rgb(10 18 35 / 35%); right: 0;
display: flex; }
gap: 0.5rem;
margin: 0;
padding: 0.25rem;
button { button {
white-space: nowrap; white-space: nowrap;
margin: 0;
border-radius: 999px;
} }
} }
} }
+1 -3
View File
@@ -1,10 +1,8 @@
@use "lib/viewport";
.d-header { .d-header {
box-shadow: none; box-shadow: none;
background: var(--background-color); background: var(--background-color);
@include viewport.from(xl) { @include breakpoint(extra-large, $rule: min-width) {
padding-bottom: var(--main-grid-gap); padding-bottom: var(--main-grid-gap);
} }
} }
+3 -1
View File
@@ -2,6 +2,8 @@
.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;
} }
+10 -18
View File
@@ -1,5 +1,3 @@
@use "lib/viewport";
:root { :root {
--main-grid-gap: 0.5em; --main-grid-gap: 0.5em;
} }
@@ -7,7 +5,7 @@
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 viewport.until(sm) { @include breakpoint("mobile-extra-large") {
background-color: var(--d-content-background); background-color: var(--d-content-background);
} }
} }
@@ -15,7 +13,7 @@ html:not(:has(.has-full-page-chat)) {
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
@include viewport.until(sm) { @include breakpoint("mobile-extra-large") {
background-color: var(--d-content-background); background-color: var(--d-content-background);
} }
} }
@@ -37,7 +35,7 @@ body.has-full-page-chat:not(.has-sidebar-page) {
#main-outlet-wrapper { #main-outlet-wrapper {
gap: var(--main-grid-gap); gap: var(--main-grid-gap);
@include viewport.until(lg) { @include breakpoint(medium) {
gap: 0; gap: 0;
} }
} }
@@ -52,22 +50,22 @@ body.has-sidebar-page #main-outlet-wrapper {
} }
body:not(.has-sidebar-page) #main-outlet-wrapper { body:not(.has-sidebar-page) #main-outlet-wrapper {
@include viewport.from(lg) { @include breakpoint(medium, $rule: min-width) {
grid-template-columns: 0 minmax(0, 1fr) 0; grid-template-columns: 0 minmax(0, 1fr) 0;
} }
} }
body:not(.has-full-page-chat, .wizard) { body:not(.has-full-page-chat, .wizard) {
@include viewport.from(xl) { @include breakpoint(extra-large, $rule: min-width) {
background-color: var(--background-color); background-color: var(--background-color);
} }
#main-outlet-wrapper { #main-outlet-wrapper {
@include viewport.until(lg) { @include breakpoint(medium) {
--main-grid-gap: 0; --main-grid-gap: 0;
} }
@media screen and (width >= 768px) { @media screen and (min-width: 768px) {
gap: var(--main-grid-gap); gap: var(--main-grid-gap);
} }
@@ -78,7 +76,7 @@ body:not(.has-full-page-chat, .wizard) {
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 viewport.until(lg) { @include breakpoint(medium) {
border-radius: 0; border-radius: 0;
} }
@@ -87,7 +85,7 @@ body:not(.has-full-page-chat, .wizard) {
} }
> *:not(.experimental-screen, .activate-account) { > *:not(.experimental-screen, .activate-account) {
@include viewport.from(lg) { @include breakpoint(medium, $rule: min-width) {
box-sizing: border-box; box-sizing: border-box;
max-width: 1000px; max-width: 1000px;
margin-inline: auto; margin-inline: auto;
@@ -98,15 +96,9 @@ body:not(.has-full-page-chat, .wizard) {
} }
} }
@include viewport.until(sm) {
.welcome-banner {
display: none;
}
}
#list-area { #list-area {
.show-more.has-topics { .show-more.has-topics {
@include viewport.from(lg) { @include breakpoint(medium, $rule: min-width) {
width: auto; width: auto;
right: 50%; right: 50%;
transform: translateX(50%); transform: translateX(50%);
+3 -33
View File
@@ -1,5 +1,3 @@
@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);
} }
@@ -71,7 +69,7 @@ input[type="color"]:focus,
background-color: var(--background-color); background-color: var(--background-color);
} }
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
// 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;
@@ -108,34 +106,6 @@ input[type="color"]:focus,
border-radius: 0; border-radius: 0;
} }
// compatibility with the top contributors sidebar theme component .d-modal__container {
// https://meta.discourse.org/t/top-contributors-sidebar/215110 border-radius: var(--d-border-radius);
.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;
}
}
} }
+15 -19
View File
@@ -1,7 +1,5 @@
@use "lib/viewport";
// temp separate file to avoid merge hell… to be distributed later // temp separate file to avoid merge hell… to be distributed later
@include viewport.until(lg) { @include breakpoint(medium) {
html, html,
.d-header { .d-header {
background-color: var(--d-content-background); background-color: var(--d-content-background);
@@ -10,19 +8,19 @@
#main-outlet-wrapper { #main-outlet-wrapper {
*[class*="navigation-"] & { *[class*="navigation-"] & {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
padding: 0; padding: 0;
} }
} }
} }
#main-outlet { #main-outlet {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
padding-top: var(--spacing-block-sm); padding-top: var(--spacing-block-sm);
} }
.list-controls { .list-controls {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
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
@@ -31,13 +29,14 @@
} }
.navigation-container { .navigation-container {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
gap: var(--spacing-inline-s); gap: var(--spacing-inline-s);
// don't 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-m); column-gap: var(--spacing-inline-s);
row-gap: var(--spacing-block-xs); row-gap: var(--spacing-block-xs);
flex-basis: 100%; flex-basis: 100%;
@@ -48,12 +47,9 @@
); // 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;
} }
} }
@@ -81,13 +77,13 @@
#navigation-bar, #navigation-bar,
.navigation-controls, .navigation-controls,
.category-breadcrumb { .category-breadcrumb {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
margin-bottom: 0; margin-bottom: 0;
} }
} }
.navigation-controls { .navigation-controls {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
gap: var(--spacing-inline-s); gap: var(--spacing-inline-s);
} }
} }
@@ -95,12 +91,12 @@
} }
.list-container { .list-container {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
padding-inline: 0 !important; padding-inline: 0 !important;
} }
.topic-list-body { .topic-list-body {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
border-top: 0; border-top: 0;
padding-top: 0; padding-top: 0;
} }
@@ -108,7 +104,7 @@
} }
#topic-title { #topic-title {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
padding-inline: var(--spacing-inline-s) !important; padding-inline: var(--spacing-inline-s) !important;
.title-wrapper { .title-wrapper {
@@ -162,7 +158,7 @@
} }
.container.posts { .container.posts {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
padding-inline: var(--spacing-inline-xs) !important; padding-inline: var(--spacing-inline-xs) !important;
.main-avatar .avatar { .main-avatar .avatar {
@@ -201,7 +197,7 @@
} }
#topic-footer-buttons { #topic-footer-buttons {
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
padding-inline: var(--spacing-inline-xs) !important; padding-inline: var(--spacing-inline-xs) !important;
} }
} }
+1 -1
View File
@@ -17,7 +17,7 @@
.combo-box .combo-box-header { .combo-box .combo-box-header {
// needs more specificity 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); border-radius: var(--d-border-radius-large);
border: 1px solid var(--primary-300); border: 1px solid var(--primary-300);
&:hover { &:hover {
-127
View File
@@ -1,127 +0,0 @@
@use "lib/viewport";
#main-outlet {
@if $home_bg_image != "" {
background-image: url($home_bg_image);
background-size: cover;
background-position: center;
background-attachment: fixed;
}
}
.container.list-container{
position: relative;
}
.container.list-container::before{
position: absolute;
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background-color: #fff9;
border-radius: var(--d-border-radius);
backdrop-filter: blur(10px);
box-shadow: #00000077 0 0 19px 0;
}
.topic-list-header{
background-color: unset;
}
.list-controls, .search-container{
border-radius: var(--d-border-radius);
}
.welcome-banner {
padding: 0 !important;
box-shadow: #00000094 0 0 11px 0;
}
#list-area, .topic-list-header, .admin-detail{
background-color: unset !important;
}
.user-content, .details{
border-radius: var(--d-border-radius);
}
.regular.ember-view, .user-main, .reviewable,
.admin-content, .contents.clearfix.body-page,
.search-container, .show-badge, .users-directory, #main-outlet>.edit-category,
#main-outlet>.container.groups-index,
.container.group{
background-color: #ffffffa8 !important;
border-radius: var(--d-border-radius);
backdrop-filter: blur(32px);
box-shadow: #00000077 0 0 19px 0;
padding: 24px;
}
.topic-post.clearfix.regular, .post-list-item.user-stream-item,
.search-header, .admin-plugin-config-page__content,
.user-main .about.collapsed-info .details,
.ember-view.group-box, .admin-container>.container.groups-index{
background: var(--d-chat-input-bg-color);
border-radius: var(--d-border-radius);
box-shadow: #00000024 0 0 7px 2px;
margin: 10px 0;
position: relative;
padding: 16px 12px;
overflow: hidden;
transition: background-color 0.2s ease-in-out;
}
.user-content{
background-color: unset;
}
.powered-by-discourse{
display: none;
}
// 默认光标
@if $default_cursor != "" {
* {
cursor: url($default_cursor) 1 1, auto;
}
}
// 悬停光标
@if $hover_cursor != "" {
a,
button,
[role="button"],
input[type="button"],
input[type="submit"],
.btn,
.clickable {
cursor: url($hover_cursor) 1 1, auto;
}
}
// 链接光标
@if $pointer_cursor != "" {
a[href],
button,
[role="button"],
label,
input[type="button"],
input[type="submit"],
.pointer {
cursor: url($pointer_cursor) 1 1, pointer;
}
}
// 文本光标
@if $text_cursor != "" {
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
cursor: url($text_cursor) 1 1, text;
}
}
+4 -4
View File
@@ -2,7 +2,7 @@
.sidebar-wrapper, .sidebar-wrapper,
.sidebar-hamburger-dropdown { .sidebar-hamburger-dropdown {
@include viewport.until(lg) { @include breakpoint(medium) {
background: var(--secondary); background: var(--secondary);
.sidebar-footer-wrapper { .sidebar-footer-wrapper {
@@ -38,11 +38,11 @@
} }
.sidebar-section-wrapper { .sidebar-section-wrapper {
@include viewport.from(xl) { @include breakpoint(extra-large, $rule: min-width) {
padding-block: 0.45em; padding-block: 0.45em;
} }
@include viewport.until(sm) { @include breakpoint(mobile-extra-large) {
.hamburger-panel .revamped & { .hamburger-panel .revamped & {
margin-bottom: var(--spacing-block-m); margin-bottom: var(--spacing-block-m);
} }
@@ -57,7 +57,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@include viewport.from(xl) { @include breakpoint(extra-large, $rule: min-width) {
gap: var(--spacing-block-xs); gap: var(--spacing-block-xs);
} }
} }
+381 -407
View File
File diff suppressed because it is too large Load Diff
+12 -6
View File
@@ -1,5 +1,3 @@
@use "lib/viewport";
.post-stream { .post-stream {
.contents { .contents {
font-size: var(--font-up-1); font-size: var(--font-up-1);
@@ -8,6 +6,14 @@
} }
} }
.container.posts .topic-navigation:not(.with-topic-progress) {
// super fragile because new sticky topic title doesn't 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?
@@ -15,7 +21,7 @@
border-left: 1px solid var(--accent-color); border-left: 1px solid var(--accent-color);
.timeline-scroller { .timeline-scroller {
@include viewport.from(lg) { @include breakpoint("medium", $rule: min-width) {
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
@@ -30,7 +36,7 @@
.timeline-handle { .timeline-handle {
background-color: var(--accent-color); background-color: var(--accent-color);
@include viewport.from(lg) { @include breakpoint("medium", $rule: min-width) {
width: 8px; width: 8px;
border-radius: 10px; border-radius: 10px;
height: calc(100% - 6px); height: calc(100% - 6px);
@@ -41,7 +47,7 @@
// 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 viewport.until(lg) { @include breakpoint("medium", $rule: max-width) {
.topic-timeline .topic-timeline
.timeline-scrollarea .timeline-scrollarea
.timeline-scroller .timeline-scroller
@@ -54,7 +60,7 @@
.container.posts { .container.posts {
grid-template-columns: auto 8em; grid-template-columns: auto 8em;
@media screen and (width <= 924px) { @media screen and (max-width: 924px) {
grid-template-columns: auto auto; grid-template-columns: auto auto;
} }
+11 -13
View File
@@ -1,5 +1,3 @@
@use "lib/viewport";
.welcome-banner { .welcome-banner {
&__wrap { &__wrap {
display: grid; display: grid;
@@ -11,11 +9,11 @@
padding: 1.5em 0 2.5em; padding: 1.5em 0 2.5em;
margin-bottom: 0; margin-bottom: 0;
@media screen and (width <= 768px) { @media screen and (max-width: 768px) {
padding: 1em; padding: 1em;
} }
@include viewport.until(sm) { @include breakpoint("mobile-extra-large") {
display: block; display: block;
padding: 0.5em; padding: 0.5em;
margin-top: 0; margin-top: 0;
@@ -27,22 +25,22 @@
width: 100%; width: 100%;
align-self: center; align-self: center;
@media screen and (width <= 1028px) { @media screen and (max-width: 1028px) {
grid-row: 2/-1; grid-row: 2/-1;
grid-column: 1/-1; grid-column: 1/-1;
} }
@media screen and (width <= 768px) { @media screen and (max-width: 768px) {
grid-column: 2/-1; grid-column: 2/-1;
grid-row: 1/-1; grid-row: 1/-1;
} }
@media screen and (width <= 600px) { @media screen and (max-width: 600px) {
grid-row: 2/-1; grid-row: 2/-1;
grid-column: 1/-1; grid-column: 1/-1;
} }
@include viewport.until(sm) { @include breakpoint("mobile-extra-large") {
display: none; display: none;
} }
} }
@@ -56,7 +54,7 @@
.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 rgb(52, 6, 121, 15%); box-shadow: 0 4px 10px rgba(52, 6, 121, 15%);
} }
.search-menu .search-input:focus-within, .search-menu .search-input:focus-within,
@@ -88,7 +86,7 @@
font-weight: 400; font-weight: 400;
color: var(--search-color); color: var(--search-color);
@media screen and (width <= 1028px) { @media screen and (max-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;
@@ -96,21 +94,21 @@
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
@media screen and (width <= 768px) { @media screen and (max-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 (width <= 600px) { @media screen and (max-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 viewport.until(sm) { @include breakpoint("mobile-extra-large") {
font-size: var(--font-up-2); font-size: var(--font-up-2);
} }
} }
-26
View File
@@ -9,29 +9,3 @@ 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: "首页背景图"
default_cursor:
type: upload
default: ""
description: "默认光标 SVG 文件"
hover_cursor:
type: upload
default: ""
description: "悬停光标 SVG 文件"
pointer_cursor:
type: upload
default: ""
description: "链接光标 SVG 文件"
text_cursor:
type: upload
default: ""
description: "文本光标 SVG 文件"
+3 -2
View File
@@ -36,8 +36,9 @@ 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-creator-data", "topic-likes-replies-data",
"topic-activity-data", "topic-activity-data",
], ],
) )
@@ -48,7 +49,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 = theme.color_schemes.find_by(name: "Marigold") marigold_palette = ColorScheme.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,9 +26,7 @@ module PageObjects
end end
def has_selected_palette?(palette) def has_selected_palette?(palette)
has_css?( has_css?(".user-color-palette-selector[data-selected-color-palette-id='#{palette.id}']")
".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)
horizon_theme.color_schemes.update_all(user_selectable: true) ColorScheme.where(theme_id: horizon_theme.id).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) { theme.color_schemes.find_by(name: "Marigold") } let(:marigold_palette) { ColorScheme.find_by(name: "Marigold") }
let(:marigold_palette_dark) { theme.color_schemes.find_by(name: "Marigold Dark") } let(:marigold_palette_dark) { ColorScheme.find_by(name: "Marigold Dark") }
before { SiteSetting.interface_color_selector = "sidebar_footer" } before { SiteSetting.interface_color_selector = "sidebar_footer" }