# How do you set alternating colors in the list of topics

**URL:** https://meta.discourse.org/t/how-do-you-set-alternating-colors-in-the-list-of-topics/46768
**Category:** Development
**Created:** [3. Juli 2016 um 10:52 UTC](https://meta.discourse.org/t/how-do-you-set-alternating-colors-in-the-list-of-topics/46768 "2016-07-03T10:52:26Z")
**Posts on this page:** 1
**Showing post:** 16

<div class="post-metadata">

### Author: ![ToyKeeper](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toykeeper/32/297360_2.png) [@ToyKeeper](https://meta.discourse.org/u/ToyKeeper)
#### Post date: [14. März 2023 um 09:43 UTC](https://meta.discourse.org/t/how-do-you-set-alternating-colors-in-the-list-of-topics/46768/16 "2023-03-14T09:43:54Z")

</div>

> [@rahim123](#):
>
> Was wäre der beste Weg, dies mit unterschiedlichen Farben zu implementieren, je nachdem, ob das helle oder dunkle Thema verwendet wird?

Es gibt mindestens zwei Methoden, die funktionieren:

- Verwenden Sie unterschiedliche Farben für unterschiedliche Themen.
- Schattieren Sie Zeilen mit einem durchscheinenden mittleren Grau, damit sie sowohl auf hellen als auch auf dunklen Hintergründen funktionieren. Geben Sie z. B. `nth-child(odd)`-Zeilen eine Farbe wie `background: #80808040;`.

Wenn es hilft, habe ich eine Stylesheet-Überschreibung veröffentlicht, die die erste Methode demonstriert … Farben pro Thema festlegen. Weitere Details finden Sie in `style.css` für Teile, die `nth-child` enthalten.

> [@Writing a fancy theme ... worth sending upstream, or no?](https://meta.discourse.org/t/writing-a-fancy-theme-worth-sending-upstream-or-no/258076):
>
> Hello! Last month, my favorite forum switched to Discourse. This was mostly an upgrade, but people complained\* about the look and feel. So I decided to fix it, and ended up doing a major style revamp. Now I’m trying to decide if I should put in the effort to turn it into a proper theme and merge it upstream, or if that’s unrealistic. I think people on other forums might also appreciate it as an alternative theme, but I don’t know how difficult it would be to get things merged. What I did d…

Hier ist ein Beispiel, wie es in einem hellen Thema aussieht:

 ![unread-light](https://global.discourse-cdn.com/meta/original/4X/5/b/8/5b838d671e403063b19db50d615ba02f32384d20.png)

… und jedes Thema hat seine eigenen Farbdefinitionen, sodass die Tabellenzeilen zu jedem Thema passen.

---

_[View the full topic](https://meta.discourse.org/t/how-do-you-set-alternating-colors-in-the-list-of-topics/46768)._
