UX: Use full width when displaying a single recommendations list. (#22896)

This commit is contained in:
Roman Rizzi 2023-08-01 00:49:24 -03:00 committed by GitHub
parent 6a9726e252
commit dd8d89d9c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 15 deletions

View File

@ -1,6 +1,5 @@
<div <div
class="more-content-wrapper class="more-content-wrapper {{if this.singleList 'single-list'}}"
{{if this.showTitleOnMobile 'mobile-single-list'}}"
{{did-insert this.buildListPills}} {{did-insert this.buildListPills}}
> >
{{#if this.showTopicListsNav}} {{#if this.showTopicListsNav}}

View File

@ -15,10 +15,6 @@ export default class MoreTopics extends Component {
return this.site.mobileView && !this.singleList; return this.site.mobileView && !this.singleList;
} }
get showTitleOnMobile() {
return this.site.mobileView && this.singleList;
}
@action @action
rememberTopicListPreference(value) { rememberTopicListPreference(value) {
this.moreTopicsPreferenceTracking.updatePreference(value); this.moreTopicsPreferenceTracking.updatePreference(value);
@ -28,10 +24,6 @@ export default class MoreTopics extends Component {
@action @action
buildListPills() { buildListPills() {
if (!this.site.mobileView) {
return;
}
next(() => { next(() => {
const pills = Array.from( const pills = Array.from(
document.querySelectorAll(".more-content-topics") document.querySelectorAll(".more-content-topics")
@ -44,6 +36,9 @@ export default class MoreTopics extends Component {
if (pills.length <= 1) { if (pills.length <= 1) {
this.singleList = true; this.singleList = true;
}
if (this.singleList || !this.site.mobileView) {
return; return;
} }

View File

@ -368,10 +368,6 @@ a.badge-category {
max-width: 757px; max-width: 757px;
} }
.more-content-wrapper .topic-list-body .topic-list-data:first-of-type {
padding-left: 0;
}
// Target the .badge-category text, the bullet icon needs to maintain `display: block` // Target the .badge-category text, the bullet icon needs to maintain `display: block`
.more-content-topics h3 .badge-wrapper.bullet span.badge-category, .more-content-topics h3 .badge-wrapper.bullet span.badge-category,
.more-content-topics h3 .badge-wrapper.box span, .more-content-topics h3 .badge-wrapper.box span,

View File

@ -362,6 +362,12 @@ pre.codeblock-buttons:hover {
} }
} }
.more-content-wrapper.single-list {
.more-content-topics {
width: 100%;
}
}
.more-content-topics { .more-content-topics {
margin-top: 2em; margin-top: 2em;

View File

@ -138,6 +138,7 @@
.more-content-wrapper { .more-content-wrapper {
display: flex; display: flex;
justify-content: space-around;
.topic-list-header, .topic-list-header,
.posts-map, .posts-map,
@ -148,6 +149,10 @@
.topic-list-body { .topic-list-body {
border-top: none; border-top: none;
.topic-list-item {
padding-left: 5px;
}
.topic-list-item:last-of-type { .topic-list-item:last-of-type {
border-bottom: none; border-bottom: none;
} }

View File

@ -253,11 +253,15 @@ a.reply-to-tab {
} }
.more-content-wrapper { .more-content-wrapper {
&:not(.mobile-single-list) { &:not(.single-list) {
.more-topics-title { .more-topics-title {
display: none; display: none;
} }
} }
.topic-list-data {
padding-left: 5px;
}
} }
.more-content-topics { .more-content-topics {