כרטיסי נושא

למען האמת, כניסה למצב בטוח לביצוע הפעולות ההמוניות עשויה להיות חלופה להשבתת רכיב הנושא עבור כולם. כמובן שזו עדיין התעסקות נוספת, אך אולי עם פחות השפעה על כל השאר?

כן, זה מה שהבנתי אחרי שלמדתי על מצב בטוח…

לייק 1

Hello,

Thank you for your component! We noticed a problem when using your component on the forum https://community.escapecollective.com/. If you click on the topic title, the SPA reloads (I attached gif with this problem), but if you click on the card outside the title, everything works fine. The problem was discovered because the Guest Gate component was not working properly due to the page reloading.
Here is a suggestion: Guest Gate Theme Component - #154 by Don
Could you please take a look at this issue?

Thank you,
Denis D.

ezgif-7af28737d709fa

2 לייקים

So it appears something has changed with the last round of Discourse updates.
Only the very left edge of my topic cards are now respecting this CSS, I’ve been poking around to try and find what will fix it but so far have been unsuccessful.
Can anyone else confirm and see if they can track down the needed changes?

The problem is the recently added variable for the background color on topics you have read.

image

I don’t think there is a dev-news about this change. But you can find some information here:

So is there a way to suppress that CSS? This has destroyed the way my site looks and as I’m not really a coder in any sense of the word, I don’t know how to get around it.
I looked through the element inspector, and I see the word ‘visited’ on all the broken topics and I see that it’s missing on the one that still looks right.
How do I fix this?

Topic I have not visited yet (no hover):

And with a mouseover:

And the others are broken.

זה היה קשה יותר לאיתור ממה שהיה צריך להיות. (אני די בטוח שזה נובע מחסרונותיי, אבל עדיין…)

נראה שהוספת:

.topic-list-item-background-color--visited {
    background: none
}

תיקנה את זה ללא תופעות לוואי לא רצויות.

בסגנונות שלך, כעת עליך לשנות רק את שני המשתנים הללו:

--topic-list-item-background-color
--topic-list-item-background-color--visited

לכן משהו כזה אמור לעבוד:

:root {
--topic-list-item-background-color: YOUR COLOR HERE;
--topic-list-item-background-color--visited: YOUR COLOR HERE;
}

כיצד החשבון הזה יתחשב בהבדלים בעת מעבר בין אור לחושך?

You can use the css function light-dark()

--variable-name: light-dark(#efedea, #223a2c);

You can set them both to the same thing.

Nothing has been done to :hover in core. You’ll just need to make sure to set the variable to what you want when hovering.

לייק 1

This still isn’t working for me.
This is what originally worked:

// Blend topic card colors with theme
@media (prefers-color-scheme: dark) {
    .topic-card.has-max-height {
        background: #223c44 !important;
    }
    .topic-card.has-max-height:hover {
        background: #163d51 !important;
    }
}

@media (prefers-color-scheme: light) {
    .topic-card.has-max-height {
        background: #e6ecf2 !important;
    }
    .topic-card.has-max-height:hover {
        background: #ddecf7 !important;
    }
}

Then after the latest update I added this is it seemed to work, but then stopped:

.topic-list-item-background-color--visited {
    background: none
}

Then, based on what you said here I tried both adding to the current and replacing everything with this:

:root {
--topic-list-item-background-color: light-dark(#e6ecf2, #223c44);
--topic-list-item-background-color--visited: light-dark(#e6ecf2, #223c44);
--topic-list-item-background-color--hover: light-dark(#ddecf7, #163d51);
}

There must be another variable that I need to cover hover-visited, because unread threads work right, but visited ones are busted.

This variable does not exist.

.topic-card.has-max-height:hover {
--topic-list-item-background-color: ADD COLOR HERE
--topic-list-item-background-color--visited: ADD COLOR HERE
}

This should be what you need, hope that helps!

זהו המספר המועט ביותר של שורות שיכולתי להמציא שנראה שעובד כראוי.

// Blend topic card colors with theme
.topic-card.has-max-height {
--topic-list-item-background-color: light-dark(#e6ecf2, #223c44);
--topic-list-item-background-color--visited: light-dark(none, none);
}

.topic-card.has-max-height:hover {
--topic-list-item-background-color: light-dark(#ddecf7, #163d51);
--topic-list-item-background-color--visited: light-dark(none, none);
}

@media (prefers-color-scheme: dark) {
    .topic-card.has-max-height {
        background: #223c44 !important;
    }
    .topic-card.has-max-height:hover {
        background: #163d51 !important;
    }
}

@media (prefers-color-scheme: light) {
    .topic-card.has-max-height {
        background: #e6ecf2 !important;
    }
    .topic-card.has-max-height:hover {
        background: #ddecf7 !important;
    }
}

I have made a PR to this theme component with two additions:

Feature: Suggested topics switch

Adds the setting Show for suggested topics

Makes use of topic cards for suggested topics optional (as described in this feature request)

Feature: Limit to categories

Adds the setting Show on categories

If non-empty, uses topic cards on selected categories only.

5 לייקים

תוספת פנטסטית @RGJ, בדקנו אותה על המופע שלנו והיא עובדת כמו קסם, לדעתי צריך למזג אותה בהחלט.

לייק 1

Found another small CSS bug with this tc on discourse 3.5.0:

A border is added around several UI elements such as edit history and expand quote elements.

This is due to classes btn no-text missing from the button elements

נבדק ומוזג, תודה על התוספת!

2 לייקים

I honestly haven’t been able to make it work, look how ugly it turns out, I use the Horizon theme, help me.

This component is not listed as compatible with the Horizon theme.

I don’t think it will be easy to change that because both customize the topic list, and as stated in the first post:

2 לייקים

How can I add the CSS, which I see here in the threads, a lot of CSS