Compare commits

..

1 Commits

Author SHA1 Message Date
David Taylor ab76fd345d DEV: CSS-only mask 2025-03-07 17:56:55 +00:00
55 changed files with 826 additions and 2948 deletions
+4 -2
View File
@@ -1,3 +1,5 @@
Horizon is a simple, beautiful theme that improves the out-of-the-box experience for Discourse sites.
# next-gen
https://meta.discourse.org/t/horizon-theme/360486
**Theme Summary**
For more information, please see: **url to meta topic**
+29 -120
View File
@@ -1,134 +1,43 @@
{
"name": "Horizon",
"name": "Horizon Theme",
"authors": "Design Team",
"about_url": "https://meta.discourse.org/t/horizon-theme/360486",
"license_url": "https://github.com/discourse/horizon/blob/main/LICENSE",
"learn_more": "https://meta.discourse.org/t/installing-a-theme-or-theme-component/63682",
"about_url": "TODO: Put your theme's public repo or Meta topic URL here",
"license_url": "TODO: Put your theme's LICENSE URL here",
"learn_more": "TODO",
"theme_version": "0.0.1",
"minimum_discourse_version": null,
"maximum_discourse_version": null,
"assets": {},
"modifiers": {
"svg_icons": ["fire"],
"serialize_topic_is_hot": true
"svg_icons": ["fire"]
},
"components": [
"https://github.com/discourse/discourse-sidebar-new-topic-button.git",
"https://github.com/discourse/discourse-search-banner.git",
"https://github.com/discourse/discourse-full-width-component.git"
],
"color_schemes": {
"Horizon": {
"primary": "1A1A1A",
"primary-low": "ebecf9",
"primary-500": "8591ad",
"secondary": "ffffff",
"tertiary": "595bca",
"tertiary-med-or-tertiary": "595bca",
"selected": "d7dfff",
"header_background": "ffffff",
"header_primary": "1A1A1A",
"hover": "E1E8FF"
"header_background": "f5f8ff",
"tertiary": "313270",
"tertiary-low": "d8d9f3",
"tertiary-50": "f5f8ff",
"selected": "d8d9f3",
"hover": "ebebf9"
},
"Horizon Dark": {
"primary": "ffffff",
"secondary": "1A1A1A",
"tertiary": "595bca",
"tertiary-med-or-tertiary": "595bca",
"selected": "3b3e56",
"header_background": "1A1A1A",
"header_primary": "ffffff",
"hover": "333548"
},
"Royal": {
"primary": "1A1A1A",
"secondary": "ffffff",
"tertiary": "1F7BC1",
"tertiary-med-or-tertiary": "1F7BC1",
"selected": "c7e3ff",
"header_background": "ffffff",
"header_primary": "1A1A1A",
"hover": "D6EBFF"
},
"Royal Dark": {
"primary": "ffffff",
"secondary": "1A1A1A",
"tertiary": "1F7BC1",
"tertiary-med-or-tertiary": "1F7BC1",
"selected": "3a455f",
"header_background": "1A1A1A",
"header_primary": "ffffff",
"hover": "323B4E"
},
"Clover": {
"primary": "1A1A1A",
"secondary": "ffffff",
"tertiary": "39845B",
"tertiary-med-or-tertiary": "39845B",
"selected": "c6f1d5",
"header_background": "ffffff",
"header_primary": "1A1A1A",
"hover": "D5F5E0"
},
"Clover Dark": {
"primary": "ffffff",
"secondary": "1A1A1A",
"tertiary": "39845B",
"tertiary-med-or-tertiary": "39845B",
"selected": "47594e",
"header_background": "1A1A1A",
"header_primary": "ffffff",
"hover": "3C4A40"
},
"Lily": {
"primary": "1A1A1A",
"secondary": "ffffff",
"tertiary": "cc338c",
"tertiary-med-or-tertiary": "cc338c",
"selected": "ffc8ee",
"header_background": "ffffff",
"header_primary": "1A1A1A",
"hover": "FFD7F3"
},
"Lily Dark": {
"primary": "ffffff",
"secondary": "1A1A1A",
"tertiary": "cc338c",
"tertiary-med-or-tertiary": "cc338c",
"selected": "5f3e4e",
"header_background": "1A1A1A",
"header_primary": "ffffff",
"hover": "4E3640"
},
"Violet": {
"primary": "1A1A1A",
"secondary": "ffffff",
"tertiary": "9b15de",
"tertiary-med-or-tertiary": "9b15de",
"selected": "feccff",
"header_background": "ffffff",
"header_primary": "1A1A1A",
"hover": "FFD9FF"
},
"Violet Dark": {
"primary": "ffffff",
"secondary": "1A1A1A",
"tertiary": "9b15de",
"tertiary-med-or-tertiary": "9b15de",
"selected": "4c385c",
"header_background": "1A1A1A",
"header_primary": "ffffff",
"hover": "40314C"
},
"Marigold": {
"primary": "1A1A1A",
"secondary": "ffffff",
"tertiary": "d3881f",
"tertiary-med-or-tertiary": "d3881f",
"selected": "ffdcb2",
"header_background": "ffffff",
"header_primary": "1A1A1A",
"hover": "FFE6C6"
},
"Marigold Dark": {
"primary": "ffffff",
"secondary": "1A1A1A",
"tertiary": "d3881f",
"tertiary-med-or-tertiary": "d3881f",
"selected": "6c5b49",
"header_background": "1A1A1A",
"header_primary": "ffffff",
"hover": "584B3E"
"primary": "F1EFF9",
"secondary": "1e1a36",
"header_background": "00091d",
"header_primary": "F5F8FF",
"tertiary": "6465ab",
"tertiary-50": "131124",
"selected": "1e1a36",
"hover": "131124"
}
}
}
-107
View File
@@ -1,107 +0,0 @@
html {
--accent-color: #{$tertiary} !important;
--accent-text-color: #ffffff;
// Background Colors
--background-color: light-dark(
oklch(from #{$tertiary} 96% calc(c * 0.125) h),
oklch(from #{$tertiary} 10% 0.025 h)
) !important;
--d-content-background: light-dark(
oklch(from #{$secondary} calc(2 * l) c h),
oklch(from #{$secondary} l c h)
) !important;
// HeaderColors
--header_primary-low-mid: light-dark(
oklch(from #{$tertiary} 73.5% calc(c * 0.5) h),
oklch(from #{$tertiary} l calc(c * 0.25) h)
) !important;
--header_primary-medium: light-dark(
oklch(from #{$tertiary} 54% calc(c * 0.5) h),
oklch(from #{$tertiary} calc(l * 1.35) calc(c * 0.25) h)
) !important;
// Sidebar Colors
--d-sidebar-border-color: light-dark(
oklch(from #{$tertiary} 88% calc(c * 0.25) h),
oklch(from #{$tertiary} calc(l * 0.7) calc(c * 0.25) h)
) !important;
--d-sidebar-link-color: light-dark(
oklch(from #{$tertiary} calc(l * 0.8) calc(c * 0.25) h),
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 0.25) h)
) !important;
--d-sidebar-active-color: #{$primary} !important;
--d-sidebar-suffix-color: light-dark(
oklch(from #{$tertiary} l calc(c * 0.9) h),
oklch(from #{$tertiary} l calc(c * 0.9) h)
) !important;
// Other Colors
--d-selected: light-dark(
oklch(from #{$tertiary} 92% calc(c * 0.5) h),
oklch(from #{$tertiary} calc(l * 0.7) calc(c * 0.25) h)
) !important;
--d-nav-color--active: light-dark(
oklch(from #{$tertiary} l c h),
oklch(from #{$tertiary} calc(l * 1.2) c h)
) !important;
--d-nav-color--hover: light-dark(
oklch(from #{$tertiary} l c h),
oklch(from #{$tertiary} calc(l * 1.2) c h)
) !important;
--link-color: light-dark(
oklch(from #{$tertiary} l c h),
oklch(from #{$tertiary} calc(l * 0.95) c h)
) !important;
--link-color-hover: light-dark(
oklch(from #{$tertiary} l c h),
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 2.25) h)
) !important;
--tertiary-hover: #{$tertiary} !important;
// Search Colors
--search-color: light-dark(
oklch(from #{$tertiary} l c h),
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 0.25) h)
) !important;
// Topic Card Colors
--topic-card-shadow: light-dark(
oklch(from #{$tertiary} calc(l * 1.85) calc(c * 0.5) h),
oklch(from #{$tertiary} calc(l * 0.2) calc(c * 0.01) h / 0.25)
) !important;
// Button Colors
--button-box-shadow: light-dark(
oklch(from #{$tertiary} calc(l * 1.5) calc(c * 0.35) h),
oklch(from #{$tertiary} calc(l * 0.75) calc(c * 0.5) h)
) !important;
--d-sidebar-highlight-hover-icon: var(--d-sidebar-link-color) !important;
--d-sidebar-highlight-hover-background: var(--d-selected) !important;
--d-sidebar-link-icon-color: var(--d-sidebar-link-color) !important;
--d-sidebar-header-color: var(--d-sidebar-link-color) !important;
--d-sidebar-header-icon-color: var(--d-sidebar-link-color) !important;
--d-sidebar-active-suffix-color: var(--d-sidebar-suffix-color) !important;
--d-sidebar-background: var(--background-color) !important;
--d-sidebar-footer-fade: var(--background-color) !important;
--d-sidebar-prefix-background: var(--d-selected) !important;
--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.7) c h)
) !important;
--d-sidebar-highlight-prefix-background: light-dark(
oklch(from var(--d-selected) calc(l * 0.85) c h),
oklch(from var(--d-selected) calc(l * 0.7) c h)
) !important;
--d-sidebar-highlight-suffix-color: var(
--d-sidebar-active-suffix-color
) !important;
--d-sidebar-highlight-color: var(--primary) !important;
--d-sidebar-highlight-background: var(--d-selected) !important;
--d-sidebar-section-link-icon-size: 1em !important;
--d-hover: oklch(from var(--d-selected) l c h / 0.75) !important;
--d-input-bg-color: var(--d-content-background) !important;
}
+5 -10
View File
@@ -1,19 +1,14 @@
@import "box-view";
@import "buttons";
@import "chat";
@import "color-choice";
@import "composer";
@import "composer-peek-mode";
@import "header";
@import "hiddenstuff";
@import "login";
@import "main";
@import "misc";
@import "mobile-stuff";
@import "nav-pills";
@import "welcome-banner";
@import "search-banner";
@import "sidebar";
@import "sidebar-new-topic-button";
@import "topic";
@import "topic-cards";
@import "variables";
@import "box-view";
@import "chat";
@import "misc";
@import "mobile-stuff";
-6
View File
@@ -1,6 +0,0 @@
<script>
if(!CSS.supports("(color: hsl(from white h s l))")){
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>.';
}
</script>
-2
View File
@@ -1,2 +0,0 @@
@import "desktop-horizon-fixes";
@import "desktop-full-width";
@@ -1,6 +0,0 @@
import { apiInitializer } from "discourse/lib/api";
import ComposerPeekModeToggle from "../components/composer-peek-mode-toggle";
export default apiInitializer("1.8.0", (api) => {
api.renderInOutlet("before-composer-toggles", ComposerPeekModeToggle);
});
@@ -1,16 +0,0 @@
import { apiInitializer } from "discourse/lib/api";
export default apiInitializer("0.8", (api) => {
document.body.classList.add("full-width-enabled");
// When the sidebar is visible, force the HomeLogo to be in an 'un-minimized' state.
api.registerValueTransformer?.(
"home-logo-minimized",
({ value, context }) => {
if (value && context.showSidebar) {
return false;
}
return value;
}
);
});
@@ -1,16 +0,0 @@
import { apiInitializer } from "discourse/lib/api";
import ExperimentalScreen from "../components/experimental-screen";
import UserColorPaletteSelector from "../components/user-color-palette-selector";
export default apiInitializer("1.8.0", (api) => {
api.renderInOutlet("above-main-container", ExperimentalScreen);
api.renderInOutlet("sidebar-footer-actions", UserColorPaletteSelector);
api.registerValueTransformer("site-setting-enable-welcome-banner", () => {
return settings.enable_welcome_banner;
});
api.registerValueTransformer("site-setting-search-experience", () => {
return settings.search_experience;
});
});
@@ -0,0 +1,6 @@
import { apiInitializer } from "discourse/lib/api";
import ExperimentalScreen from "../components/experimental-screen";
export default apiInitializer("1.8.0", (api) => {
api.renderInOutlet("above-main-container", ExperimentalScreen);
});
@@ -1,7 +0,0 @@
import { apiInitializer } from "discourse/lib/api";
export default apiInitializer("0.8.0", (api) => {
api.registerValueTransformer("bulk-select-in-nav-controls", () => {
return true;
});
});
@@ -1,6 +0,0 @@
import { apiInitializer } from "discourse/lib/api";
import SidebarNewTopicButton from "../components/sidebar-new-topic-button";
export default apiInitializer("1.8.0", (api) => {
api.renderInOutlet("before-sidebar-sections", SidebarNewTopicButton);
});
@@ -1,64 +0,0 @@
import Component from "@glimmer/component";
import avatar from "discourse/helpers/avatar";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse/helpers/d-icon";
import formatDate from "discourse/helpers/format-date";
import { i18n } from "discourse-i18n";
export default class TopicActivityColumn extends Component {
get topicUser() {
if (
moment(this.args.topic.bumped_at).isAfter(this.args.topic.last_posted_at)
) {
return {
user: undefined,
username: undefined,
activityText: "user_updated",
class: "--updated",
};
}
if (this.args.topic.posts_count > 1) {
return {
user: this.args.topic.lastPosterUser,
username: this.args.topic.last_poster_username,
activityText: "user_replied",
class: "--replied",
};
} else if (this.args.topic.posts_count === 1) {
return {
user: this.args.topic.creator,
username: this.args.topic.creator.username,
activityText: "user_posted",
class: "--posted",
};
}
}
<template>
<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}}
<span
class="topic-activity__username"
>{{this.topicUser.username}}</span>
{{/if}}
<div class="topic-activity__reason">
{{i18n (themePrefix this.topicUser.activityText)}}
</div>
<div class="topic-activity__time">
{{formatDate
@topic.bumpedAt
leaveAgo="true"
format="medium-with-ago-and-on"
}}
</div>
</span>
</template>
}
@@ -0,0 +1,9 @@
import avatar from "discourse/helpers/avatar";
const TopicAuthorAvatarColumn = <template>
<span class="topic-author-avatar">
{{avatar @topic.creator imageSize="large"}}
</span>
</template>;
export default TopicAuthorAvatarColumn;
@@ -0,0 +1,5 @@
const TopicAuthorColumn = <template>
<span class="topic-author">@{{@topic.creator.username}}</span>
</template>;
export default TopicAuthorColumn;
@@ -1,8 +1,7 @@
import icon from "discourse/helpers/d-icon";
import gt from "truth-helpers/helpers/gt";
const TopicRepliesColumn = <template>
{{#if (gt @topic.replyCount 1)}}
{{#if @topic.posts_count}}
<span class="topic-replies">{{icon "reply"}}{{@topic.posts_count}}</span>
{{/if}}
</template>;
@@ -1,36 +1,115 @@
import Component from "@glimmer/component";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { service } from "@ember/service";
import { and } from "truth-helpers";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class TopicStatusColumn extends Component {
@service currentUser;
@service siteSettings;
get badge() {
if (this.args.topic.is_hot) {
return {
icon: "fire",
text: "topic_hot",
className: "--hot",
};
}
get canAct() {
return this.currentUser && !this.args.disableActions;
}
if (this.args.topic.pinned) {
return {
icon: "thumbtack",
text: "topic_pinned",
className: "--pinned",
};
get statusClass() {
let classes = ["topic-status-card"];
if (this.args.topic.bookmarked) {
classes.push("--bookmark");
} else if (this.args.topic.closed && this.args.topic.archived) {
classes.push("--locked --archived");
} else if (this.args.topic.closed) {
classes.push("--locked");
} else if (this.args.topic.archived) {
classes.push("--archived");
} else if (this.args.topic.is_warning) {
classes.push("--warning");
} else if (
this.args.showPrivateMessageIcon &&
this.args.topic.isPrivateMessage
) {
classes.push("--private-message");
} else if (this.args.topic.pinned) {
classes.push("--pinned");
} else if (this.args.topic.unpinned) {
classes.push("--unpinned");
}
return classes.join(" ");
}
return null;
get heatMap() {
return this.args.topic.views > this.siteSettings.topic_views_heat_medium;
}
@action
togglePinned(event) {
event.preventDefault();
this.args.topic.togglePinnedForUser();
}
<template>
{{#if this.badge}}
<span class="topic-status-card {{this.badge.className}}">{{icon
this.badge.icon
}}{{i18n (themePrefix this.badge.text)}}</span>
{{#if @topic.bookmarked}}
<span class={{this.statusClass}}>{{icon "bookmark"}}{{i18n
(themePrefix "topic_bookmarked")
}}</span>
{{/if}}
{{#if (and @topic.closed @topic.archived)~}}
<span class={{this.statusClass}}>{{i18n
(themePrefix "topic_closed_and_archived")
}}</span>
{{else if @topic.closed}}
<span class={{this.statusClass}}>{{i18n
(themePrefix "topic_closed")
}}</span>
{{else if @topic.archived}}
<span class={{this.statusClass}}>{{i18n
(themePrefix "topic_archived")
}}</span>
{{/if}}
{{#if @topic.is_warning}}
<span class={{this.statusClass}}>{{i18n
(themePrefix "topic_warning")
}}</span>
{{else if (and @showPrivateMessageIcon @topic.isPrivateMessage)}}
<span class={{this.statusClass}}>{{i18n
(themePrefix "topic_personal_message")
}}</span>
{{/if}}
{{#if @topic.pinned}}
{{#if this.canAct}}
<button
type="button"
{{on "click" this.togglePinned}}
class={{this.statusClass}}
>{{icon "thumbtack"}}{{i18n (themePrefix "topic_pinned")}}</button>
{{else}}
<span class={{this.statusClass}}>{{icon "thumbtack"}}{{i18n
(themePrefix "topic_pinned")
}}</span>
{{/if}}
{{else if @topic.unpinned}}
{{#if this.canAct}}
<button
type="button"
{{on "click" this.togglePinned}}
class={{this.statusClass}}
>{{icon "thumbtack" class="unpinned"}}{{i18n
(themePrefix "topic_unpinned")
}}</button>
{{else}}
<span class={{this.statusClass}}>{{icon
"thumbtack"
class="unpinned"
}}{{i18n (themePrefix "topic_unpinned")}}</span>
{{/if}}
{{/if}}
{{#if this.heatMap}}
<span class="topic-status-card --hot">{{icon "fire"}}{{i18n
(themePrefix "topic_hot")
}}</span>
{{/if}}
</template>
}
@@ -1,37 +0,0 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import bodyClass from "discourse/helpers/body-class";
export default class ComposerPeekModeToggle extends Component {
@service composer;
@service keyValueStore;
@tracked
peekModeActive = this.keyValueStore.getItem("peekModeActive") === "true";
get bodyCssClass() {
return this.peekModeActive ? "peek-mode-active" : "";
}
@action
togglePeekMode() {
this.peekModeActive = !this.peekModeActive;
this.keyValueStore.setItem("peekModeActive", this.peekModeActive);
if (this.composer.showPreview) {
this.composer.togglePreview();
}
}
<template>
{{bodyClass this.bodyCssClass}}
<DButton
@action={{this.togglePeekMode}}
@preventFocus={{true}}
@icon="discourse-sidebar"
class="btn-mini-toggle no-text peek-mode-toggle btn-transparent"
/>
</template>
}
@@ -1,67 +1,11 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import { bind } from "discourse/lib/decorators";
const ExperimentalScreen = <template>
<ul class="experimental-screen">
<li class="experimental-screen__top-left"></li>
<li class="experimental-screen__top-right"></li>
<li class="experimental-screen__bottom-left"></li>
<li class="experimental-screen__bottom-right"></li>
<li class="experimental-screen__bottom-bar"></li>
</ul>
</template>;
const DO_NOT_RENDER_LIST = ["login"];
export default class ExperimentalScreen extends Component {
@service router;
@tracked left = 0;
@tracked right = 0;
resizeObserver;
willDestroy() {
super.willDestroy(...arguments);
this.resizeObserver.disconnect();
}
@bind
calculateDistance(element) {
const distance = element.getBoundingClientRect();
this.left = distance.left;
this.right = distance.right;
}
get distanceStyles() {
return htmlSafe(
`--left-distance: ${this.left}px; --right-distance: ${this.right}px;`
);
}
get shouldRender() {
return !DO_NOT_RENDER_LIST.includes(this.router.currentRouteName);
}
@action
onInsert(element) {
this.calculateDistance(element);
this.resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
this.calculateDistance(entry.target);
}
});
this.resizeObserver.observe(element);
}
<template>
{{#if this.shouldRender}}
<ul
class="experimental-screen"
{{didInsert this.onInsert}}
style={{this.distanceStyles}}
>
<li class="experimental-screen__top-left"></li>
<li class="experimental-screen__top-right"></li>
<li class="experimental-screen__bottom-left"></li>
<li class="experimental-screen__bottom-right"></li>
<li class="experimental-screen__bottom-bar"></li>
</ul>
{{/if}}
</template>
}
export default ExperimentalScreen;
@@ -1,96 +0,0 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import didUpdate from "@ember/render-modifiers/modifiers/did-update";
import { service } from "@ember/service";
import { gt } from "truth-helpers";
import CreateTopicButton from "discourse/components/create-topic-button";
import not from "truth-helpers/helpers/not";
export default class SidebarNewTopicButton extends Component {
@service composer;
@service currentUser;
@service siteSettings;
@service router;
@tracked category;
@tracked tag;
get shouldRender() {
return this.currentUser && !this.router.currentRouteName.includes("admin");
}
get canCreateTopic() {
return this.currentUser?.can_create_topic;
}
get draftCount() {
return this.currentUser?.get("draft_count");
}
get createTopicTargetCategory() {
if (this.category?.canCreateTopic) {
return this.category;
}
if (this.siteSettings.default_subcategory_on_read_only_category) {
return this.category?.subcategoryWithCreateTopicPermission;
}
}
get tagRestricted() {
return this.tag?.staff;
}
get createTopicDisabled() {
return (
(this.category && !this.createTopicTargetCategory) ||
(this.tagRestricted && !this.currentUser.staff)
);
}
get categoryReadOnlyBanner() {
if (this.category && this.currentUser && this.createTopicDisabled) {
return this.category.read_only_banner;
}
}
get createTopicClass() {
const baseClasses = "btn-default sidebar-new-topic-button";
return this.categoryReadOnlyBanner
? `${baseClasses} disabled`
: baseClasses;
}
@action
createNewTopic() {
this.composer.openNewTopic({ category: this.category, tags: this.tag?.id });
}
@action
getCategoryandTag() {
this.category = this.router.currentRoute.attributes?.category || null;
this.tag = this.router.currentRoute.attributes?.tag || null;
}
<template>
{{#if this.shouldRender}}
<div
class="sidebar-new-topic-button__wrapper"
{{didInsert this.getCategoryandTag}}
{{didUpdate this.getCategoryandTag this.router.currentRoute}}
>
<CreateTopicButton
@canCreateTopic={{this.canCreateTopic}}
@action={{this.createNewTopic}}
@disabled={{this.createTopicDisabled}}
@label="topic.create"
@btnClass={{this.createTopicClass}}
@canCreateTopicOnTag={{not this.tagRestricted}}
@showDrafts={{gt this.draftCount 0}}
/>
</div>
{{/if}}
</template>
}
@@ -1,44 +0,0 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
export default class UserColorPaletteMenuItem extends Component {
@service site;
@service session;
get siteStyle() {
return `--icon-color: ${this.args.colorPalette.accent}`;
}
get activeClass() {
if (this.args.selectedColorPaletteId === this.args.colorPalette.id) {
return "active";
}
}
@action
paletteSelected() {
this.args.paletteSelected(this.args.colorPalette);
}
<template>
<div
class="user-color-palette-menu__item"
data-color-palette={{@colorPalette.name}}
>
<DButton
class={{concatClass
"btn-flat user-color-palette-menu__item-choice"
this.activeClass
}}
style={{htmlSafe this.siteStyle}}
@icon="circle"
@translatedLabel={{@colorPalette.name}}
@action={{this.paletteSelected}}
/>
</div>
</template>
}
@@ -1,209 +0,0 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { service } from "@ember/service";
import { isEmpty } from "@ember/utils";
import { Promise } from "rsvp";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse/helpers/d-icon";
import { reload } from "discourse/helpers/page-reloader";
import { ajax } from "discourse/lib/ajax";
import {
listColorSchemes,
updateColorSchemeCookie,
} from "discourse/lib/color-scheme-picker";
import cookie from "discourse/lib/cookie";
import DMenu from "float-kit/components/d-menu";
import UserColorPaletteMenuItem from "./user-color-palette-menu-item";
const HORIZON_PALETTES = [
"Horizon",
"Marigold",
"Violet",
"Lily",
"Clover",
"Royal",
];
export default class UserColorPaletteSelector extends Component {
@service currentUser;
@service keyValueStore;
@service site;
@service session;
@service interfaceColor;
@tracked anonColorPaletteId = this.#loadAnonColorPalette();
@tracked userColorPaletteId = this.session.userColorSchemeId;
@tracked cssLoaded = true;
get userColorPalettes() {
const availablePalettes = listColorSchemes(this.site)
.map((userPalette) => {
return {
...userPalette,
accent: `#${
userPalette.colors.find((color) => color.name === "tertiary").hex
}`,
};
})
.filter((userPalette) => {
return HORIZON_PALETTES.some((palette) => {
return userPalette.name.toLowerCase().includes(palette.toLowerCase());
});
})
.sort();
// Match the light scheme with the corresponding dark id based in the name
return (
availablePalettes
.map((palette) => {
if (palette.is_dark) {
return palette;
}
const normalizedLightName = palette.name.toLowerCase();
const correspondingDarkModeId = availablePalettes.find(
(item) =>
item.is_dark &&
normalizedLightName ===
item.name.toLowerCase().replace(/\s+dark$/, "")
)?.id;
return {
...palette,
correspondingDarkModeId,
};
})
// Only want to show palettes that have corresponding light/dark modes
.filter((palette) => !palette.is_dark)
);
}
get selectedColorPaletteId() {
if (this.currentUser) {
return this.userColorPaletteId;
}
return this.anonColorPaletteId;
}
@action
onRegisterMenu(api) {
this.dMenu = api;
}
@action
paletteSelected(selectedPalette) {
if (selectedPalette.id === this.selectedColorPaletteId) {
return;
}
this.#updatePreference(selectedPalette);
this.#changeSiteColorPalette(selectedPalette);
this.dMenu.close();
}
#updatePreference(selectedPalette) {
updateColorSchemeCookie(selectedPalette.id);
updateColorSchemeCookie(selectedPalette.correspondingDarkModeId, {
dark: true,
});
if (!this.currentUser) {
this.anonColorPaletteId = selectedPalette.id;
} else {
this.userColorPaletteId = selectedPalette.id;
}
}
#loadAnonColorPalette() {
const storedAnonPaletteId = cookie("color_scheme_id");
if (storedAnonPaletteId) {
return parseInt(storedAnonPaletteId, 10);
}
}
async #changeSiteColorPalette(colorPalette) {
this.cssLoaded = false;
const lightPaletteId = colorPalette.id;
const darkPaletteId = colorPalette.correspondingDarkModeId;
const darkTag = document.querySelector("link.dark-scheme");
// TODO(osama) once we have built-in light/dark modes for each palette, we
// can stop making the 2nd ajax call for the dark palette and replace it
// with a include_dark_scheme param on the ajax call for the light
// palette which will include the href for the dark palette in the response
if (!darkTag) {
reload();
return;
}
const lightPaletteInfo = await ajax(
`/color-scheme-stylesheet/${lightPaletteId}/${colorPalette.theme_id}.json`
);
const darkPaletteInfo = await ajax(
`/color-scheme-stylesheet/${darkPaletteId}/${colorPalette.theme_id}.json`
);
Promise.all([
this.#preloadAndSwapCSS(lightPaletteInfo.new_href, "light-scheme"),
this.#preloadAndSwapCSS(darkPaletteInfo.new_href, "dark-scheme"),
]).then(() => {
this.cssLoaded = true;
});
}
#preloadAndSwapCSS(newHref, existingLinkClass) {
return new Promise((resolve) => {
const existingLink = document.querySelector(
`link[rel='stylesheet'].${existingLinkClass}`
);
const newTag = document.createElement("link");
newTag.rel = "preload";
newTag.href = newHref;
newTag.as = "style";
newTag.onload = () => {
existingLink.href = newHref;
newTag.remove();
resolve();
};
document.head.appendChild(newTag);
});
}
<template>
{{#unless (isEmpty this.userColorPalettes)}}
<DMenu
@identifier="user-color-palette-selector"
@placementStrategy="fixed"
@onRegisterApi={{this.onRegisterMenu}}
class={{concatClass
"btn-flat user-color-palette-selector sidebar-footer-actions-button"
(if this.cssLoaded "user-color-palette-css-loaded")
}}
data-selected-color-palette-id={{this.selectedColorPaletteId}}
@inline={{true}}
>
<:trigger>
{{icon "paintbrush"}}
</:trigger>
<:content>
<div class="user-color-palette-menu">
<div class="user-color-palette-menu__content">
{{#each this.userColorPalettes as |colorPalette|}}
<UserColorPaletteMenuItem
@selectedColorPaletteId={{this.selectedColorPaletteId}}
@colorPalette={{colorPalette}}
@paletteSelected={{this.paletteSelected}}
/>
{{/each}}
</div>
</div>
</:content>
</DMenu>
{{/unless}}
</template>
}
@@ -1,25 +1,27 @@
import { withPluginApi } from "discourse/lib/plugin-api";
import TopicActivityColumn from "../components/card/topic-activity-column";
import TopicAuthorAvatarColumn from "../components/card/topic-author-avatar-column";
import TopicAuthorColumn from "../components/card/topic-author-column";
import TopicCategoryColumn from "../components/card/topic-category-column";
import TopicLikesColumn from "../components/card/topic-likes-column";
import TopicRepliesColumn from "../components/card/topic-replies-column";
import TopicStatusColumn from "../components/card/topic-status-column";
const TopicActivity = <template>
<td class="topic-activity-data">
<TopicActivityColumn @topic={{@topic}} />
const TopicAuthor = <template>
<td class="topic-author-data">
<TopicAuthorColumn @topic={{@topic}} />
</td>
</template>;
const TopicStatus = <template>
<td class="topic-status-data">
<TopicStatusColumn @topic={{@topic}} />
const TopicAuthorAvatar = <template>
<td class="topic-author-avatar-data">
<TopicAuthorAvatarColumn @topic={{@topic}} />
</td>
</template>;
const TopicCategory = <template>
<td class="topic-category-data">
const TopicCategoryStatus = <template>
<td class="topic-category-status-data">
<TopicCategoryColumn @topic={{@topic}} />
<TopicStatusColumn @topic={{@topic}} />
</td>
</template>;
@@ -33,35 +35,30 @@ const TopicLikesReplies = <template>
export default {
name: "topic-list-customizations",
initialize(container) {
const router = container.lookup("service:router");
initialize() {
withPluginApi("1.39.0", (api) => {
api.registerValueTransformer(
"topic-list-columns",
({ value: columns }) => {
columns.add("topic-status", {
item: TopicStatus,
columns.add("topic-author", {
item: TopicAuthor,
after: "activity",
});
columns.add("topic-category-status", {
item: TopicCategoryStatus,
after: "topic-author",
});
columns.add("topic-category", {
item: TopicCategory,
after: "topic-status",
columns.add("topic-author-avatar", {
item: TopicAuthorAvatar,
after: "topic-category-status",
});
columns.add("topic-likes-replies", {
item: TopicLikesReplies,
after: "topic-author-avatar",
});
columns.delete("posters");
columns.delete("views");
columns.delete("replies");
if (!router.currentRouteName.includes("userPrivateMessages")) {
columns.add("topic-activity", {
item: TopicActivity,
after: "title",
});
columns.delete("posters");
columns.delete("activity");
}
return columns;
}
);
@@ -69,12 +66,8 @@ export default {
api.registerValueTransformer(
"topic-list-item-class",
({ value: classes, context }) => {
if (
context.topic.is_hot ||
context.topic.pinned ||
context.topic.pinned_globally
) {
classes.push("--has-status-card");
if (context.topic.pinned || context.topic.pinned_globally) {
classes.push("--pinned");
}
return classes;
}
+8 -5
View File
@@ -1,9 +1,12 @@
en:
theme_metadata:
description: "A simple, beautiful theme that improves the out of the box experience for Discourse sites."
description: "A simple, beautiful theme for the future of Discourse that improves the out of the box experience for sites."
topic_bookmarked: "Bookmarked"
topic_closed_archived: "Closed and archived"
topic_closed: "Closed"
topic_archived: "Archived"
topic_warning: "Warning"
topic_personal_message: "Personal message"
topic_pinned: "Pinned"
topic_unpinned: "Unpinned"
topic_hot: "Hot"
user_replied: "replied"
user_posted: "posted"
user_updated: "updated"
+3
View File
@@ -0,0 +1,3 @@
#main-outlet-wrapper {
padding: 0;
}
+13 -32
View File
@@ -17,18 +17,8 @@
}
}
.has-full-page-chat .chat-replying-indicator-container {
margin-bottom: var(--main-grid-gap);
@include breakpoint(medium) {
margin-bottom: 0;
}
}
.has-full-page-chat .chat-selection-management {
margin-bottom: var(--main-grid-gap);
@include breakpoint(medium) {
margin-bottom: 0;
}
.has-full-page-chat .experimental-screen {
display: none;
}
.experimental-screen {
@@ -36,18 +26,18 @@
display: none;
}
max-width: unset !important;
.has-full-page-chat & {
display: none;
}
@media screen and (max-width: 488px) {
display: none;
}
width: 100%;
display: block;
margin: 0;
padding: 0;
position: relative;
container: content-width / inline-size;
@media screen and (max-width: 488px) {
display: none;
}
@include breakpoint(tablet) {
display: none;
}
li {
list-style: none;
margin: 0;
@@ -62,12 +52,6 @@
height: var(--d-border-radius-large);
background-color: var(--background-color);
z-index: 399;
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)
);
-webkit-mask: radial-gradient(
circle at var(--d-border-radius-large) var(--d-border-radius-large),
transparent var(--d-border-radius-large),
@@ -77,25 +61,23 @@
}
&__top-left {
top: var(--header-offset);
left: var(--left-distance);
}
&__top-right {
top: var(--header-offset);
transform: rotate(90deg);
left: calc(var(--right-distance) - var(--d-border-radius-large));
right: var(--d-border-radius-large);
}
&__bottom-left {
transform: rotate(-90deg);
bottom: var(--main-grid-gap);
left: var(--left-distance);
bottom: var(--d-border-radius-large);
@media screen and (max-width: 768px) {
bottom: calc(var(--d-border-radius-large) * 2);
}
}
&__bottom-right {
transform: rotate(180deg);
bottom: var(--main-grid-gap);
left: calc(var(--right-distance) - var(--d-border-radius-large));
bottom: var(--d-border-radius-large);
right: var(--d-border-radius-large);
@media screen and (max-width: 768px) {
bottom: calc(var(--d-border-radius-large) * 2);
}
@@ -106,8 +88,7 @@
z-index: 399;
background-color: var(--background-color);
bottom: 0;
left: var(--left-distance);
height: var(--main-grid-gap);
height: var(--d-border-radius-large);
@media screen and (max-width: 768px) {
height: calc(var(--d-border-radius-large) * 2);
}
+105 -48
View File
@@ -6,57 +6,95 @@
transition: none;
}
.btn-default,
.btn-primary,
.btn-danger,
.select-kit .select-kit-header {
padding: var(--spacing-block-s) var(--spacing-inline-m);
// font-size: var(--font-up-1-rem);
// border-radius: var(--d-button-border-radius);
&.no-text {
padding-inline: 0.665rem;
}
}
.sidebar-new-topic-button__wrapper .topic-drafts-menu-trigger.btn.no-text {
background: var(--accent-color);
&:hover,
&:focus-visible {
background: oklch(from var(--accent-color) 40% c h) !important;
box-shadow: none;
&:hover {
background: radial-gradient(
90% 110% at 50% 50%,
rgba(255, 255, 255, 0.3) 0%,
rgba(255, 255, 255, 0) 100%
),
var(--accent-color);
}
.d-icon {
svg {
color: var(--accent-text-color);
}
}
.discourse-no-touch .dropdown-menu__item .btn {
background: transparent;
.discourse-no-touch .btn-default.sidebar-new-topic-button,
.discourse-no-touch .interface-color-selector-content .btn-default {
border: none;
&:hover {
border: none;
box-shadow: none;
}
}
.discourse-no-touch .btn-default.sidebar-new-topic-button,
.discourse-no-touch .btn-default,
.discourse-no-touch .select-kit .select-kit-header.btn-default {
background: var(--primary-100);
.discourse-no-touch .btn-default.topic-drafts-menu-trigger {
border: none;
margin-left: 2px;
&:hover {
border: none;
box-shadow: none;
}
}
.btn-default {
border: 1px solid var(--primary-300);
background: var(--secondary);
.d-icon {
color: var(--accent-color);
}
&:hover {
border-color: transparent;
box-shadow: 0px 0px 8px 1px var(--button-box-shadow);
background: var(--d-content-background);
color: var(--accent-color);
.d-icon {
color: var(--accent-color);
.discourse-no-touch & {
border: 1px solid var(--accent-color);
box-shadow: 0px 0px 8px 2px var(--button-box-shadow);
background: var(--secondary);
color: var(--primary);
.d-icon {
color: var(--accent-color);
}
}
}
&:focus-visible {
background: var(--d-content-background);
color: var(--accent-color);
box-shadow: 0px 0px 0px 3px var(--button-box-shadow);
.d-icon {
.discourse-no-touch & {
background: var(--secondary);
color: var(--accent-color);
}
}
&:active:not(:hover, :focus) {
color: var(--primary);
background: var(--tertiary-300);
background-image: none;
.d-icon {
color: var(--tertiary-high);
box-shadow: 0px 0px 0px 2px var(--secondary),
0px 0px 0px 4px var(--button-box-shadow);
.d-icon {
color: var(--accent-color);
}
}
}
}
//not shared with select-kit
.btn-default {
&:active {
.discourse-no-touch & {
color: var(--secondary);
background: oklch(from var(--accent-color) 30% c h) !important;
.d-icon {
color: var(--secondary);
}
}
}
}
.btn-primary,
#create-topic.btn {
background-color: var(--accent-color);
@@ -66,31 +104,50 @@
}
&:hover {
.discourse-no-touch & {
background: light-dark(
oklch(from var(--accent-color) 40% c h),
oklch(from var(--accent-color) 50% c h)
);
background: radial-gradient(
90% 110% at 50% 50%,
rgba(255, 255, 255, 0.3) 0%,
rgba(255, 255, 255, 0) 100%
),
var(--accent-color);
box-shadow: 0px 0px 6px 1px var(--button-box-shadow);
color: var(--accent-text-color);
.d-icon {
color: var(--accent-text-color);
}
}
}
&:focus-visible {
.discourse-no-touch & {
background: light-dark(
oklch(from var(--accent-color) 40% c h),
oklch(from var(--accent-color) 50% c h)
);
box-shadow: 0px 0px 0px 4px var(--button-box-shadow);
color: var(--accent-text-color);
background: radial-gradient(
90% 110% at 50% 50%,
rgba(255, 255, 255, 0.3) 0%,
rgba(255, 255, 255, 0) 100%
),
var(--accent-color);
box-shadow: 0px 0px 0px 2px var(--secondary),
0px 0px 0px 4px var(--button-box-shadow);
}
}
&:active {
background: light-dark(
oklch(from var(--accent-color) 40% c h),
oklch(from var(--accent-color) 50% c h)
);
.discourse-no-touch & {
// background: radial-gradient(
// 65% 95% at 50% 50%,
// rgba(0, 0, 0, 0.4) 0%,
// rgba(0, 0, 0, 0) 100%
// ),
// var(--accent-color) !important;
background: oklch(from var(--accent-color) 30% c h) !important;
}
}
}
.post-controls {
svg.d-icon {
color: inherit !important; //something we should honestly implement in core imo, when do we ever NOT want the same colour for icon and text?
}
}
//undoing the outline for select-kit, since Im using a custom visual cue
.select-kit.single-select.is-expanded .select-kit-header:not(.btn),
.select-kit.single-select .select-kit-header:not(.btn):focus,
.select-kit.single-select .select-kit-header:not(.btn):active {
outline: transparent;
border-color: var(--accent-color);
}
+8 -27
View File
@@ -1,8 +1,12 @@
.full-page-chat.full-page-chat-sidebar-enabled {
border-top-left-radius: var(--d-border-radius-large);
border-top-right-radius: var(--d-border-radius-large);
border: none;
}
.c-navbar-container {
border-top-left-radius: var(--d-border-radius-large);
border-top-right-radius: var(--d-border-radius-large);
padding: 0 1.5em;
background-color: var(--d-content-background);
}
@@ -11,22 +15,15 @@ body.has-full-page-chat {
background-color: var(--background-color);
}
.chat-drawer-container {
.is-expanded & {
box-shadow: 0px 0px 0px 2px var(--tertiary-medium);
}
.chat-drawer.is-expanded & {
border: none;
}
}
.chat-drawer-outlet-container {
z-index: z("composer", "content");
.chat-drawer .chat-drawer-container {
box-shadow: 0px 0px 0px 2px var(--d-chat-border);
border: none;
}
.chat-drawer .channels-list-container .chat-channel-row {
margin-bottom: var(--spacing-block-xs);
font-size: var(--font-up-1);
border-radius: var(--d-border-radius);
border-bottom: none;
&:hover {
background-color: var(--d-sidebar-active-background);
@@ -38,19 +35,3 @@ body.has-full-page-chat {
text-transform: uppercase;
font-size: var(--font-down-1);
}
.chat-composer__wrapper {
background: var(--d-content-background);
}
.chat-message-actions .more-buttons .btn-icon-text {
&:hover {
background-color: var(--d-selected);
box-shadow: none;
color: var(--primary);
}
}
.chat-drawer-active.chat-drawer-expanded .chat-composer-dropdown__menu-content {
z-index: z("composer", "content") + 1;
}
-25
View File
@@ -1,25 +0,0 @@
.user-color-palette-menu {
&__item .btn-icon-text.btn-flat {
background-color: var(--d-content-background);
width: 100%;
justify-content: flex-start;
}
&__item .btn-icon-text.btn-flat:hover {
background-color: var(--d-selected);
box-shadow: none;
color: var(--primary);
}
&__item .btn-icon-text.btn-flat:hover svg {
color: var(--icon-color);
}
&__item .btn-icon-text.btn-flat svg {
color: var(--icon-color);
}
&__item-choice.active.btn-icon-text.btn-flat {
background-color: var(--d-selected);
}
}
.user-color-palette-content .fk-d-menu__inner-content {
border: none;
}
-26
View File
@@ -1,26 +0,0 @@
:root {
--d-sidebar-highlight-hover-icon: var(--d-sidebar-link-color);
--d-sidebar-highlight-hover-background: var(--d-selected);
--d-sidebar-link-icon-color: var(--d-sidebar-link-color);
--d-sidebar-header-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-background: var(--background-color);
--d-sidebar-footer-fade: rgba(var(--tertiary-50-rgb), 1);
--d-sidebar-prefix-background: var(--d-selected);
--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.7) c h)
);
--d-sidebar-highlight-prefix-background: light-dark(
oklch(from var(--d-selected) calc(l * 0.85) c h),
oklch(from var(--d-selected) calc(l * 0.7) c h)
);
--d-sidebar-highlight-suffix-color: var(--d-sidebar-active-suffix-color);
--d-sidebar-highlight-color: var(--primary);
--d-sidebar-highlight-background: var(--d-selected);
--d-sidebar-section-link-icon-size: 1em;
--d-hover: oklch(from var(--d-selected) l c h / 0.75);
--d-input-bg-color: var(--d-content-background);
--d-sidebar-active-color: var(--primary) !important;
}
-64
View File
@@ -1,64 +0,0 @@
.peek-mode-toggle {
display: none;
}
@media screen and (min-width: 1300px) {
html:not(.fullscreen-composer) {
.peek-mode-toggle svg {
transform: scaleX(-1);
}
&.composer-open {
.full-width-enabled .peek-mode-toggle {
display: flex;
}
.full-width-enabled.peek-mode-active {
#reply-control.hide-preview {
transition: none;
box-shadow: none;
border-radius: var(--d-border-radius-large);
.grippie {
display: none;
}
.reply-area {
padding-inline: 0.67em;
}
}
#reply-control:not(.fullscreen).hide-preview {
width: 100%;
right: var(--main-grid-gap);
top: var(--header-offset);
bottom: var(--main-grid-gap);
left: unset;
height: unset;
max-width: 36.5vw;
}
&.has-sidebar-page {
#main-outlet-wrapper {
grid-template-columns:
var(--d-sidebar-width) calc(100vw - 38vw - var(--d-sidebar-width))
1fr;
}
}
&:not(.has-sidebar-page) {
#main-outlet-wrapper {
grid-template-columns: 0 calc(100vw - 52vw) 1fr;
}
#reply-control:not(.fullscreen).hide-preview {
max-width: 46vw;
}
}
.sidebar-wrapper .sidebar-container {
height: unset;
}
}
}
}
}
-90
View File
@@ -1,90 +0,0 @@
#reply-control
.select-kit.dropdown-select-box.composer-actions
.select-kit-header {
border: 1px solid var(--tertiary-700);
background: var(--secondary);
&:hover {
.d-icon {
color: var(--accent-color);
}
}
}
#reply-control.hide-preview:not(.draft) {
@include breakpoint("mobile-extra-large", $rule: min-width) {
background: var(--d-content-background);
border-top-right-radius: var(--d-border-radius);
border-top-left-radius: var(--d-border-radius);
.grippie {
background: var(--tertiary-low);
}
.user-selector,
.title-and-category {
padding: 0 var(--spacing-inline-m);
width: calc(100% - var(--spacing-inline-m) * 2);
}
.d-editor-button-bar {
padding: 3px var(--spacing-inline-m);
border: none;
}
.d-editor-input {
padding: var(--spacing-inline-m);
}
&:has(.in-focus) .grippie {
background: var(--tertiary);
}
.reply-area {
padding-inline: 0;
}
.reply-to,
.submit-panel {
padding-inline: var(--spacing-inline-sm);
}
.d-editor-textarea-wrapper {
border: 0;
border-bottom: 1px solid var(--primary-low);
border-radius: 0;
&.in-focus {
outline: 0;
}
}
}
}
.d-editor-button-bar {
.btn:hover,
.toolbar-popup-menu-options.is-expanded {
.discourse-no-touch & {
background: var(--tertiary-very-low);
color: var(--accent-color);
.d-icon {
color: inherit;
}
//to have parity with regular select-kit styling used elsewhere
.select-kit-row {
.d-icon {
color: var(--primary-high);
}
&:hover {
.d-icon {
color: var(--primary);
}
}
}
}
}
.toolbar-popup-menu-options.is-expanded {
border-radius: var(--d-border-radius);
}
}
-255
View File
@@ -1,255 +0,0 @@
// Full width layout. Ported from the Discourse Full Width theme component here
// https://meta.discourse.org/t/discourse-full-width-component/292496, which we
// intend to move into core over time.
//
// We are copying this here so we can continue to iterate on Horizon with full
// width without having to include the theme component as a dependency, we
// need to remove this once full width is in core.
$sidebar-width: 17em;
.wrap {
max-width: unset; // undoing core default
}
.d-header #site-logo {
// constraining the logo to fit its grid container
// this prevents the logo from shifting header content
// when the sidebar is opened
max-height: 100%;
max-width: 100%;
object-fit: contain; // contains logo without squishing/stretching
}
#main-outlet-wrapper {
padding: 0;
body.has-sidebar-page & {
.sidebar-wrapper {
width: var(--d-sidebar-width);
}
}
body.has-full-page-chat & {
gap: 0;
}
.sidebar-wrapper {
width: 100%; // safari has issues without this
}
#main-outlet {
margin: 0 auto;
max-width: var(--d-max-width);
width: 100%;
body.has-full-page-chat & {
max-width: unset;
}
}
}
.has-full-page-chat:not(.discourse-sidebar) .full-page-chat {
border: none;
}
#main-outlet > .regular {
max-width: var(--d-max-width);
margin: 0 auto;
body.has-sidebar-page & {
margin: 0 auto;
}
}
.d-header .title:not(.title--minimized) {
// allowing overflow here isn't always ideal
// but works well enough most of the time
overflow: visible;
}
.d-header {
> .wrap {
.contents {
display: grid;
grid-template-areas: "logo lspace extra-info rspace panel";
grid-template-columns:
minmax(auto, 1fr)
auto
minmax(0, calc(var(--d-max-width)))
auto
minmax(auto, 1fr);
.d-header-mode {
grid-area: extra-info;
white-space: nowrap;
@include breakpoint("tablet") {
display: none;
}
}
.d-header .title {
min-width: auto;
}
.has-sidebar-page & {
// at wide widths, when 1fr > 0
// we want the panel to be the same width as the sidebar
// this way we can get more accurate centering
grid-template-columns:
calc(var(--d-sidebar-width) - 11px) // 11px is wrap padding
1fr
minmax(0, calc(var(--d-max-width)))
1fr
minmax(0, calc(var(--d-sidebar-width) - 11px));
gap: 1em;
// at narrower widths, when 1fr = 0
// we can center without matching the sidebar's width
// which allows the title to take up the remaining width
@media screen and (max-width: 1400px) {
grid-template-columns:
calc(var(--d-sidebar-width) - 11px)
1fr
minmax(0, calc(var(--d-max-width)))
1fr
auto;
}
@media screen and (max-width: 1000px) {
gap: 0.5em;
}
.d-header-mode {
grid-area: extra-info;
}
}
}
}
.header-sidebar-toggle {
grid-area: logo;
}
.before-header-panel-outlet {
grid-area: extra-info;
}
.d-header-mode {
.bootstrap-mode {
margin: 0;
}
}
.home-logo-wrapper-outlet {
grid-area: logo;
margin-left: 3.7em; // 2.7em hamburger width + 1em for margin
margin-right: 0.725em;
display: flex;
overflow: visible;
.title {
flex: 1 0 auto;
}
}
.panel {
grid-area: panel;
}
}
.extra-info-wrapper {
grid-area: extra-info;
max-width: var(--d-max-width);
width: 100%;
box-sizing: border-box;
padding: 0;
}
.header-search--enabled .floating-search-input-wrapper {
grid-area: extra-info;
@include breakpoint(tablet) {
grid-area: rspace;
}
@include breakpoint(mobile-extra-large) {
display: none;
}
}
body.has-sidebar-page {
.wrap {
max-width: unset; // undoing core default
}
.d-header-mode,
.extra-info-wrapper {
padding: 0;
}
@media screen and (min-width: calc($reply-area-max-width + ($sidebar-width * 2))) {
#reply-control.show-preview {
margin-left: auto;
margin-right: auto;
}
.sidebar-container {
height: auto;
}
}
@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) {
margin-left: $sidebar-width;
width: auto;
// overruling new core composer changes
max-width: $reply-area-max-width;
transform: none;
}
.sidebar-container {
height: auto;
}
}
// overruling new core composer changes
@media screen and (min-width: $reply-area-max-width) {
#reply-control.show-preview:not(.fullscreen) {
max-width: $reply-area-max-width;
transform: none;
}
}
}
body.sidebar-animate {
#main-outlet-wrapper {
transition: none;
}
.d-header-wrap .wrap {
transition: none;
}
}
.d-header-icons {
display: flex;
}
.rtl {
.d-header .title {
margin-right: 3.7em; // 2.7em hamburger width + 1em for margin
margin-left: 0.725em;
}
}
// provides some extra space for login buttons
@media screen and (min-width: 1400px) {
.anon {
.d-header .panel {
grid-column-start: -4;
}
}
}
-65
View File
@@ -1,65 +0,0 @@
// Fixing bulk select (only needed for desktop)
.bulk-select-enabled {
.topic-list-header .topic-list-data.default {
position: sticky;
top: 10em;
}
.topic-author-avatar-data {
display: none;
}
.bulk-select.topic-list-data {
grid-area: bulk-select;
margin-left: -0.5em;
@media screen and (max-width: 576px) {
margin-top: 0;
label {
padding-block: 0.345em;
}
}
input {
transform: scale(1.5);
}
}
}
.topic-list-header {
tr {
border: none;
}
.topic-list-data {
padding: 0;
&:not(.default) {
display: none;
}
&.default {
position: absolute;
right: 0;
.bulk-select,
span:not(.bulk-select-topics, .d-button-label) {
display: none;
}
}
}
.bulk-select-topics {
position: absolute;
right: 0;
bottom: 0;
background: var(--secondary);
border-radius: 0 0 0 var(--d-border-radius);
padding: 1em;
@media screen and (max-width: 1048px) {
right: 0;
}
button {
white-space: nowrap;
}
}
}
+5 -62
View File
@@ -2,10 +2,14 @@
box-shadow: none;
background: var(--background-color);
@include breakpoint(extra-large, $rule: min-width) {
padding-bottom: var(--main-grid-gap);
padding-bottom: 1.5em;
}
}
.has-full-page-chat .d-header {
background-color: transparent;
}
.user-menu .quick-access-panel,
.user-notifications-list {
li {
@@ -26,64 +30,3 @@
.user-menu.revamped .tabs-list .btn.active {
background: var(--d-hover);
}
.discourse-no-touch .d-header-icons .icon:hover,
.discourse-no-touch .d-header-icons .icon:focus,
.header-sidebar-toggle button:focus:hover,
.discourse-no-touch .header-sidebar-toggle button:hover {
background-color: transparent;
}
.discourse-no-touch .d-header-icons .icon:hover > .d-icon,
.drop-down-mode .d-header-icons .active .icon > .d-icon,
.drop-down-mode
.d-header-icons
.header-color-scheme-toggle
.-expanded
> .d-icon,
.discourse-no-touch .header-sidebar-toggle button:hover .d-icon {
color: var(--header_primary-medium);
}
.discourse-no-touch .interface-color-selector-content {
border: none;
border-radius: var(--d-border-radius);
.btn {
border: none;
&:hover {
box-shadow: none;
}
}
}
.drop-down-mode .d-header-icons .active .icon,
.drop-down-mode .d-header-icons .header-color-scheme-toggle .-expanded {
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;
}
.badge-notification {
color: var(--accent-text-color);
}
body.login-page,
body.signup-page,
body.invite-page,
body.password-reset-page,
body.activate-account-page {
.d-header {
background: var(--background-color);
}
}
.header-dropdown-toggle.chat-header-icon .icon .chat-channel-unread-indicator {
border-color: var(--background-color);
}
.d-header-icons .badge-notification {
border-color: var(--background-color);
}
+1
View File
@@ -1,4 +1,5 @@
.sidebar__panel-switch-button,
.sidebar-section[data-section-name="messages"],
.list-controls #create-topic,
.notifications-button-footer .reason .text,
.pinned-button .reason .text,
-14
View File
@@ -1,14 +0,0 @@
body.static-login {
#main-outlet-wrapper {
grid-template-areas:
"sidebar blank"
"sidebar content"
"sidebar below-content";
grid-template-rows: auto 1fr auto;
}
.login-welcome {
border-radius: none;
border: none;
box-shadow: none;
}
}
+58 -62
View File
@@ -1,28 +1,19 @@
:root {
--main-grid-gap: 0.5em;
}
html:not(:has(.has-full-page-chat)) {
// @include breakpoint(extra-large, $rule: min-width) {
background-color: var(--background-color);
@include breakpoint("mobile-extra-large") {
background-color: var(--d-content-background);
}
// }
}
body {
-webkit-font-smoothing: antialiased;
@include breakpoint("mobile-extra-large") {
background-color: var(--d-content-background);
}
:root {
--main-grid-gap: 2em;
}
#main-outlet-wrapper {
gap: var(--main-grid-gap);
}
body.has-sidebar-page.has-full-page-chat #main-outlet-wrapper {
grid-column-gap: var(--main-grid-gap);
background-color: var(--background-color);
}
body.has-full-page-chat:not(.has-sidebar-page) {
@@ -30,26 +21,22 @@ body.has-full-page-chat:not(.has-sidebar-page) {
background-color: var(--background-color);
}
#main-outlet-wrapper {
gap: var(--main-grid-gap);
@include breakpoint(medium) {
gap: 0;
--main-grid-gap: 0;
.full-page-chat.full-page-chat-sidebar-enabled,
.c-navbar-container {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
}
}
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) 1fr 0px;
#main-outlet {
max-width: unset;
}
}
body:not(.has-sidebar-page) #main-outlet-wrapper {
@include breakpoint(medium, $rule: min-width) {
grid-template-columns: 0px minmax(0, 1fr) 0px;
}
}
body:not(.has-full-page-chat) {
@include breakpoint(extra-large, $rule: min-width) {
background-color: var(--background-color);
@@ -58,47 +45,63 @@ body:not(.has-full-page-chat) {
@include breakpoint(medium) {
--main-grid-gap: 0;
}
@media screen and (min-width: 768px) {
@include breakpoint(tablet, $rule: min-width) {
gap: var(--main-grid-gap);
}
// height: calc(100vh - var(--header-offset) - 4rem);
// box-sizing: border-box;
// > * {
// height: inherit;
// box-sizing: border-box;
// }
#main-outlet {
width: 100%;
max-width: unset;
padding-bottom: var(--spacing-block-l);
// height: inherit;
// overflow: scroll;
// &:has(.list-controls) {
// padding-top: 0;
// }
// &:has(#topic-title) {
// padding-top: 0;
// }
//thanks to random container elements on the page, I can't do a direct child selector here because it targets all the randomness, so I see no other option than MANUALLY adding every possible element that can appear in the main outlet YAY
.list-controls,
.list-container,
#topic-title,
.container.posts,
#topic-footer-buttons,
.more-topics__container,
.search-banner,
.container.viewing-self,
.reviewable,
.admin-content,
.discourse-post-event-upcoming-events,
.container.groups-index,
.body-page,
.container.badges,
.topic-above-footer-buttons-outlet .presence-users,
.global-notice {
max-width: 1000px;
margin-inline: auto;
padding-inline: 1.5em;
}
border-radius: var(--d-border-radius-large);
background-color: var(--d-content-background);
@include breakpoint(medium) {
border-radius: 0px;
}
html.composer-open & {
padding-bottom: var(--composer-height);
}
> *:not(.experimental-screen, .activate-account) {
@include breakpoint(medium, $rule: min-width) {
box-sizing: border-box;
max-width: 1000px;
margin-inline: auto;
padding-inline: var(--spacing-inline-l);
}
}
border-radius: 1.25rem;
// box-shadow: 0px 0px 1px 2px #e2e8f8, 0px 0px 24px 4px #e2e8f8;
background-color: var(--d-content-background);
}
}
// .global-notice {
// margin-top: var(--spacing-block-m);
// }
}
#list-area {
.show-more.has-topics {
@include breakpoint(medium, $rule: min-width) {
width: auto;
right: 50%;
transform: translateX(50%);
.alert {
padding: var(--spacing-block-sm) var(--spacing-inline-m);
border-radius: var(--d-border-radius-large);
font-size: var(--font-down-1-rem);
}
}
}
.list-container {
.topic-list-body {
padding-top: var(--spacing-block-m);
}
@@ -109,16 +112,9 @@ aside.onebox {
}
.d-editor-preview-wrapper {
border-radius: var(--d-border-radius);
box-shadow: 0px 0px 1px 2px var(--tertiary-50),
0px 0px 24px 4px var(--tertiary-50);
border-radius: var(--d-border-radius-large);
padding: 1em;
background-color: var(--d-content-background);
}
.no-ember {
#main-outlet {
border-radius: var(--d-border-radius-large);
margin: 0 var(--main-grid-gap) var(--main-grid-gap) var(--main-grid-gap);
padding: 2em;
max-height: calc(100vh - 50px - 1em - var(--main-grid-gap));
}
}
+6 -63
View File
@@ -8,7 +8,7 @@
}
.powered-by-discourse {
z-index: 400;
z-index: 9999;
}
.boxed.white {
@@ -40,68 +40,11 @@
border-radius: 0;
}
.open .grippie {
background-color: var(--accent-color);
.d-editor-button-bar {
padding: 3px;
}
.d-editor-textarea-wrapper.in-focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.select-kit.multi-select.is-expanded .multi-select-header,
.select-kit.multi-select .multi-select-header:focus {
border-color: var(--accent-color);
outline: 2px solid var(--accent-color);
}
#reply-control {
background-color: var(--background-color);
}
@include breakpoint(mobile-extra-large) {
// pinned topic excerpts are hidden on small screens too
.fk-d-menu__trigger.topic-list-layout-trigger {
display: none;
}
}
.search-container .search-header,
.search-container .search-bar,
.search-container .search-filters,
.search-container .search-filters .search-advanced-filters {
background-color: var(--d-content-background);
}
.user-main .about .details {
padding: 1em 1em 0;
border-bottom: 0px;
border-radius: var(--d-border-radius);
background-color: var(--primary-50);
}
.alert.alert-info {
background: var(--tertiary-very-low);
}
.discourse-reactions-list .reactions {
gap: 0.15em;
}
.group-details-container {
border-radius: var(--d-border-radius);
}
.period-chooser-header {
border-radius: 0;
a,
a:visited {
color: var(--accent-color);
}
+38 -105
View File
@@ -2,11 +2,11 @@
@include breakpoint(medium) {
html,
.d-header {
background-color: var(--d-content-background);
background-color: var(--secondary);
}
}
#main-outlet-wrapper {
*[class*="navigation-"] & {
.navigation-topics & {
@include breakpoint(mobile-extra-large) {
padding: 0;
}
@@ -32,17 +32,10 @@
.category-breadcrumb.hidden,
.category-breadcrumb {
display: flex !important;
column-gap: var(--spacing-inline-s);
row-gap: var(--spacing-block-xs);
flex-basis: 100%;
li {
margin-right: 0;
margin-left: calc(
(var(--spacing-block-s) - 2px) * -1
); // 2px is width of the outline
}
gap: var(--spacing-inline-sm);
.select-kit-header {
background: var(--d-content-background);
padding-block: var(--spacing-block-s);
padding-inline: 0;
border: 0;
}
}
@@ -71,9 +64,7 @@
}
}
.navigation-controls {
@include breakpoint(mobile-extra-large) {
gap: var(--spacing-inline-s);
}
gap: var(--spacing-inline-s);
}
}
}
@@ -89,63 +80,53 @@
padding-top: 0;
}
}
.topic-list-item {
@include breakpoint(mobile-extra-large) {
box-shadow: none;
border-radius: 0;
//to be moved to topic card segment for general use
// .navigation-category & {
// .badge-category__wrapper {
// display: none;
// }
// }
}
}
}
#topic-title {
@include breakpoint(mobile-extra-large) {
padding-inline: var(--spacing-inline-s) !important;
.title-wrapper {
gap: var(--spacing-block-s);
}
padding-inline: var(--spacing-inline-m) !important;
.topic-category {
order: -1;
}
//make mixin of this
.badge-category__wrapper {
font-size: var(--font-down-2-rem);
border-radius: var(--d-border-radius);
padding: var(--spacing-inline-xs) var(--spacing-inline-s);
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)
);
border: 1px solid
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)
);
}
// .badge-category__wrapper {
// border-radius: var(--d-border-radius);
// padding: var(--spacing-inline-xs) var(--spacing-inline-s);
// 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)
// );
// }
.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)
);
}
.discourse-tags {
gap: var(--spacing-inline-xs);
&__tag-separator {
display: none;
}
}
.discourse-tag {
font-size: var(--font-down-2-rem);
padding: var(--spacing-inline-xs) var(--spacing-inline-s);
gap: var(--spacing-inline-xs);
border-radius: var(--d-border-radius-large);
border: 1px solid var(--primary-low-mid);
background: var(--secondary);
}
// .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)
// );
// }
}
}
.container.posts {
@include breakpoint(mobile-extra-large) {
padding-inline: var(--spacing-inline-xs) !important;
padding-inline: var(--spacing-inline-m) !important;
.main-avatar .avatar {
width: 40px;
height: 40px;
border-radius: var(--d-border-radius);
}
.topic-body {
@@ -156,59 +137,11 @@
}
.contents {
padding-top: var(--spacing-block-m);
}
}
.small-action {
&-desc {
padding: var(--spacing-block-xs) 0;
}
//for core eventually, better way imo
.topic-avatar {
padding-top: 0;
align-items: center;
.d-icon {
font-size: var(--font-up-1);
p {
line-height: 1.65;
}
}
}
}
}
#topic-footer-buttons {
@include breakpoint(mobile-extra-large) {
padding-inline: var(--spacing-inline-xs) !important;
}
}
}
//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
#topic-progress-wrapper {
.progress-back-container {
margin-right: 0;
margin-bottom: var(--spacing-block-xs);
.btn-primary.progress-back {
border-radius: 0;
background: var(--secondary);
border: 1px solid var(--tertiary-low);
color: var(--accent-color);
padding: var(--spacing-inline-s) var(--spacing-inline-m);
.d-icon {
color: var(--accent-color);
}
}
}
.topic-admin-menu-trigger {
border-radius: 0;
background: var(--secondary);
border: 1px solid var(--tertiary-low);
}
}
.mobile-device #reply-control.show-preview .submit-panel {
background-color: var(--background-color);
}
.d-editor-preview-wrapper {
outline: 2px solid var(--background-color);
}
+13 -23
View File
@@ -2,7 +2,7 @@
position: sticky;
top: var(--header-offset);
background: var(--d-content-background);
z-index: z("base");
z-index: 100;
padding: 1.5rem 0 1rem 0;
max-width: unset;
@@ -17,18 +17,10 @@
background-color: var(--secondary);
border-radius: var(--d-border-radius-large);
border: 1px solid var(--primary-300);
// font-size: var(--font-up-1-rem);
&:hover {
border: 1px solid var(--accent-color);
}
&:focus-visible {
.discourse-no-touch & {
background: var(--secondary);
color: var(--accent-color);
box-shadow: 0px 0px 0px 3px var(--button-box-shadow);
.d-icon {
color: var(--accent-color);
}
}
box-shadow: 0px 0px 8px 2px var(--button-box-shadow);
}
}
.select-kit.combo-box.category-drop.has-selection
@@ -44,17 +36,15 @@
.nav-pills > li > a:hover,
.nav-pills > li button:hover {
.discourse-no-touch & {
background: transparent;
color: var(--d-nav-color--hover);
&::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: var(--d-nav-underline-height);
background: var(--d-nav-color--hover);
}
background: transparent;
color: var(--accent-color);
&::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: var(--d-nav-underline-height);
background: var(--accent-color);
}
}
+83
View File
@@ -0,0 +1,83 @@
.custom-search-banner-wrap {
display: grid;
grid-template-rows: 0.33fr 0.33fr 0.33fr;
grid-template-columns: 1fr 1fr;
grid-column-gap: 1em;
grid-row-gap: 0.5em;
border-bottom: 1px solid var(--primary-300);
padding: 1.5em 0 2.5em;
margin-bottom: 0;
@media screen and (max-width: 900px) {
padding-bottom: 1em;
}
h1 {
grid-column: 1/2;
grid-row: 1/-1;
padding: 0 1em;
text-align: left;
align-self: center;
margin: 0;
font-weight: 400;
color: var(--search-banner-text-color);
@media screen and (max-width: 1028px) {
font-size: var(--font-up-4);
grid-column: 1/-1;
grid-row: 1;
text-align: center;
margin-bottom: 0.5em;
}
@media screen and (max-width: 768px) {
text-align: left;
grid-column: 1/2;
grid-row: 1/-1;
font-size: var(--font-up-3);
}
@media screen and (max-width: 600px) {
grid-column: 1/-1;
grid-row: 1;
text-align: center;
margin-bottom: 0.5em;
}
}
.search-menu {
grid-column: 2/3;
grid-row: 1/-1;
width: 100%;
align-self: center;
@media screen and (max-width: 1028px) {
grid-row: 2/-1;
grid-column: 1/-1;
}
@media screen and (max-width: 768px) {
grid-column: 2/-1;
grid-row: 1/-1;
}
@media screen and (max-width: 600px) {
grid-row: 2/-1;
grid-column: 1/-1;
}
}
p {
display: none;
}
.search-input {
background: var(--d-content-background);
border: 1px solid var(--search-color);
box-shadow: 0 4px 10px rgba(52, 6, 121, 15%);
}
.search-menu .search-input:focus-within,
.search-menu-container .search-input:focus-within {
border: 1px solid var(--search-color);
outline: 2px solid var(--search-color);
}
.search-menu .d-icon,
.search-menu .searching .d-icon {
color: var(--search-color);
}
.panel-body {
z-index: z("dropdown");
}
.results {
background: var(--d-content-background);
}
}
-64
View File
@@ -1,64 +0,0 @@
.navigation-controls {
.topic-drafts-menu-trigger,
.fk-d-button-tooltip {
display: none;
}
}
.sidebar-new-topic-button {
flex: 1 1 auto;
&__wrapper {
box-sizing: border-box;
display: flex;
.mobile-view & {
margin: 0 0 1rem;
}
&:has(.topic-drafts-menu-trigger) {
.sidebar-new-topic-button {
border-radius: var(--d-button-border-radius) 0 0
var(--d-button-border-radius);
border-right: 1px solid var(--primary-300);
}
}
.fk-d-button-tooltip {
flex: 1 1 auto;
}
.topic-drafts-menu-trigger {
flex: 0 1 auto;
margin: 0;
border-radius: 0 var(--d-button-border-radius)
var(--d-button-border-radius) 0;
}
.fk-d-button-tooltip:has(button[disabled]) {
+ .topic-drafts-menu-trigger {
display: none;
}
.fk-d-tooltip__trigger {
background: var(--accent-color);
border-radius: 0 var(--d-button-border-radius)
var(--d-button-border-radius) 0;
padding-right: 0.65em;
.d-icon {
color: var(--secondary);
}
}
}
}
}
li.sidebar-section-link-wrapper[data-list-item-name="New Topic"] {
display: none;
}
.has-full-page-chat {
.sidebar-new-topic-button__wrapper {
display: none;
}
}
+13 -24
View File
@@ -1,12 +1,8 @@
.sidebar-wrapper,
.sidebar-hamburger-dropdown {
.sidebar-wrapper {
@include breakpoint(medium) {
background: var(--secondary);
.sidebar-footer-wrapper {
background: var(--secondary);
.sidebar-footer-container::before {
display: none;
}
}
}
.has-full-page-chat &,
@@ -21,6 +17,10 @@
padding: 0;
}
.sidebar-section-link {
font-size: var(--font-up-1);
// dont want to change fonts here just yet as font-size can be changed as a user pref.
// charlie: sure but I want it to be bigger by default
// letter-spacing: 0.5px;
transition: none;
border-radius: var(--d-border-radius);
}
@@ -29,31 +29,18 @@
}
}
.sidebar-section-wrapper {
@include breakpoint(extra-large, $rule: min-width) {
padding-block: 0.45em;
}
@include breakpoint(mobile-extra-large) {
.hamburger-panel .revamped & {
margin-bottom: var(--spacing-block-m);
}
}
padding-block: 0.45em;
.sidebar-section-header {
font-size: var(--font-down-2);
font-size: var(--font-down-1);
}
.sidebar-section-content {
margin: 0;
display: flex;
flex-direction: column;
@include breakpoint(extra-large, $rule: min-width) {
gap: var(--spacing-block-xs);
}
gap: var(--spacing-block-xs);
}
}
.sidebar-wrapper .sidebar-sections {
--scrollbarThumbBg: var(--d-selected);
}
.sidebar-section-link-wrapper .sidebar-section-link:focus,
.sidebar-section-link-wrapper .sidebar-section-link:hover {
.d-icon {
@@ -62,9 +49,11 @@
}
.sidebar-new-topic-button__wrapper {
margin: 0 var(--spacing-inline-m) var(--spacing-block-l);
.sidebar-new-topic-button .d-icon {
display: none;
margin-bottom: 1.5rem;
@media screen and (max-width: 1000px) {
.sidebar-new-topic-button .d-icon {
display: none;
}
}
}
+196 -485
View File
@@ -1,12 +1,22 @@
// 390x844 mobile/portrait (Figma iPhone 13 & 14)
// 744x1133 tablet/portrait (Figma iPad mini 8.3)
// 1280x832 desktop small (Figma MacBook Air)
:root {
--hot-color: oklch(63.79% 0.1823 34.77);
}
$extra-small: 435px;
$small: 576px;
$medium: 980px;
$extra-large: 1280px;
.topic-list .topic-list-item-separator {
display: none;
}
.topic-list > .topic-list-body > .topic-list-item.last-visit {
border-bottom: 1px solid var(--primary-300);
&:hover {
border-color: var(--accent-color);
}
}
.topic-list-body {
@@ -16,93 +26,136 @@
gap: 1em;
@include breakpoint(medium) {
gap: 0.5em;
padding: 0 0.5em;
}
@include breakpoint(mobile-extra-large) {
gap: 0;
padding: 0;
}
}
.topic-list-body .topic-list-item {
body.bulk-select-enabled .topic-list-item {
grid-template-areas:
"bulk-select avatar author status status . activity"
". topic-title topic-title topic-title likes-replies likes-replies category";
.bulk-select {
grid-area: bulk-select;
padding: 0;
margin: 0;
align-self: center;
justify-self: center;
label {
margin: 0;
}
}
@media screen and (max-width: $medium) {
grid-template-columns: 44px min-content min-content auto min-content min-content min-content;
grid-template-rows: 22px minmax(22px, auto);
grid-template-areas:
"bulk-select avatar author status status . activity"
". topic-title topic-title topic-title . . likes-replies"
". topic-title topic-title topic-title . . category";
}
@media screen and (max-width: $small) {
grid-template-columns: 25px auto repeat(6, 1fr);
grid-template-rows: auto auto auto;
grid-template-areas:
"bulk-select category-status category-status . . . . activity"
"topic-title topic-title topic-title topic-title topic-title topic-title topic-title topic-title"
"avatar author . . . . . likes-replies";
}
}
body.user-messages-page .topic-list-item {
.topic-category-status-data {
display: none;
}
grid-template-areas:
"avatar author status status . . activity"
". topic-title topic-title topic-title likes-replies likes-replies likes-replies";
&.excerpt-expanded {
grid-template-columns: 44px repeat(6, 1fr) auto;
grid-template-rows: 22px auto auto 30px;
grid-template-areas:
"avatar author status status . . . activity"
"avatar topic-title topic-title topic-title topic-title . . ."
". excerpt excerpt excerpt excerpt excerpt . ."
". excerpt excerpt excerpt excerpt excerpt likes-replies likes-replies";
@media screen and (max-width: $extra-large) {
grid-template-areas:
"avatar author status status . . . activity"
"avatar topic-title topic-title topic-title topic-title . . ."
". excerpt excerpt excerpt excerpt excerpt . likes-replies"
". excerpt excerpt excerpt excerpt excerpt . likes-replies";
}
}
@media screen and (max-width: $small) {
grid-template-columns: 25px auto repeat(6, 1fr);
grid-template-rows: auto auto;
grid-template-areas:
"topic-title topic-title topic-title topic-title topic-title topic-title topic-title activity"
"avatar author . . . . . likes-replies";
.topic-excerpt {
display: none;
}
}
}
.topic-list-item {
-webkit-font-smoothing: antialiased;
text-overflow: ellipsis;
padding: 0.75em 1rem;
border: 1px solid var(--primary-300);
display: grid;
grid-template-columns: 20px min-content min-content auto min-content;
grid-template-rows: auto minmax(20px, auto);
grid-template-columns: 44px min-content min-content auto min-content min-content min-content;
grid-template-rows: 22px minmax(22px, auto);
grid-template-areas:
". . . . status"
"activity . . likes-replies category";
grid-column-gap: 12px;
grid-row-gap: 8px;
border-radius: var(--d-border-radius);
td.main-link .link-top-line {
grid-row: 1/2;
grid-column: 1/-1;
font-weight: 500;
}
&.--has-status-card td.main-link .link-top-line {
grid-column: 1/-2;
}
@include breakpoint(extra-large) {
grid-template-areas:
". . . . status"
"activity . . likes-replies category";
}
@include breakpoint(mobile-extra-large) {
td.main-link .link-top-line,
&.--has-status-card td.main-link .link-top-line {
grid-row: 2/3;
grid-column: 1/-1;
}
grid-template-columns: 20px repeat(5, 1fr);
grid-template-rows: auto auto auto;
grid-template-areas:
"category category category category category status"
". . . . . ."
"activity . . . . likes-replies";
border: none;
border-bottom: 1px solid var(--primary-200);
box-shadow: none;
border-radius: 0;
}
"avatar author status status . . activity"
". topic-title topic-title topic-title likes-replies likes-replies category";
&.excerpt-expanded {
grid-template-columns: 20px auto auto min-content min-content;
grid-template-rows: auto auto auto;
grid-template-columns: 44px repeat(6, 1fr) auto;
grid-template-rows: 22px auto auto 30px;
grid-template-areas:
". . . . status"
"activity . . . ."
"excerpt excerpt excerpt likes-replies category";
@include breakpoint(extra-large) {
"avatar author status status . . . activity"
"avatar topic-title topic-title topic-title topic-title . . ."
". excerpt excerpt excerpt excerpt excerpt . ."
". excerpt excerpt excerpt excerpt excerpt likes-replies category";
@media screen and (max-width: $extra-large) {
grid-template-areas:
". . . . status"
"activity . . . ."
"excerpt excerpt excerpt likes-replies category";
"avatar author status status . . . activity"
"avatar topic-title topic-title topic-title topic-title . . ."
". excerpt excerpt excerpt excerpt excerpt . likes-replies"
". excerpt excerpt excerpt excerpt excerpt . category";
}
@include breakpoint(mobile-extra-large) {
@media screen and (max-width: $small) {
grid-template-columns: 25px auto repeat(6, 1fr);
grid-template-rows: auto auto auto;
grid-template-areas:
"category category category category status"
". . . . ."
"activity . . . likes-replies";
.topic-excerpt,
.link-bottom-line {
"category-status category-status category-status . . . . activity"
"topic-title topic-title topic-title topic-title topic-title topic-title topic-title topic-title"
"avatar author . . . . . likes-replies";
.topic-excerpt {
display: none;
}
}
.topic-likes-replies-data {
align-self: flex-end;
}
.topic-category-data {
align-items: flex-end;
}
.badge-category__wrapper {
height: min-content;
}
.link-bottom-line {
display: flex;
}
}
grid-column-gap: 12px;
grid-row-gap: 8px;
border-radius: var(--d-border-radius);
@media screen and (max-width: $medium) {
grid-template-columns: 44px min-content min-content auto min-content min-content min-content;
grid-template-rows: 22px minmax(22px, auto);
grid-template-areas:
"avatar author status status . . activity"
". topic-title topic-title topic-title . . likes-replies"
". topic-title topic-title topic-title . . category";
}
@media screen and (max-width: $small) {
grid-template-columns: 25px auto repeat(6, 1fr);
grid-template-rows: auto auto auto;
grid-template-areas:
"category-status category-status category-status . . . . activity"
"topic-title topic-title topic-title topic-title topic-title topic-title topic-title topic-title"
"avatar author . . . . . likes-replies";
}
@include breakpoint(medium) {
border: none;
border-bottom: 1px solid var(--primary-200);
}
// display contents
@@ -118,64 +171,32 @@
padding: 0;
}
// topic activity, avatar, text
.topic-activity-data {
grid-area: activity;
// avatar & author
.topic-author-avatar-data {
grid-area: avatar;
margin: 0;
}
.topic-activity {
display: grid;
grid-template-columns: 20px auto auto auto;
font-size: var(--font-down-1);
height: 100%;
align-items: center;
gap: 0.25em;
.topic-author-avatar img.avatar {
width: 44px;
height: 44px;
border-radius: var(--d-border-radius);
@media screen and (max-width: $small) {
width: 25px;
height: 25px;
}
}
.topic-activity__user .avatar {
width: 20px;
height: 20px;
border-radius: 4px;
}
.topic-activity__user {
height: 20px;
width: 20px;
border-radius: 4px;
td.topic-author-data {
grid-area: author;
display: flex;
gap: 0.5em;
align-items: center;
justify-content: center;
background-color: var(--primary-low);
}
.topic-activity__username {
margin-left: 0.25em;
text-wrap: nowrap;
}
@include breakpoint(mobile-extra-large) {
.topic-activity__username {
display: none;
}
.topic-activity__reason {
margin-left: 0.25em;
}
}
.topic-activity.--updated .topic-activity__reason {
margin-left: 0.25em;
.topic-author-data .topic-author {
color: var(--primary-500);
}
// status
.topic-status-data {
grid-area: status;
}
.topic-status-data {
grid-area: status;
position: relative;
}
.topic-status-card {
height: min-content;
margin-left: auto;
display: flex;
flex-direction: row;
gap: 4px;
@@ -186,14 +207,11 @@
border-radius: var(--d-border-radius);
border: 1px solid var(--status-color);
color: var(--status-color);
height: min-content;
grid-area: status;
width: min-content;
@include breakpoint("large", min-width) {
position: absolute;
right: 0px;
top: -20px;
background-color: var(--d-content-background);
height: 20px;
font-size: var(--font-down-3);
@media screen and (max-width: $small) {
height: calc(100% - 2px);
}
svg {
font-size: var(--font-down-1);
@@ -201,15 +219,28 @@
}
}
.topic-status-card.--pinned {
.topic-status-card.--bookmark {
display: none;
}
.topic-status-card.--pinned,
.topic-status-card.--unpinned {
--status-color: var(--primary-500);
cursor: pointer;
background-color: transparent;
line-height: unset;
}
.topic-status-card.--hot {
--status-color: #e45735;
--status-color: var(--hot-color);
}
// title
td.main-link .link-top-line {
font-size: var(--font-0);
grid-area: topic-title;
font-weight: 500;
}
.link-top-line .event-date {
margin-left: 0.5em;
font-size: var(--font-down-3);
}
@@ -217,16 +248,11 @@
display: none;
}
.topic-list-data {
padding: 0;
}
td.main-link .link-top-line a.raw-topic-link {
padding: 0;
}
.topic-post-badges .badge-notification.unread-posts,
.topic-post-badges .badge-notification.new-topic {
.topic-post-badges .badge-notification.unread-posts {
background-color: var(--tertiary);
color: var(--tertiary);
overflow: hidden;
@@ -237,6 +263,13 @@
min-width: unset;
}
// excerpt
.topic-excerpt {
grid-area: excerpt;
margin: 0;
font-size: var(--font-down-2);
}
// timestamp
td.activity .post-activity {
grid-area: activity;
@@ -246,52 +279,37 @@
padding: 0;
}
.link-bottom-line {
display: none;
}
// metadata
// metadata - excerpt
.topic-excerpt,
// metadata - category
td.main-link .link-bottom-line {
grid-row: 3 / -1;
grid-column: 1 / -3;
margin: 0;
font-size: var(--font-down-2);
.excerpt__contents {
color: var(--primary-high);
}
// default category position hidden
.badge-category__wrapper {
display: none;
}
display: none;
}
td.topic-category-status-data {
display: contents;
}
td.topic-category-data {
grid-area: category;
display: flex;
justify-content: flex-end;
@include breakpoint(mobile-extra-large) {
justify-content: flex-start;
@media screen and (max-width: $small) {
grid-area: category-status;
display: flex;
gap: 0.5em;
align-items: center;
}
}
td.topic-category-data .badge-category__wrapper,
td.main-link .link-bottom-line .badge-category__wrapper {
td.topic-category-status-data .badge-category__wrapper {
grid-area: category;
}
td.topic-category-status-data .badge-category__wrapper {
overflow: unset;
border-radius: var(--d-border-radius);
padding: 3px 6px;
padding: 6px;
align-self: flex-end;
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 breakpoint(tablet) {
@media screen and (max-width: $small) {
padding: 2px 6px;
font-size: var(--font-down-2);
}
.badge-category__name {
@@ -319,7 +337,8 @@
gap: 0.5em;
justify-content: flex-end;
height: min-content;
align-self: center;
align-self: flex-end;
padding-bottom: 4px;
}
.topic-likes-replies-data .topic-likes,
.topic-likes-replies-data .topic-replies {
@@ -334,323 +353,15 @@
}
}
.topic-list-header {
display: none;
}
.topic-list-item {
background: var(--d-content-background);
box-shadow: 0px 0px 12px 1px var(--topic-card-shadow);
box-shadow: 0px 0px 26px 1px var(--topic-card-shadow);
&:hover {
.discourse-no-touch & {
border-color: var(--accent-color);
background: var(--d-content-background);
}
}
&.selected {
box-shadow: 0px 0px 0px 2px var(--accent-color),
0px 0px 12px 1px var(--topic-card-shadow);
}
}
// Bookmarks
.topic-list-item.bookmark-list-item {
.link-bottom-line {
font-size: unset;
}
//regular card without excerpt class
grid-template-columns: 20px min-content min-content auto min-content min-content min-content;
grid-template-areas:
". . . . . . dropdown"
"avatar update metadata metadata metadata . category";
@include breakpoint(mobile-extra-large) {
grid-template-columns: min-content min-content auto min-content min-content min-content min-content;
grid-template-areas:
" . . . . . . dropdown"
"update metadata metadata metadata metadata category category";
.avatar {
display: none;
}
}
&.has-metadata {
grid-template-columns: 20px min-content min-content auto min-content min-content min-content;
@include breakpoint(mobile-extra-large) {
grid-template-areas:
". . . . . . . dropdown"
"update update metadata metadata metadata metadata category category";
.avatar {
display: none;
}
}
}
//card with excerpt (all in horizon since the toggle is gone)
&.excerpt-expanded {
grid-template-columns: 20px min-content auto minmax(0, 100px);
grid-template-areas:
". . . dropdown"
"avatar update metadata metadata"
"excerpt excerpt excerpt ."
"excerpt excerpt excerpt category";
.badge-category__wrapper {
align-self: flex-end;
height: min-content;
max-width: 100%;
}
@include breakpoint(extra-large, $rule: min-width) {
grid-template-columns: 20px min-content auto min-content;
}
@include breakpoint(mobile-extra-large) {
grid-template-columns: auto min-content;
grid-template-areas:
". dropdown"
"category category";
.post-excerpt,
.avatar {
display: none;
}
}
&.has-metadata {
grid-template-columns: 20px min-content auto min-content;
grid-template-areas:
". . . dropdown"
"avatar update metadata metadata"
"excerpt excerpt excerpt . "
"excerpt excerpt excerpt category";
@include breakpoint(mobile-extra-large) {
grid-template-columns: auto min-content;
grid-template-areas:
" . dropdown"
"metadata category";
.bookmark-metadata {
flex-wrap: wrap;
}
}
}
}
td.author-avatar {
grid-area: avatar;
}
td.main-link .link-bottom-line {
display: contents;
.badge-category__wrapper {
grid-area: category;
display: flex;
align-items: center;
width: min-content;
justify-self: flex-end;
}
}
td.main-link .link-top-line {
display: contents;
.bookmark-metadata {
grid-area: metadata;
margin: 0;
display: flex;
align-items: center;
gap: var(--spacing-inline-xs);
}
.bookmark-metadata-item {
margin: 0;
vertical-align: middle;
}
.bookmark-status-with-link {
grid-column: 1/-2;
grid-row: 1/2;
}
}
.post-excerpt {
grid-area: excerpt;
margin: 0;
}
.topic-list-data:last-of-type {
display: contents;
.bookmark-actions-dropdown {
grid-area: dropdown;
align-self: flex-start;
height: 1em;
.select-kit-header {
padding-top: 0;
margin-left: auto;
align-items: center;
background: transparent;
}
.select-kit-header-wrapper {
height: 1em;
width: 1em;
}
}
}
.post-metadata.topic-list-data.updated-at {
grid-area: update;
}
td.activity .post-activity {
display: none;
}
}
// Assigned List
.topic-list-item.assigned-list-item {
.topic-status-card {
display: none;
}
td.main-link .link-top-line {
grid-column: 1/-3;
}
grid-template-columns: 20px min-content min-content auto min-content min-content min-content;
grid-template-areas:
". . . . . status dropdown"
"activity . . . . likes-replies category";
@include breakpoint(mobile-extra-large) {
grid-template-columns: 20px min-content min-content auto min-content min-content min-content 36px;
grid-template-areas:
"category category . . . . status dropdown"
". . . . . . . . "
"activity . . . . . . likes-replies";
}
.assign-topic-buttons {
display: contents;
.assign-actions-dropdown {
grid-area: dropdown;
justify-content: flex-end;
height: 1em;
.select-kit-header {
padding-top: 0;
margin-left: auto;
align-items: center;
background: transparent;
}
.select-kit-header-wrapper {
height: 1em;
width: 1em;
}
}
}
td.topic-category-status-data {
display: contents;
}
.topic-status-card {
position: relative;
top: unset;
right: unset;
}
}
// User Messages
body.user-messages-page {
.topic-list-body {
gap: 0;
}
.topic-list .topic-list-data.posters a:not(.latest) {
display: block;
}
.topic-list-item {
border-radius: 0;
box-shadow: none;
border-bottom: 1px solid var(--primary-200);
border-top: none;
border-right: none;
border-left: none;
display: grid;
grid-template-areas: "title activity" "posters .";
grid-template-columns: auto auto;
grid-template-rows: auto auto;
td.topic-category-data,
td.topic-likes-replies-data,
td.topic-status-data {
display: none;
}
&.visited .main-link .link-top-line {
font-weight: normal;
grid-area: title;
}
&:hover {
background-color: var(--primary-low);
border-color: var(--primary-200);
}
td.topic-activity-data {
grid-area: activity;
}
td.topic-list-data.posters {
grid-area: posters;
display: flex;
align-items: center;
height: 100%;
a {
margin-right: 4px;
}
.avatar {
width: 20px;
height: 20px;
border-radius: 4px;
background-color: var(--primary-low);
}
}
}
}
// Bulk select
.bulk-select-enabled .topic-list-body .topic-list-item {
grid-template-areas:
"bulk-select . . . status"
"bulk-select activity activity . category";
td.topic-likes-replies-data {
display: none;
}
td.main-link .link-top-line,
&.--has-status-card td.main-link .link-top-line {
grid-column: 2/-1;
font-weight: 500;
}
.topic-excerpt {
grid-area: excerpt;
margin: 0;
}
&.excerpt-expanded {
grid-template-areas:
"bulk-select . . . status" "bulk-select activity . . ."
"bulk-select excerpt excerpt excerpt category";
@include breakpoint(mobile-extra-large) {
grid-template-areas:
"bulk-select category . . . status"
"bulk-select . . . . ."
"bulk-select activity activity . . .";
}
}
.bulk-select {
grid-area: bulk-select;
padding: 0;
margin: 0;
align-self: center;
justify-self: center;
label {
margin: 0;
}
}
@include breakpoint(large) {
grid-template-areas:
"bulk-select . . . status"
"bulk-select activity activity . category";
}
@include breakpoint(mobile-extra-large) {
td.main-link .link-top-line,
&.--has-status-card td.main-link .link-top-line {
grid-column: 2/-1;
grid-row: 2;
font-weight: 500;
}
grid-template-areas:
"bulk-select category . . . status"
"bulk-select . . . . ."
"bulk-select activity activity . . .";
border: 1px solid var(--accent-color);
background: var(--d-content-background);
}
}
+49 -53
View File
@@ -2,74 +2,78 @@
.contents {
font-size: var(--font-up-1);
line-height: 1.25;
-webkit-font-smoothing: antialiased;
}
}
.container.posts .topic-navigation:not(.with-topic-progress) {
.container.posts .topic-navigation {
// 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 {
min-width: unset; // why we have this?
.timeline-scrollarea {
border-left: 1px solid var(--accent-color);
.timeline-scroller {
@include breakpoint("medium", $rule: min-width) {
margin-left: -4.5px;
background: var(--d-content-background);
height: 40px !important; // height is coming from element style have no other choice
}
.timeline-replies,
.timeline-ago {
line-height: 1;
}
}
.timeline-handle {
background-color: var(--accent-color);
@include breakpoint("medium", $rule: min-width) {
width: 8px;
border-radius: 10px;
height: calc(100% - 6px);
}
}
}
.timeline-scroller {
padding: 0.25em;
border: 1px solid var(--accent-color);
border-radius: 0.75em;
padding-left: 0.5em;
margin-left: calc(-0.5em - 2.5px);
background: var(--secondary);
height: 40px !important; // height is coming from element style have no other choice
}
.timelime-scroller-content {
display: flex;
flex-direction: column;
gap: 0.25em;
}
.timeline-replies,
.timeline-ago {
line-height: 1;
}
.timeline-ago {
// font-size: var(--font-down-1);
}
.timeline-handle {
background-color: var(--accent-color);
width: 3px;
border-radius: 2px;
height: calc(100% - 6px);
}
}
//should probably get rid of this extra specificity class in core?
.timeline-container.timeline-fullscreen {
@include breakpoint("medium", $rule: max-width) {
.topic-timeline
.timeline-scrollarea
.timeline-scroller
.timeline-scroller-content {
padding-right: 0.5em;
}
#topic-title {
@include breakpoint(extra-large, $rule: min-width) {
z-index: z("composer", "content") - 1;
padding: var(--spacing-block-l) var(--spacing-inline-xl);
position: sticky;
margin-bottom: 0;
top: var(--header-offset);
background: var(--d-content-background);
}
z-index: z("composer", "content") - 1;
padding: var(--spacing-block-l) var(--spacing-inline-xl);
position: sticky;
margin-bottom: 0;
top: var(--header-offset);
background: var(--d-content-background);
border-radius: var(--d-border-radius-large);
}
.container.posts,
.more-topics__container,
#topic-footer-buttons {
padding: 0 24px;
}
.container.posts {
grid-template-columns: auto 8em;
grid-template-columns: auto 150px;
@media screen and (max-width: 924px) {
grid-template-columns: auto auto;
}
.post-notice {
padding: var(--spacing-block-sm);
border-radius: var(--d-border-radius);
font-size: var(--font-down-1-rem);
.d-icon {
font-size: var(--font-up-1);
width: 1em;
}
}
}
.timeline-container .topic-timeline .timeline-ago {
@@ -109,11 +113,3 @@
position: relative;
right: -4px;
}
nav.post-controls .actions button {
font-size: var(--font-0);
}
.archetype-private_message {
--pm-border-radius: var(--d-border-radius);
}
+36
View File
@@ -1,8 +1,44 @@
:root {
--accent-color: #393edb;
--background-color: light-dark(#f5f8ff, #1b1c1e);
--search-color: light-dark(
oklch(from var(--accent-color) calc(l * 0.65) calc(c * 0.65) h),
oklch(from var(--accent-color) calc(l * 1.5) calc(c * 2) h)
);
--search-banner-text-color: light-dark(
oklch(from var(--accent-color) calc(l * 0.65) calc(c * 0.65) h),
oklch(from var(--accent-color) calc(l * 1.85) calc(c * 2) h)
);
--topic-card-shadow: light-dark(
oklch(from var(--accent-color) calc(l * 2) calc(c * 0.1) h / 0.5),
oklch(from var(--accent-color) calc(l * 0.2) calc(c * 0.01) h / 0.25)
);
--button-box-shadow: light-dark(
oklch(from var(--accent-color) calc(l * 2) calc(c * 0.125) h),
oklch(from var(--accent-color) calc(l * 0.75) calc(c * 0.5) h)
);
--d-selected: light-dark(
oklch(from var(--accent-color) calc(l * 1.9) calc(c * 2) h / 0.3),
oklch(from var(--accent-color) calc(l * 0.65) calc(c * 0.65) h / 0.75)
);
--d-chat-border: light-dark(
oklch(from var(--accent-color) calc(l * 1.5) calc(c * 0.25) h),
oklch(from var(--accent-color) calc(l * 0.25) calc(c * 0.25) h)
);
--d-max-width: 1000px;
--d-border-radius-large: 20px;
--d-border-radius: 8px;
--d-input-border-radius: 6px;
--accent-text-color: light-dark(#ffffff, #0f1024);
--d-content-background: var(--secondary);
--d-nav-color--active: var(--accent-color);
--d-sidebar-background: var(--background-color);
--d-sidebar-footer-fade: rgba(var(--tertiary-50-rgb), 1);
--d-sidebar-link-color: var(--primary);
--d-sidebar-highlight-color: var(--primary);
--d-sidebar-highlight-background: var(--d-selected);
--d-sidebar-section-link-icon-size: 1em;
--d-input-bg-color: var(--d-content-background);
// --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
--spacing-block-xs: 0.25em;
-101
View File
@@ -1,101 +0,0 @@
.welcome-banner {
&__wrap {
display: grid;
grid-template-rows: 0.33fr 0.33fr 0.33fr;
grid-template-columns: 1fr 1fr;
grid-column-gap: 1em;
grid-row-gap: 0.5em;
border-bottom: 1px solid var(--primary-300);
padding: 1.5em 0 2.5em;
margin-bottom: 0;
@media screen and (max-width: 768px) {
padding: 1em;
}
@include breakpoint("mobile-extra-large") {
display: block;
padding: 0.5em;
margin-top: 0;
}
.search-menu {
grid-column: 2/3;
grid-row: 1/-1;
width: 100%;
align-self: center;
@media screen and (max-width: 1028px) {
grid-row: 2/-1;
grid-column: 1/-1;
}
@media screen and (max-width: 768px) {
grid-column: 2/-1;
grid-row: 1/-1;
}
@media screen and (max-width: 600px) {
grid-row: 2/-1;
grid-column: 1/-1;
}
@include breakpoint("mobile-extra-large") {
display: none;
}
}
p {
display: none;
}
}
.search-menu .search-input,
.search-menu-container .search-input {
background: var(--d-content-background);
border: 1px solid var(--search-color);
box-shadow: 0 4px 10px rgba(52, 6, 121, 15%);
}
.search-menu .search-input:focus-within,
.search-menu-container .search-input:focus-within {
border: 1px solid var(--search-color);
outline: 2px solid var(--search-color);
}
.search-menu .d-icon,
.search-menu .searching .d-icon,
.search-menu .searching .show-advanced-search .d-icon {
color: var(--search-color);
}
.panel-body {
z-index: z("dropdown");
}
.results {
background: var(--d-content-background);
}
&__title {
grid-column: 1/2;
grid-row: 1/-1;
text-align: left;
align-self: center;
margin: 0;
font-weight: 400;
color: var(--search-color);
@media screen and (max-width: 1028px) {
font-size: var(--font-up-4);
grid-column: 1/-1;
grid-row: 1;
text-align: center;
margin-bottom: 0.5em;
}
@media screen and (max-width: 768px) {
text-align: left;
grid-column: 1/2;
grid-row: 1/-1;
font-size: var(--font-up-3);
}
@media screen and (max-width: 600px) {
grid-column: 1/-1;
grid-row: 1;
text-align: center;
margin-bottom: 0.5em;
}
@include breakpoint("mobile-extra-large") {
font-size: var(--font-up-2);
}
}
}
-11
View File
@@ -1,11 +0,0 @@
enable_welcome_banner:
default: true
description: "Overrides the core `enable welcome banner` site setting"
search_experience:
type: enum
default: search_field
choices:
- search_field
- search_icon
description: "Overrides the core `search experience` site setting"
-54
View File
@@ -1,54 +0,0 @@
# frozen_string_literal: true
describe "Composer peek", type: :system do
fab!(:current_user) { Fabricate(:user, refresh_auto_groups: true) }
fab!(:topic) { Fabricate(:topic_with_op) }
let(:topic_page) { PageObjects::Pages::Topic.new }
let(:composer) { PageObjects::Components::Composer.new }
before do
upload_theme
sign_in(current_user)
end
it "does not show composer peek for small windows" do
topic_page.visit_topic(topic)
topic_page.click_footer_reply
expect(composer).to be_opened
resize_window(width: 600) { expect(page).to have_no_css(".peek-mode-toggle") }
end
it "turns on composer peek and remembers this preference on page load" do
topic_page.visit_topic(topic)
topic_page.click_footer_reply
expect(composer).to be_opened
resize_window(width: 1380) do
find(".peek-mode-toggle").click
expect(page).to have_css("body.peek-mode-active")
topic_page.visit_topic(topic)
topic_page.click_footer_reply
expect(composer).to be_opened
expect(page).to have_css("body.peek-mode-active")
find(".peek-mode-toggle").click
expect(page).to have_no_css("body.peek-mode-active")
end
end
it "hides the composer preview when toggling" do
topic_page.visit_topic(topic)
topic_page.click_footer_reply
expect(composer).to be_opened
expect(composer).to have_composer_preview
resize_window(width: 1380) do
find(".peek-mode-toggle").click
expect(page).to have_css("body.peek-mode-active")
expect(composer).to have_no_composer_preview
end
end
end
-22
View File
@@ -1,22 +0,0 @@
# frozen_string_literal: true
RSpec.describe "Core features", type: :system do
fab!(:current_user) { Fabricate(:user, refresh_auto_groups: true) }
let(:composer) { PageObjects::Components::Composer.new }
before { upload_theme_or_component }
it_behaves_like "having working core features",
skip_examples: %i[search:quick_search topics:create]
it "creates a new topic" do
sign_in(current_user)
visit("/new-topic")
composer.fill_title("This is a new topic")
composer.fill_content("This is a long enough sentence.")
expect(page).to have_css(".d-editor-preview p", visible: true)
within(".save-or-cancel") { click_button("Create Topic") }
expect(page).to have_content("This is a new topic")
expect(page).to have_content("This is a long enough sentence.")
end
end
-75
View File
@@ -1,75 +0,0 @@
# frozen_string_literal: true
require_relative "./page_objects/components/user_color_palette_selector"
describe "Horizon theme | High level", type: :system do
let!(:theme) do
horizon_theme = upload_theme
ColorScheme
.where(theme_id: horizon_theme.id)
.where.not("name LIKE '%Dark%'")
.update_all(user_selectable: true)
horizon_theme
end
fab!(:current_user) { Fabricate(:user) }
fab!(:tag_1) { Fabricate(:tag, name: "wow-cool") }
fab!(:tag_2) { Fabricate(:tag, name: "another-tag") }
fab!(:category)
fab!(:topic_1) { Fabricate(:topic_with_op, category: category, tags: [tag_1, tag_2]) }
let(:topic_list) { PageObjects::Components::TopicList.new }
let(:topic_page) { PageObjects::Pages::Topic.new }
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
let(:palette_selector) { PageObjects::Components::UserColorPaletteSelector.new }
def run_all_high_level_tests
expect(page).to have_css(".experimental-screen")
expect(sidebar).to have_categories_section
expect(sidebar).to have_section_link(category.name)
expect(topic_list).to have_topic(topic_1)
# Ensure the topic list columns are in the correct order via 'topic-list-columns' valueTransformer
#
# NOTE(martin): Maybe there is a better way to do this in a qunit test instead.
topic_item = find(topic_list.topic_list_item_class(topic_1))
expect(topic_item.all("td").map { |el| el["class"] }).to eq(
[
"main-link topic-list-data",
"topic-status-data",
"topic-category-data",
"topic-likes-replies-data",
"topic-activity-data",
],
)
# Can see a topic in the list and navigate to it successfully.
topic_list.visit_topic(topic_1)
expect(topic_page).to have_topic_title(topic_1.title)
# Can change site colors from the sidebar palette, which are remembered
# across page reloads.
marigold_palette = ColorScheme.find_by(name: "Marigold")
palette_selector.open_palette_menu
palette_selector.click_palette_menu_item(marigold_palette.name)
expect(palette_selector).to have_no_palette_menu
page.refresh
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_tertiary_color(marigold_palette)
end
it "works for anon" do
visit "/"
run_all_high_level_tests
end
context "for signed in users" do
before { sign_in(current_user) }
it "works" do
visit "/"
run_all_high_level_tests
end
end
end
@@ -1,53 +0,0 @@
# frozen_string_literal: true
module PageObjects
module Components
class UserColorPaletteSelector < PageObjects::Components::Base
def sidebar_footer_button_css
".sidebar-footer-actions .user-color-palette-selector"
end
def palette_menu
PageObjects::Components::DMenu.new(find(sidebar_footer_button_css))
end
def open_palette_menu
palette_menu.expand
end
def has_no_palette_menu?
has_no_css?(".user-color-palette-selector-content")
end
def click_palette_menu_item(palette_name)
find(
".user-color-palette-menu__content .user-color-palette-menu__item[data-color-palette='#{palette_name}']",
).click
end
def has_selected_palette?(palette)
has_css?(".user-color-palette-selector[data-selected-color-palette-id='#{palette.id}']")
end
def has_loaded_css?
has_css?(".user-color-palette-selector.user-color-palette-css-loaded")
end
def has_tertiary_color?(palette)
computed_color_hex =
page.evaluate_script(
"getComputedStyle(document.documentElement).getPropertyValue('--tertiary')",
)
computed_color_hex == "#" + palette.colors.find { |color| color.name == "tertiary" }.hex
end
def has_computed_color?(color)
computed_background_color =
page.evaluate_script(
"getComputedStyle(document.querySelector(\"li.sidebar-section-link-wrapper[data-list-item-name='everything'] .active\")).backgroundColor",
)
computed_background_color == color
end
end
end
end
-55
View File
@@ -1,55 +0,0 @@
# frozen_string_literal: true
RSpec.describe "Sidebar New Topic Button", system: true do
before { upload_theme }
fab!(:group)
fab!(:user) { Fabricate(:user, trust_level: 3, groups: [group]) }
fab!(:category)
fab!(:private_category) do
c = Fabricate(:category_with_definition)
c.set_permissions(group => :readonly)
c.save
c
end
context "for signed in users" do
before { sign_in(user) }
it "renders the new topic button in the sidebar" do
visit("/latest")
expect(page).to have_css(".sidebar-new-topic-button__wrapper")
expect(page).to have_css(".sidebar-new-topic-button:not(.disabled)")
end
it "opens the composer when clicked" do
visit("/")
find(".sidebar-new-topic-button").click
expect(page).to have_css("#reply-title")
end
it "shows draft menu when drafts exist" do
Draft.create!(user: user, draft_key: "topic_1", data: {})
visit("/")
expect(page).to have_css(".sidebar-new-topic-button__wrapper .topic-drafts-menu-trigger")
end
it "disables button when visiting read-only category" do
visit("/c/#{private_category.slug}/#{private_category.id}")
expect(page).to have_css(".sidebar-new-topic-button[disabled]")
visit("/c/#{category.slug}/#{category.id}")
expect(page).not_to have_css(".sidebar-new-topic-button[disabled]")
end
end
context "for anon" do
it "does not render the sidebar button for anons" do
visit("/latest")
expect(page).not_to have_css(".sidebar-new-topic-button__wrapper")
expect(page).not_to have_css(".sidebar-new-topic-button:not(.disabled)")
end
end
end
@@ -1,119 +0,0 @@
# frozen_string_literal: true
require_relative "./page_objects/components/user_color_palette_selector"
describe "Horizon theme | User color palette selector", type: :system do
let(:set_theme_as_default) { true }
let!(:theme) do
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
end
fab!(:current_user) { Fabricate(:user) }
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
let(:palette_selector) { PageObjects::Components::UserColorPaletteSelector.new }
let(:interface_color_mode) { PageObjects::Components::InterfaceColorMode.new }
let(:interface_color_selector) do
PageObjects::Components::InterfaceColorSelector.new(".sidebar-footer-actions")
end
let(:marigold_palette) { ColorScheme.find_by(name: "Marigold") }
let(:marigold_palette_dark) { ColorScheme.find_by(name: "Marigold Dark") }
before { SiteSetting.interface_color_selector = "sidebar_footer" }
it "does not show the sidebar button if there are no user-selectable color palettes" do
ColorScheme.update_all(user_selectable: false)
visit "/"
expect(page).to have_no_css(palette_selector.sidebar_footer_button_css)
end
describe "for logged in user" do
before { sign_in(current_user) }
it "can open the user color palette menu and select a palette, which is preseved on reload" do
visit "/"
palette_selector.open_palette_menu
palette_selector.click_palette_menu_item(marigold_palette.name)
expect(palette_selector).to have_no_palette_menu
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_loaded_css
expect(palette_selector).to have_tertiary_color(marigold_palette)
page.refresh
expect(palette_selector).to have_selected_palette(marigold_palette)
end
it "uses the dark version of the palette if the user selects dark mode" do
visit "/"
palette_selector.open_palette_menu
palette_selector.click_palette_menu_item(marigold_palette.name)
expect(palette_selector).to have_no_palette_menu
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_loaded_css
expect(palette_selector).to have_computed_color("oklch(0.92 0.0708528 68.5036)")
interface_color_selector.expand
interface_color_selector.dark_option.click
expect(interface_color_mode).to have_dark_mode_forced
expect(palette_selector).to have_computed_color("oklch(0.481966 0.0354264 68.5036)")
page.refresh
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_computed_color("oklch(0.481966 0.0354264 68.5036)")
end
context "when the theme is not default but is selected by a user" do
let(:set_theme_as_default) { false }
it "can open the user color palette menu and select a palette, which is preseved on reload" do
theme.update!(user_selectable: true)
current_user.user_option.update!(theme_ids: [theme.id])
visit "/"
palette_selector.open_palette_menu
palette_selector.click_palette_menu_item(marigold_palette.name)
expect(palette_selector).to have_no_palette_menu
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_loaded_css
expect(palette_selector).to have_tertiary_color(marigold_palette)
end
end
end
describe "for anon" do
it "can open the user color palette menu and select a palette, which is preseved on reload" do
visit "/"
palette_selector.open_palette_menu
palette_selector.click_palette_menu_item(marigold_palette.name)
expect(palette_selector).to have_no_palette_menu
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_loaded_css
expect(palette_selector).to have_tertiary_color(marigold_palette)
end
it "uses the dark version of the palette if the user selects dark mode, which is preserved on reload" do
visit "/"
palette_selector.open_palette_menu
palette_selector.click_palette_menu_item(marigold_palette.name)
expect(palette_selector).to have_no_palette_menu
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_loaded_css
expect(palette_selector).to have_computed_color("oklch(0.92 0.0708528 68.5036)")
interface_color_selector.expand
interface_color_selector.dark_option.click
expect(interface_color_mode).to have_dark_mode_forced
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_loaded_css
expect(palette_selector).to have_computed_color("oklch(0.481966 0.0354264 68.5036)")
page.refresh
expect(palette_selector).to have_selected_palette(marigold_palette)
expect(palette_selector).to have_computed_color("oklch(0.481966 0.0354264 68.5036)")
end
end
end