b72a3c1e95
This is the second iteration on the topic card design, in which we bring
back the OP and change the layout.
**Changes**:
* Show OP avatar
* Remove activity avatar and replace by reply icon
* Remove activity icon background
* Move category tag to top left
* Replace long activity copy ("…replied at…") with dot separator
* Change date formatting to `tiny`
* Adjust bulk select styling to new layout + align checkbox to top on
mobile VS keep centred on desktop
* Why: On desktop, the avatar is taking 2 lines (usually) and aligning
the checkbox vertically looks nice. Exception for excerpts, but since
that's only available for pinned topics atm that's a low occurrence. On
mobile, the topic card is 3 lines, with a smaller avatar, which makes
the checkbox "float" around a bit when centred. Hence aligning it to the
top, which for solid avatars aligns nicely too.
* CSS refactor: grid, breakpoints
Messages/bookmarks have not been changed.
| Description | Visual |
|--------|--------|
| Large topic list | |
| Large bulk edit | 
|
| Medium topic list | 
|
| Medium bulk edit | 
|
| Small topic list | 
|
| Small bulk edit | 
|
| Messages page (remains unchanged) | 
|
| Bookmark page (remains unchanged) | 
|
655 lines
14 KiB
SCSS
655 lines
14 KiB
SCSS
@use "lib/viewport";
|
|
|
|
.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 {
|
|
border: none;
|
|
display: flex;
|
|
flex-direction: column;
|
|
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 {
|
|
position: relative;
|
|
background: var(--d-content-background);
|
|
box-shadow: 0 0 12px 1px var(--topic-card-shadow);
|
|
text-overflow: ellipsis;
|
|
padding: 0.75em 1rem;
|
|
border: 1px solid var(--primary-300);
|
|
display: grid;
|
|
grid-template-columns: min-content min-content auto min-content;
|
|
grid-template-areas:
|
|
"creator title title status"
|
|
"creator category activity likes-replies";
|
|
grid-column-gap: 0.75rem;
|
|
grid-row-gap: 0.5rem;
|
|
border-radius: var(--d-border-radius);
|
|
cursor: pointer;
|
|
|
|
.bulk-select-enabled & {
|
|
grid-template-columns: min-content min-content min-content auto min-content;
|
|
grid-template-areas:
|
|
"bulk-select creator title title status"
|
|
"bulk-select creator category activity likes-replies";
|
|
}
|
|
|
|
@include viewport.until(sm) {
|
|
grid-template-areas:
|
|
"category category category status"
|
|
"creator title title title"
|
|
"activity activity activity likes-replies";
|
|
row-gap: 0.75em;
|
|
border: none;
|
|
border-bottom: 1px solid var(--primary-200);
|
|
box-shadow: none;
|
|
border-radius: 0;
|
|
}
|
|
|
|
&:hover {
|
|
.discourse-no-touch & {
|
|
border-color: var(--accent-color);
|
|
background: var(--d-content-background);
|
|
}
|
|
}
|
|
|
|
&.selected {
|
|
box-shadow:
|
|
0 0 0 2px var(--accent-color),
|
|
0 0 12px 1px var(--topic-card-shadow);
|
|
}
|
|
|
|
&.excerpt-expanded {
|
|
@include viewport.until(sm) {
|
|
.topic-excerpt,
|
|
.link-bottom-line {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
@include viewport.from(sm) {
|
|
grid-template-areas:
|
|
"creator title title status"
|
|
"creator category activity likes-replies "
|
|
"creator excerpt excerpt excerpt";
|
|
|
|
.bulk-select-enabled & {
|
|
grid-template-areas:
|
|
"bulk-select creator title title status"
|
|
"bulk-select creator category activity likes-replies "
|
|
" bulk-select creator excerpt excerpt excerpt";
|
|
}
|
|
}
|
|
|
|
// when there is enough space, excerpt can be next to likes-replies
|
|
@include viewport.from(lg) {
|
|
grid-template-areas:
|
|
"creator title title status"
|
|
"creator category activity ."
|
|
"creator excerpt excerpt likes-replies";
|
|
}
|
|
}
|
|
|
|
.link-top-line {
|
|
grid-area: title;
|
|
font-weight: 500;
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.title {
|
|
padding: 0;
|
|
}
|
|
}
|
|
|
|
// display contents
|
|
td.main-link,
|
|
td.posters,
|
|
td.posts,
|
|
td.views,
|
|
td.activity,
|
|
td.topic-category-status-data {
|
|
display: contents;
|
|
}
|
|
|
|
td.num.posts a {
|
|
padding: 0;
|
|
}
|
|
|
|
// display:nones
|
|
td.main-link a.topic-status,
|
|
.link-bottom-line,
|
|
.badge-notification.new-topic::before {
|
|
display: none;
|
|
}
|
|
|
|
.topic-category-data {
|
|
grid-area: category;
|
|
display: flex;
|
|
}
|
|
|
|
.badge-category__wrapper {
|
|
border-radius: var(--d-border-radius);
|
|
padding: 0.25em 0.5rem;
|
|
background-color: light-dark(
|
|
oklch(from var(--category-badge-color) 97% calc(c * 0.3) h),
|
|
oklch(from var(--category-badge-color) 45% calc(c * 0.5) h)
|
|
);
|
|
|
|
@include breakpoint(tablet) {
|
|
padding: 0.25em 0.5rem;
|
|
font-size: var(--font-down-2);
|
|
}
|
|
|
|
.badge-category__name {
|
|
color: light-dark(
|
|
oklch(from var(--category-badge-color) 20% calc(c * 1) h),
|
|
oklch(from var(--category-badge-color) 100% calc(c * 0.9) h)
|
|
);
|
|
}
|
|
}
|
|
|
|
// OP avatar
|
|
.topic-creator-data {
|
|
grid-area: creator;
|
|
|
|
.avatar {
|
|
height: 50px;
|
|
width: 50px;
|
|
border-radius: var(--d-border-radius);
|
|
|
|
@include viewport.until(sm) {
|
|
height: 30px;
|
|
width: 30px;
|
|
border-radius: 0.25rem;
|
|
}
|
|
}
|
|
}
|
|
|
|
.dot-separator {
|
|
width: 0.25em;
|
|
height: 0.25em;
|
|
background-color: var(--primary-500);
|
|
border-radius: 100%;
|
|
margin-inline: 0.25em;
|
|
}
|
|
|
|
// topic activity, icon, text
|
|
.topic-activity-data {
|
|
@include ellipsis;
|
|
grid-area: activity;
|
|
}
|
|
|
|
.topic-activity {
|
|
display: flex;
|
|
font-size: var(--font-down-1);
|
|
height: 100%;
|
|
align-items: center;
|
|
gap: 0.25em;
|
|
}
|
|
|
|
.topic-activity__type {
|
|
border-radius: 0.25rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.topic-activity__username {
|
|
@include ellipsis;
|
|
margin-left: 0.25em;
|
|
}
|
|
|
|
// timestamp
|
|
td.activity .post-activity {
|
|
grid-area: activity;
|
|
font-size: var(--font-down-1);
|
|
color: var(--primary-500);
|
|
margin-left: auto;
|
|
padding: 0;
|
|
}
|
|
|
|
// status
|
|
.topic-status-data {
|
|
grid-area: status;
|
|
}
|
|
|
|
.topic-status-card {
|
|
height: min-content;
|
|
margin-left: auto;
|
|
display: flex;
|
|
flex-direction: row;
|
|
gap: 0.25em;
|
|
align-items: center;
|
|
padding: 0.2em 0.5rem;
|
|
font-size: var(--font-down-3);
|
|
font-weight: 600;
|
|
border-radius: var(--d-border-radius);
|
|
border: 1px solid var(--status-color);
|
|
color: var(--status-color);
|
|
width: min-content;
|
|
|
|
&.--pinned {
|
|
--status-color: var(--primary-500);
|
|
}
|
|
|
|
&.--hot {
|
|
--status-color: #e45735;
|
|
}
|
|
|
|
@include viewport.from(lg) {
|
|
position: absolute;
|
|
right: 1rem;
|
|
top: 0;
|
|
transform: translateY(-45%);
|
|
background-color: var(--d-content-background);
|
|
}
|
|
|
|
svg {
|
|
font-size: var(--font-down-1);
|
|
color: var(--status-color);
|
|
}
|
|
}
|
|
|
|
.link-top-line .event-date {
|
|
margin-left: 0.5em;
|
|
font-size: var(--font-down-3);
|
|
}
|
|
|
|
.topic-list-data {
|
|
padding: 0;
|
|
}
|
|
|
|
.topic-post-badges .badge-notification.unread-posts,
|
|
.topic-post-badges .badge-notification.new-topic {
|
|
background-color: var(--tertiary);
|
|
color: var(--tertiary);
|
|
overflow: hidden;
|
|
height: 8px;
|
|
width: 8px;
|
|
padding: 0;
|
|
top: -2px;
|
|
min-width: unset;
|
|
}
|
|
|
|
// metadata - excerpt
|
|
.topic-excerpt {
|
|
grid-area: excerpt;
|
|
margin: 0;
|
|
padding: 0;
|
|
font-size: var(--font-down-2);
|
|
width: 100%;
|
|
|
|
.excerpt__contents {
|
|
color: var(--primary-high);
|
|
}
|
|
|
|
// default category position hidden
|
|
.badge-category__wrapper {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
td.main-link .discourse-tags {
|
|
display: none;
|
|
}
|
|
|
|
// metadata - likes and replies
|
|
td.posts .badge-posts {
|
|
grid-area: replies;
|
|
align-self: center;
|
|
font-weight: normal;
|
|
}
|
|
|
|
td.topic-likes-replies-data {
|
|
grid-area: likes-replies;
|
|
display: flex;
|
|
flex-direction: row;
|
|
gap: 0.5em;
|
|
justify-content: flex-end;
|
|
height: min-content;
|
|
align-self: center;
|
|
}
|
|
|
|
.topic-likes-replies-data .topic-likes,
|
|
.topic-likes-replies-data .topic-replies {
|
|
display: flex;
|
|
flex-direction: row;
|
|
gap: 0.5em;
|
|
align-items: center;
|
|
color: var(--primary-500);
|
|
font-size: var(--font-down-1-rem);
|
|
|
|
svg {
|
|
color: var(--primary-600);
|
|
}
|
|
}
|
|
|
|
.bulk-select {
|
|
grid-area: bulk-select;
|
|
padding: 0;
|
|
margin: 0;
|
|
align-self: center;
|
|
justify-self: center;
|
|
|
|
@include viewport.until(sm) {
|
|
align-self: flex-start;
|
|
}
|
|
|
|
label {
|
|
margin: 0;
|
|
}
|
|
|
|
&th {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
// 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";
|
|
|
|
@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;
|
|
}
|
|
}
|
|
}
|
|
|
|
.badge-category__wrapper {
|
|
align-self: flex-end;
|
|
height: min-content;
|
|
max-width: 100%;
|
|
}
|
|
}
|
|
|
|
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;
|
|
position: relative;
|
|
top: unset;
|
|
right: unset;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
|
|
// 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;
|
|
|
|
&:hover {
|
|
.discourse-no-touch & {
|
|
background-color: var(--primary-low);
|
|
border-color: var(--primary-200);
|
|
}
|
|
}
|
|
|
|
td.topic-category-data,
|
|
td.topic-likes-replies-data,
|
|
td.topic-status-data,
|
|
td.topic-creator-data {
|
|
display: none;
|
|
}
|
|
|
|
.main-link .link-top-line {
|
|
grid-area: title;
|
|
}
|
|
|
|
&.visited .main-link .link-top-line {
|
|
font-weight: normal;
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.event-date-container {
|
|
display: inline-flex;
|
|
position: relative;
|
|
top: -0.25em; // optical alignment
|
|
}
|