mirror of
https://github.com/discourse/discourse.git
synced 2025-02-01 10:18:48 +08:00
UX: Add icons to all section links in Sidebar (#18378)
This commit introduces an icon to all links in the sidebar. If an icon has not been configured, we will fall back to a generic "link" icon. As part of this commit, we also standardised the size of each prefix to 20px by 20px and set a fix margin. This is to allow sufficient space for text prefixes and image prefixes to be displayed. Tests have been intentionally left out for now as I don't feel like asserting for the icons will bring much value at this point. Time shall prove me wrong. Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
This commit is contained in:
parent
b6dfe5e394
commit
f1cbc23f1e
|
@ -8,6 +8,8 @@
|
||||||
@route={{sectionLink.route}}
|
@route={{sectionLink.route}}
|
||||||
@content={{sectionLink.text}}
|
@content={{sectionLink.text}}
|
||||||
@currentWhen={{sectionLink.currentWhen}}
|
@currentWhen={{sectionLink.currentWhen}}
|
||||||
|
@prefixType={{sectionLink.prefixType}}
|
||||||
|
@prefixValue={{sectionLink.prefixValue}}
|
||||||
@models={{sectionLink.models}} >
|
@models={{sectionLink.models}} >
|
||||||
</Sidebar::SectionLink>
|
</Sidebar::SectionLink>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
@ -2,4 +2,6 @@
|
||||||
@linkName="all-categories"
|
@linkName="all-categories"
|
||||||
@content={{i18n "sidebar.all_categories"}}
|
@content={{i18n "sidebar.all_categories"}}
|
||||||
@route="discovery.categories"
|
@route="discovery.categories"
|
||||||
|
@prefixType="icon"
|
||||||
|
@prefixValue="list"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -2,4 +2,6 @@
|
||||||
@linkName="all-tags"
|
@linkName="all-tags"
|
||||||
@content={{i18n "sidebar.all_tags"}}
|
@content={{i18n "sidebar.all_tags"}}
|
||||||
@route="tags"
|
@route="tags"
|
||||||
|
@prefixType="icon"
|
||||||
|
@prefixValue="list"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -22,7 +22,9 @@
|
||||||
@currentWhen={{sectionLink.currentWhen}}
|
@currentWhen={{sectionLink.currentWhen}}
|
||||||
@badgeText={{sectionLink.badgeText}}
|
@badgeText={{sectionLink.badgeText}}
|
||||||
@model={{sectionLink.model}}
|
@model={{sectionLink.model}}
|
||||||
@models={{sectionLink.models}} />
|
@models={{sectionLink.models}}
|
||||||
|
@prefixType={{sectionLink.prefixType}}
|
||||||
|
@prefixValue={{sectionLink.prefixValue}} />
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
<Sidebar::MoreSectionLinks @sectionLinks={{this.moreSectionLinks}} @secondarySectionLinks={{this.moreSecondarySectionLinks}} />
|
<Sidebar::MoreSectionLinks @sectionLinks={{this.moreSectionLinks}} @secondarySectionLinks={{this.moreSecondarySectionLinks}} />
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="panel-body-contents">
|
<div class="panel-body-contents">
|
||||||
<div class="sidebar-hamburger-dropdown">
|
<div class="sidebar-hamburger-dropdown">
|
||||||
<Sidebar::Sections @currentUser={{this.currentUser}} @collapsableSections={{false}} />
|
<Sidebar::Sections @currentUser={{this.currentUser}} @collapsableSections={{true}} />
|
||||||
<Sidebar::Footer @tagName="" />
|
<Sidebar::Footer @tagName="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,4 +8,6 @@
|
||||||
@currentWhen={{@sectionLink.currentWhen}}
|
@currentWhen={{@sectionLink.currentWhen}}
|
||||||
@badgeText={{@sectionLink.badgeText}}
|
@badgeText={{@sectionLink.badgeText}}
|
||||||
@model={{@sectionLink.model}}
|
@model={{@sectionLink.model}}
|
||||||
@models={{@sectionLink.models}} />
|
@models={{@sectionLink.models}}
|
||||||
|
@prefixType={{@sectionLink.prefixType}}
|
||||||
|
@prefixValue={{@sectionLink.prefixValue}} />
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
<details class="sidebar-more-section-links-details" {{on "toggle" this.toggleSectionLinks}}>
|
<details class="sidebar-more-section-links-details" {{on "toggle" this.toggleSectionLinks}}>
|
||||||
<summary class="sidebar-more-section-links-details-summary sidebar-row" >
|
<summary class="sidebar-more-section-links-details-summary sidebar-row" >
|
||||||
|
<span class="sidebar-more-section-links-icon-wrapper">
|
||||||
|
{{d-icon "ellipsis-v"}}
|
||||||
|
</span>
|
||||||
|
|
||||||
{{i18n "sidebar.more"}}
|
{{i18n "sidebar.more"}}
|
||||||
</summary>
|
</summary>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
{{#if @prefixValue}}
|
||||||
|
<span class={{concat-class "sidebar-section-link-prefix" @prefixType @prefixCSSClass}} style={{@prefixCSS}}>
|
||||||
|
{{#if (eq @prefixType "image")}}
|
||||||
|
<img src={{@prefixValue}} class="prefix-image">
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (eq @prefixType "text")}}
|
||||||
|
<span class="prefix-text">
|
||||||
|
{{@prefixValue}}
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (eq @prefixType "icon")}}
|
||||||
|
{{d-icon @prefixValue class="prefix-icon"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if @prefixBadge}}
|
||||||
|
{{d-icon @prefixBadge class="prefix-badge"}}
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
|
@ -0,0 +1,3 @@
|
||||||
|
import templateOnly from "@ember/component/template-only";
|
||||||
|
|
||||||
|
export default templateOnly();
|
|
@ -1,6 +1,14 @@
|
||||||
<div class="sidebar-section-link-wrapper">
|
<div class="sidebar-section-link-wrapper">
|
||||||
{{#if @href}}
|
{{#if @href}}
|
||||||
<a href={{@href}} rel="noopener noreferrer" target="_blank" class={{this.classNames}} title={{@title}}>
|
<a href={{@href}} rel="noopener noreferrer" target="_blank" class={{this.classNames}} title={{@title}}>
|
||||||
|
<Sidebar::SectionLinkPrefix
|
||||||
|
@prefixType={{@prefixType}}
|
||||||
|
@prefixValue={{@prefixValue}}
|
||||||
|
@prefixCSSClass={{@prefixCSSClass}}
|
||||||
|
@prefixCSS={{this.prefixCSS}}
|
||||||
|
@prefixBadge={{@prefixBadge}}
|
||||||
|
/>
|
||||||
|
|
||||||
<span class="sidebar-section-link-content-text">
|
<span class="sidebar-section-link-content-text">
|
||||||
{{@content}}
|
{{@content}}
|
||||||
</span>
|
</span>
|
||||||
|
@ -14,25 +22,14 @@
|
||||||
@current-when={{@currentWhen}}
|
@current-when={{@currentWhen}}
|
||||||
@title={{@title}}
|
@title={{@title}}
|
||||||
>
|
>
|
||||||
{{#if @prefixValue}}
|
|
||||||
<span class="sidebar-section-link-prefix {{@prefixType}} {{@prefixCSSClass}}" style={{this.prefixCSS}}>
|
|
||||||
{{#if (eq @prefixType "image")}}
|
|
||||||
<img src={{@prefixValue}} class="prefix-image">
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if (eq @prefixType "text")}}
|
<Sidebar::SectionLinkPrefix
|
||||||
{{@prefixValue}}
|
@prefixType={{@prefixType}}
|
||||||
{{/if}}
|
@prefixValue={{@prefixValue}}
|
||||||
|
@prefixCSSClass={{@prefixCSSClass}}
|
||||||
{{#if (eq @prefixType "icon")}}
|
@prefixCSS={{this.prefixCSS}}
|
||||||
{{d-icon @prefixValue class="prefix-icon"}}
|
@prefixBadge={{@prefixBadge}}
|
||||||
{{/if}}
|
/>
|
||||||
|
|
||||||
{{#if @prefixBadge}}
|
|
||||||
{{d-icon @prefixBadge class="prefix-badge"}}
|
|
||||||
{{/if}}
|
|
||||||
</span>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<span class="sidebar-section-link-content-text">
|
<span class="sidebar-section-link-content-text">
|
||||||
{{@content}}
|
{{@content}}
|
||||||
|
@ -45,7 +42,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if @suffixValue}}
|
{{#if @suffixValue}}
|
||||||
<span class="sidebar-section-link-suffix {{@suffixType}} {{@suffixCSSClass}}">
|
<span class={{concat-class "sidebar-section-link-suffix" @suffixType @suffixCSSClass}}>
|
||||||
{{#if (eq @suffixType "icon")}}
|
{{#if (eq @suffixType "icon")}}
|
||||||
{{d-icon @suffixValue}}
|
{{d-icon @suffixValue}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
<div class={{concat "sidebar-section-wrapper sidebar-section-" @sectionName}}>
|
<div class={{concat "sidebar-section-wrapper sidebar-section-" @sectionName}}>
|
||||||
<div class="sidebar-section-header-wrapper sidebar-row">
|
<div class="sidebar-section-header-wrapper sidebar-row">
|
||||||
<Sidebar::SectionHeader @collapsable={{@collapsable}} @toggleSectionDisplay={{this.toggleSectionDisplay}}>
|
<Sidebar::SectionHeader @collapsable={{@collapsable}} @toggleSectionDisplay={{this.toggleSectionDisplay}}>
|
||||||
<span class="sidebar-section-header-caret">
|
{{#if @collapsable}}
|
||||||
{{#if @collapsable}}
|
<span class="sidebar-section-header-caret">
|
||||||
{{d-icon this.headerCaretIcon}}
|
{{d-icon this.headerCaretIcon}}
|
||||||
{{/if}}
|
</span>
|
||||||
</span>
|
{{/if}}
|
||||||
|
|
||||||
<span class="sidebar-section-header-text">
|
<span class="sidebar-section-header-text">
|
||||||
{{@headerLinkText}}
|
{{@headerLinkText}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
@class={{personalMessageSectionLink.class}}
|
@class={{personalMessageSectionLink.class}}
|
||||||
@route={{personalMessageSectionLink.route}}
|
@route={{personalMessageSectionLink.route}}
|
||||||
@model={{personalMessageSectionLink.model}}
|
@model={{personalMessageSectionLink.model}}
|
||||||
|
@prefixType={{personalMessageSectionLink.prefixType}}
|
||||||
|
@prefixValue={{personalMessageSectionLink.prefixValue}}
|
||||||
@currentWhen={{personalMessageSectionLink.currentWhen}}
|
@currentWhen={{personalMessageSectionLink.currentWhen}}
|
||||||
@content={{personalMessageSectionLink.text}} />
|
@content={{personalMessageSectionLink.text}} />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -25,6 +27,8 @@
|
||||||
@linkName={{groupMessageSectionLink.name}}
|
@linkName={{groupMessageSectionLink.name}}
|
||||||
@class={{groupMessageSectionLink.class}}
|
@class={{groupMessageSectionLink.class}}
|
||||||
@route={{groupMessageSectionLink.route}}
|
@route={{groupMessageSectionLink.route}}
|
||||||
|
@prefixType={{groupMessageSectionLink.prefixType}}
|
||||||
|
@prefixValue={{groupMessageSectionLink.prefixValue}}
|
||||||
@models={{groupMessageSectionLink.models}}
|
@models={{groupMessageSectionLink.models}}
|
||||||
@currentWhen={{groupMessageSectionLink.currentWhen}}
|
@currentWhen={{groupMessageSectionLink.currentWhen}}
|
||||||
@content={{groupMessageSectionLink.text}} />
|
@content={{groupMessageSectionLink.text}} />
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
@title={{sectionLink.title}}
|
@title={{sectionLink.title}}
|
||||||
@content={{sectionLink.text}}
|
@content={{sectionLink.text}}
|
||||||
@currentWhen={{sectionLink.currentWhen}}
|
@currentWhen={{sectionLink.currentWhen}}
|
||||||
|
@prefixType={{sectionLink.prefixType}}
|
||||||
|
@prefixValue={{sectionLink.prefixValue}}
|
||||||
@badgeText={{sectionLink.badgeText}}
|
@badgeText={{sectionLink.badgeText}}
|
||||||
@models={{sectionLink.models}} >
|
@models={{sectionLink.models}} >
|
||||||
</Sidebar::SectionLink>
|
</Sidebar::SectionLink>
|
||||||
|
|
|
@ -93,6 +93,20 @@ export default class BaseCommunitySectionLink {
|
||||||
*/
|
*/
|
||||||
get badgeText() {}
|
get badgeText() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
get prefixType() {
|
||||||
|
return "icon";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {string} The name of the fontawesome icon to be displayed before the link. Defaults to "link".
|
||||||
|
*/
|
||||||
|
get prefixValue() {
|
||||||
|
return "link";
|
||||||
|
}
|
||||||
|
|
||||||
_notImplemented() {
|
_notImplemented() {
|
||||||
throw "not implemented";
|
throw "not implemented";
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,7 @@ export default class AboutSectionLink extends BaseSectionLink {
|
||||||
get text() {
|
get text() {
|
||||||
return I18n.t("sidebar.sections.community.links.about.content");
|
return I18n.t("sidebar.sections.community.links.about.content");
|
||||||
}
|
}
|
||||||
|
get prefixValue() {
|
||||||
|
return "info-circle";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,8 @@ export default class BadgesSectionLink extends BaseSectionLink {
|
||||||
get shouldDisplay() {
|
get shouldDisplay() {
|
||||||
return this.siteSettings.enable_badges;
|
return this.siteSettings.enable_badges;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "certificate";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,4 +71,8 @@ export default class EverythingSectionLink extends BaseSectionLink {
|
||||||
return "discovery.latest";
|
return "discovery.latest";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "layer-group";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,8 @@ export default class FAQSectionLink extends BaseSectionLink {
|
||||||
get text() {
|
get text() {
|
||||||
return I18n.t("sidebar.sections.community.links.faq.content");
|
return I18n.t("sidebar.sections.community.links.faq.content");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "question-circle";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,8 @@ export default class GroupsSectionLink extends BaseSectionLink {
|
||||||
get shouldDisplay() {
|
get shouldDisplay() {
|
||||||
return this.siteSettings.enable_group_directory;
|
return this.siteSettings.enable_group_directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "user-friends";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,8 @@ export default class UsersSectionLink extends BaseSectionLink {
|
||||||
(this.currentUser || !this.siteSettings.hide_user_profiles_from_public)
|
(this.currentUser || !this.siteSettings.hide_user_profiles_from_public)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "users";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,8 @@ export default class AdminSectionLink extends BaseSectionLink {
|
||||||
get shouldDisplay() {
|
get shouldDisplay() {
|
||||||
return this.currentUser?.staff;
|
return this.currentUser?.staff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "wrench";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,4 +62,8 @@ export default class MyPostsSectionLink extends BaseSectionLink {
|
||||||
get _hasDraft() {
|
get _hasDraft() {
|
||||||
return this.draftCount > 0;
|
return this.draftCount > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "user";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,8 @@ export default class TrackedSectionLink extends BaseSectionLink {
|
||||||
return "discovery.latest";
|
return "discovery.latest";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "bell";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,4 +71,16 @@ export default class MessageSectionLink {
|
||||||
get _shouldTrack() {
|
get _shouldTrack() {
|
||||||
return this.type === NEW || this.type === UNREAD;
|
return this.type === NEW || this.type === UNREAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixType() {
|
||||||
|
if (this._isInbox) {
|
||||||
|
return "icon";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
if (this._isInbox) {
|
||||||
|
return "inbox";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,4 +64,12 @@ export default class TagSectionLink {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get prefixType() {
|
||||||
|
return "icon";
|
||||||
|
}
|
||||||
|
|
||||||
|
get prefixValue() {
|
||||||
|
return "tag";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -683,7 +683,7 @@ table {
|
||||||
}
|
}
|
||||||
|
|
||||||
#main-outlet {
|
#main-outlet {
|
||||||
padding-top: 2.5em;
|
padding-top: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main {
|
#main {
|
||||||
|
|
|
@ -12,9 +12,18 @@
|
||||||
list-style: none;
|
list-style: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.d-icon {
|
.sidebar-more-section-links-icon-wrapper {
|
||||||
margin-left: auto;
|
display: flex;
|
||||||
color: var(--primary-medium);
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: var(--d-sidebar-section-link-prefix-width);
|
||||||
|
height: var(--d-sidebar-section-link-prefix-width);
|
||||||
|
margin-right: var(--d-sidebar-section-link-prefix-margin-right);
|
||||||
|
|
||||||
|
.d-icon {
|
||||||
|
color: var(--primary-medium);
|
||||||
|
font-size: var(--font-down-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
|
@ -35,7 +44,7 @@
|
||||||
margin: 0 calc(var(--d-sidebar-row-horizontal-padding) * 2 / 3);
|
margin: 0 calc(var(--d-sidebar-row-horizontal-padding) * 2 / 3);
|
||||||
|
|
||||||
.sidebar-row {
|
.sidebar-row {
|
||||||
padding: calc(var(--d-sidebar-row-horizontal-padding) / 3);
|
padding: 0.33rem calc(var(--d-sidebar-row-horizontal-padding) / 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
|
:root {
|
||||||
|
--d-sidebar-section-link-prefix-margin-right: 0.4rem;
|
||||||
|
--d-sidebar-section-link-prefix-width: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar-section-link-wrapper {
|
.sidebar-section-link-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.sidebar-section-link {
|
.sidebar-section-link {
|
||||||
box-sizing: border-box;
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -19,8 +23,13 @@
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
font-weight: bold;
|
|
||||||
background: var(--d-sidebar-highlight-color);
|
background: var(--d-sidebar-highlight-color);
|
||||||
|
|
||||||
|
.sidebar-section-link-prefix {
|
||||||
|
&.icon {
|
||||||
|
color: var(--primary-high);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-section-link-content-badge {
|
.sidebar-section-link-content-badge {
|
||||||
|
@ -67,7 +76,10 @@
|
||||||
.sidebar-section-link-group-messages-unread,
|
.sidebar-section-link-group-messages-unread,
|
||||||
.sidebar-section-link-group-messages-archive {
|
.sidebar-section-link-group-messages-archive {
|
||||||
.sidebar-section-link-content-text {
|
.sidebar-section-link-content-text {
|
||||||
margin-left: 0.5em;
|
margin-left: calc(
|
||||||
|
var(--d-sidebar-section-link-prefix-margin-right) +
|
||||||
|
var(--d-sidebar-section-link-prefix-width)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,45 +90,46 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-section-link-prefix {
|
.sidebar-section-link-prefix {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
width: var(--d-sidebar-section-link-prefix-width);
|
||||||
|
height: var(--d-sidebar-section-link-prefix-width);
|
||||||
|
margin-right: var(--d-sidebar-section-link-prefix-margin-right);
|
||||||
|
|
||||||
&.image {
|
&.image {
|
||||||
position: absolute;
|
|
||||||
img {
|
img {
|
||||||
border-radius: 50%;
|
border-radius: 100%;
|
||||||
width: 20px;
|
|
||||||
aspect-ratio: auto 20 / 20;
|
aspect-ratio: auto 20 / 20;
|
||||||
height: 20px;
|
width: calc(var(--d-sidebar-section-link-prefix-width) - 2px);
|
||||||
margin-right: 0.5em;
|
height: calc(var(--d-sidebar-section-link-prefix-width) - 2px);
|
||||||
}
|
|
||||||
|
|
||||||
+ .sidebar-section-link-content-text {
|
|
||||||
margin-left: calc(20px + 0.5em);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.text {
|
&.text {
|
||||||
border-radius: 100%;
|
|
||||||
background: rgba(var(--primary-rgb), 0.1);
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: var(--font-down-1);
|
|
||||||
padding: 0.27em 0.47em;
|
.prefix-text {
|
||||||
margin-right: 0.25em;
|
display: flex;
|
||||||
position: absolute;
|
align-items: center;
|
||||||
+ .sidebar-section-link-content-text {
|
justify-content: center;
|
||||||
margin-left: calc(20px + 0.5em);
|
border-radius: 100%;
|
||||||
|
background: rgba(var(--primary-rgb), 0.1);
|
||||||
|
width: calc(var(--d-sidebar-section-link-prefix-width) - 2px);
|
||||||
|
height: calc(var(--d-sidebar-section-link-prefix-width) - 2px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.icon {
|
&.icon {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-right: 0.5em;
|
color: var(--primary-medium);
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
font-size: var(--font-down-1);
|
font-size: var(--font-down-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
svg.prefix-badge {
|
.prefix-badge {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
@ -126,7 +139,7 @@
|
||||||
width: 0.5rem;
|
width: 0.5rem;
|
||||||
top: -0.2em;
|
top: -0.2em;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin-right: -0.6em;
|
margin-right: -0.2em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,51 @@
|
||||||
|
:root {
|
||||||
|
--d-sidebar-section-header-text-font-size: var(--font-up-1);
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar-section-wrapper {
|
.sidebar-section-wrapper {
|
||||||
|
.discourse-no-touch & {
|
||||||
|
&:hover {
|
||||||
|
.sidebar-section-header-wrapper {
|
||||||
|
.btn.dropdown-select-box-header,
|
||||||
|
.sidebar-section-header-button {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar-section-header-wrapper {
|
.sidebar-section-header-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 0;
|
|
||||||
.discourse-no-touch & {
|
.discourse-no-touch & {
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--d-sidebar-highlight-color);
|
background: var(--d-sidebar-highlight-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus-within {
|
&:focus-within {
|
||||||
background: var(--d-sidebar-highlight-color);
|
background: var(--d-sidebar-highlight-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn.dropdown-select-box-header,
|
.btn.dropdown-select-box-header,
|
||||||
.sidebar-section-header-button {
|
.sidebar-section-header-button {
|
||||||
|
.discourse-no-touch & {
|
||||||
|
transition: all 0.25s;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
|
margin-right: calc(var(--d-sidebar-row-horizontal-padding) / 3 * -1);
|
||||||
padding: calc(var(--d-sidebar-row-horizontal-padding) / 5)
|
padding: calc(var(--d-sidebar-row-horizontal-padding) / 5)
|
||||||
calc(var(--d-sidebar-row-horizontal-padding) / 3);
|
calc(var(--d-sidebar-row-horizontal-padding) / 3);
|
||||||
margin-right: calc(var(--d-sidebar-row-horizontal-padding) / 1.5);
|
|
||||||
.d-icon {
|
.d-icon {
|
||||||
font-size: var(--font-down-1);
|
font-size: var(--font-down-1);
|
||||||
color: var(--primary-medium);
|
color: var(--primary-medium);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
background: var(--primary-medium);
|
background: var(--primary-medium);
|
||||||
|
@ -31,6 +53,7 @@
|
||||||
color: var(--primary-very-low);
|
color: var(--primary-very-low);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.discourse-no-touch & {
|
.discourse-no-touch & {
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--primary-medium);
|
background: var(--primary-medium);
|
||||||
|
@ -44,16 +67,10 @@
|
||||||
|
|
||||||
.sidebar-section-header {
|
.sidebar-section-header {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: var(--font-1);
|
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: calc(var(--d-sidebar-row-horizontal-padding) / 2)
|
|
||||||
calc(var(--d-sidebar-row-horizontal-padding) / 2)
|
|
||||||
calc(var(--d-sidebar-row-horizontal-padding) / 2)
|
|
||||||
var(--d-sidebar-row-horizontal-padding);
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
&.sidebar-section-header-collapsable {
|
&.sidebar-section-header-collapsable {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
@ -61,18 +78,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-section-header-text {
|
.sidebar-section-header-text {
|
||||||
font-weight: bold;
|
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
margin-right: 0.25em;
|
margin-right: 0.25em;
|
||||||
|
font-size: var(--d-sidebar-section-header-text-font-size);
|
||||||
@include ellipsis;
|
@include ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-section-header-caret {
|
.sidebar-section-header-caret {
|
||||||
display: block;
|
display: flex;
|
||||||
width: 1.5em;
|
|
||||||
margin-left: -1.5em;
|
|
||||||
font-size: var(--font-down-2);
|
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
width: var(--d-sidebar-section-link-prefix-width);
|
||||||
|
height: var(--d-sidebar-section-link-prefix-width);
|
||||||
|
margin-right: var(--d-sidebar-section-link-prefix-margin-right);
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
svg {
|
||||||
|
font-size: var(--font-down-1);
|
||||||
|
color: var(--primary-medium);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-kit-collection {
|
.select-kit-collection {
|
||||||
|
@ -93,9 +117,12 @@
|
||||||
|
|
||||||
.sidebar-section-message {
|
.sidebar-section-message {
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
|
padding-left: 1.4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-section-content {
|
.sidebar-section-content {
|
||||||
|
padding-bottom: 1em;
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
margin: 0em 1.5em;
|
margin: 0em 1.5em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,26 @@
|
||||||
--d-sidebar-width: #{$d-sidebar-width};
|
--d-sidebar-width: #{$d-sidebar-width};
|
||||||
--d-sidebar-animation-time: 0.25s;
|
--d-sidebar-animation-time: 0.25s;
|
||||||
--d-sidebar-animation-ease: ease-in-out;
|
--d-sidebar-animation-ease: ease-in-out;
|
||||||
|
--d-sidebar-row-height: 30px;
|
||||||
|
// 1.25rem gets text left-aligned with the hamburger icon
|
||||||
|
--d-sidebar-row-horizontal-padding: 1.25rem;
|
||||||
|
--d-sidebar-row-vertical-padding: 0.33rem;
|
||||||
|
--d-sidebar-row-font-size: var(--font-down-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-row {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: var(--d-sidebar-row-height);
|
||||||
|
padding: var(--d-sidebar-row-vertical-padding)
|
||||||
|
var(--d-sidebar-row-horizontal-padding);
|
||||||
|
align-items: center;
|
||||||
|
font-size: var(--d-sidebar-row-font-size);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-wrapper {
|
.sidebar-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
--d-sidebar-highlight-color: var(--primary-low);
|
--d-sidebar-highlight-color: var(--primary-low);
|
||||||
// 1.25rem gets text left-aligned with the hamburger icon
|
background-color: var(--primary-50);
|
||||||
--d-sidebar-row-horizontal-padding: 1.25rem;
|
|
||||||
background-color: var(--primary-very-low);
|
|
||||||
grid-area: sidebar;
|
grid-area: sidebar;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: var(--header-offset);
|
top: var(--header-offset);
|
||||||
|
@ -21,12 +33,6 @@
|
||||||
align-self: start;
|
align-self: start;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
.sidebar-row {
|
|
||||||
padding: 0.33rem var(--d-sidebar-row-horizontal-padding);
|
|
||||||
align-items: center;
|
|
||||||
font-size: var(--font-down-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -44,7 +50,7 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 1em 0;
|
padding: 1.5em 0 1em;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: overlay;
|
overflow-y: overlay;
|
||||||
|
|
||||||
|
@ -83,17 +89,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-hamburger-dropdown {
|
.sidebar-hamburger-dropdown {
|
||||||
// note that these apply to mobile and desktop dropdowns
|
|
||||||
.sidebar-section-wrapper {
|
|
||||||
.sidebar-section-header-wrapper.sidebar-row {
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar-section-header {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.discourse-no-touch & {
|
.discourse-no-touch & {
|
||||||
.sidebar-section-wrapper .sidebar-section-header-wrapper:hover,
|
.sidebar-section-wrapper .sidebar-section-header-wrapper:hover,
|
||||||
.sidebar-section-wrapper .sidebar-section-header-wrapper:focus-within {
|
.sidebar-section-wrapper .sidebar-section-header-wrapper:focus-within {
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
@import "menu-panel";
|
@import "menu-panel";
|
||||||
@import "modal";
|
@import "modal";
|
||||||
@import "new-user";
|
@import "new-user";
|
||||||
@import "sidebar-section";
|
|
||||||
@import "topic-list";
|
@import "topic-list";
|
||||||
@import "topic-post";
|
@import "topic-post";
|
||||||
@import "topic";
|
@import "topic";
|
||||||
|
|
|
@ -195,7 +195,7 @@ body.has-sidebar-page {
|
||||||
|
|
||||||
#main-outlet-wrapper {
|
#main-outlet-wrapper {
|
||||||
grid-template-columns: var(--d-sidebar-width) minmax(0, 1fr);
|
grid-template-columns: var(--d-sidebar-width) minmax(0, 1fr);
|
||||||
gap: 0 1em;
|
gap: 0 2em;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,14 +13,10 @@
|
||||||
.hamburger-panel .revamped {
|
.hamburger-panel .revamped {
|
||||||
--d-sidebar-highlight-color: var(--highlight-medium);
|
--d-sidebar-highlight-color: var(--highlight-medium);
|
||||||
--d-sidebar-row-horizontal-padding: 0.5rem;
|
--d-sidebar-row-horizontal-padding: 0.5rem;
|
||||||
width: var(--d-sidebar-width);
|
--d-sidebar-row-height: 30px;
|
||||||
|
// 1.25rem gets text left-aligned with the hamburger icon
|
||||||
.sidebar-row {
|
--d-sidebar-row-horizontal-padding: 0.66rem;
|
||||||
padding: 0.25rem var(--d-sidebar-row-horizontal-padding);
|
--d-sidebar-row-vertical-padding: 0.33rem;
|
||||||
height: 27px;
|
|
||||||
align-items: center;
|
|
||||||
font-size: var(--font-down-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-body-content {
|
.panel-body-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
#main-outlet-wrapper {
|
|
||||||
.sidebar-section-wrapper {
|
|
||||||
.sidebar-section-header-button,
|
|
||||||
.sidebar-section-header-caret,
|
|
||||||
.sidebar-section-header-dropdown {
|
|
||||||
.discourse-no-touch & {
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.25s;
|
|
||||||
transition-delay: 0.25s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.discourse-no-touch & {
|
|
||||||
&:focus-within,
|
|
||||||
&:hover {
|
|
||||||
.sidebar-section-header-button,
|
|
||||||
.sidebar-section-header-caret,
|
|
||||||
.sidebar-section-header-dropdown {
|
|
||||||
opacity: 1;
|
|
||||||
transition-delay: 0s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -72,6 +72,9 @@
|
||||||
.hamburger-panel .revamped {
|
.hamburger-panel .revamped {
|
||||||
--d-sidebar-row-horizontal-padding: 1rem;
|
--d-sidebar-row-horizontal-padding: 1rem;
|
||||||
--d-sidebar-highlight-color: var(--primary-low);
|
--d-sidebar-highlight-color: var(--primary-low);
|
||||||
|
--d-sidebar-row-font-size: var(--font-0);
|
||||||
|
--d-sidebar-row-height: 32px;
|
||||||
|
--d-sidebar-section-header-text-font-size: var(--font-0);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
|
@ -79,18 +82,23 @@
|
||||||
.sidebar-hamburger-dropdown {
|
.sidebar-hamburger-dropdown {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
padding-top: 0.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-row {
|
.sidebar-row {
|
||||||
padding: 1.2rem var(--d-sidebar-row-horizontal-padding);
|
&.sidebar-section-message-wrapper {
|
||||||
height: 27px;
|
padding-top: 0;
|
||||||
align-items: center;
|
padding-bottom: 0.25em;
|
||||||
font-size: var(--font-0);
|
}
|
||||||
|
|
||||||
|
.sidebar-section-message {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-section-wrapper {
|
.sidebar-section-wrapper {
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 1.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-footer-wrapper {
|
.sidebar-footer-wrapper {
|
||||||
|
@ -112,4 +120,8 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-section-content {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,6 +139,7 @@ module SvgSprite
|
||||||
"hourglass-start",
|
"hourglass-start",
|
||||||
"id-card",
|
"id-card",
|
||||||
"image",
|
"image",
|
||||||
|
"inbox",
|
||||||
"info-circle",
|
"info-circle",
|
||||||
"italic",
|
"italic",
|
||||||
"key",
|
"key",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user