# 多功能横幅

**URL:** https://meta.discourse.org/t/versatile-banner/109133
**Category:** Theme component
**Tags:** official, versatile-banner
**Created:** [2019年二月14日 10:05 UTC](https://meta.discourse.org/t/versatile-banner/109133 "2019-02-14T10:05:24Z")
**Posts on this page:** 1
**Showing post:** 293

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [2022年二月16日 03:36 UTC](https://meta.discourse.org/t/versatile-banner/109133/293 "2022-02-16T03:36:58Z")

</div>

> [@Tara\_Walton](#):
>
> 那听起来太棒了！

好的 @Tara_Walton 已添加暗黑模式支持，具体如下！

> <https://github.com/discourse/discourse-versatile-banner/pull/12>
>
> This change adds several new settings to facilitate dark mode support.
> 
> If any… of the setting do not take when they are first saved, add a space to the end, save the change, remove the space and save again to give it an extra push.

请继续更新组件，并告诉我您的想法。

⚠ 在测试此功能时，我确实发现更改主题设置时可能会出现一个奇怪的问题。我不确定是浏览器还是 discourse 缓存导致的问题，但如果您发现某个设置在首次更改时未生效，请在设置末尾添加一个空格，保存，然后删除空格并再次保存。另请注意，必须硬刷新页面才能看到更改。

如果有人在更新时遇到错误，从主主题中添加/删除该组件应该可以解决问题。显然还有一些小的主题问题需要稍后调查。

* * *

> [@IT\_Director](#):
>
> 大部分都很棒，但我们的横幅一直在消失。

我想我明白是怎么回事了 @IT_Director。

您在主题中添加了一条 CSS 规则：

```css
[class*="category-"] .banner-themes {
  display: none;
}

```

当我点击其中一个特色主题然后导航回主页时，似乎在访问主题时添加的 `category-` 类没有从 `body` 元素中移除。这可能是 [Homepage Feature](https://meta.discourse.org/t/homepage-feature-component/144264) 组件的路由中存在的一个小 bug。

您可以尝试移除该 CSS 规则，而是利用 `url must contain` 主题设置吗？我认为如果您移除 `/c/*` 和 `/t/*` 条目，应该会产生类似的效果，并且希望比纯 CSS 处理得更好。

---

_[View the full topic](https://meta.discourse.org/t/versatile-banner/109133)._
