# 优雅主题

**URL:** https://meta.discourse.org/t/graceful-theme/93040
**Category:** Theme
**Tags:** official, graceful-theme
**Created:** [2018年七月24日 20:09 UTC](https://meta.discourse.org/t/graceful-theme/93040 "2018-07-24T20:09:12Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2024年六月22日 21:37 UTC](https://meta.discourse.org/t/graceful-theme/93040/140 "2024-06-22T21:37:08Z")

</div>

是否可以为背景容器定义特定颜色而不影响深色模式的背景颜色？

我们已从 Graceful 主题设置中选择了“禁用上方的背景图像和平铺设置”，并添加了以下 CSS：

```plaintext
// 背景颜色代替 Graceful 背景图像
.background-container {
  background-color: #FAF0FC;
}

```

这种浅紫色在默认调色板中看起来很棒，但在深色调色板中也会出现，而不是深灰色，这不太好。

原始 CSS 提到了一个变量，但我不知道如何以一种能为浅色或深色提供不同颜色的方式使用它：

`background-color: var(--gf-primary-very-low-or-primary-low, #f8f8f8);`

重要细节是，我们只想更改主背景的颜色，而不是带有文本的区域的背景。这就是为什么我们不能直接使用调色板值（除非我错过了什么）。

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2024年六月25日 20:05 UTC](https://meta.discourse.org/t/graceful-theme/93040/141 "2024-06-25T20:05:50Z")

</div>

仍然试图更改默认（浅色）模式的背景，同时为深色模式保留深色背景。

即使我们想要浅色背景的纯色，我们用 CSS 尝试过的任何方法都会将相同的颜色添加到深色模式的背景中。

这就是为什么我们尝试使用图像。当背景图像设置为默认值时，股票 Graceful 图像背景用于浅色模式，但深色模式有一个深色背景。如果我们能添加一个仅用于浅色模式的自定义图像，那就太好了，但当我们尝试时，深色模式也使用了相同的图像。因为背景图像明亮且适合浅色模式，所以它破坏了深色模式。

有人能帮我弄清楚这个吗？

---

<div class="post-metadata">

### Author: ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)
#### Post date: [2024年六月25日 20:12 UTC](https://meta.discourse.org/t/graceful-theme/93040/142 "2024-06-25T20:12:25Z")

</div>

一个快速的临时解决方法是使用 20-50% 不透明度的背景，这样它就能同时拾取浅色和深色的背景色。

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [2024年六月25日 21:10 UTC](https://meta.discourse.org/t/graceful-theme/93040/143 "2024-06-25T21:10:36Z")

</div>

@piffy 非常感谢。这确实是一个不错的解决方法。

我之前在计算一个 SVG 数字时迷失了方向，该数字的 20% 不透明度会得到 #FAF0FC，但对我来说，这已经足够接近了，而且暗模式也很暗。呼！

```plaintext
// 背景颜色代替优雅的背景图片
.background-container {
  background: rgb(200 190 192 / 20%);
}

```

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2024年七月2日 19:48 UTC](https://meta.discourse.org/t/graceful-theme/93040/144 "2024-07-02T19:48:35Z")

</div>

感谢您的报告，此更新将修复它

> <https://github.com/discourse/graceful/pull/31>
>
> Before:
> !\[image\](https://github.com/discourse/graceful/assets/1681963/a2be529b-…037a-4906-bf69-ccd0cafe9cca)
> 
> !\[image\](https://github.com/discourse/graceful/assets/1681963/2df4ab7c-ba1c-47c3-82d8-f5c35d763e94)
> 
> 
> 
> After:
> 
> !\[image\](https://github.com/discourse/graceful/assets/1681963/3be1611f-79bc-43a9-a02b-027b4cfd383d)
> 
> 
> !\[image\](https://github.com/discourse/graceful/assets/1681963/5d4d347c-b660-4c93-9303-efcbd1b77889)

---

<div class="post-metadata">

### Author: ![Joffrey\_Persia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joffrey_persia/32/433382_2.png) [@Joffrey\_Persia](https://meta.discourse.org/u/Joffrey_Persia)
#### Post date: [2024年七月20日 16:06 UTC](https://meta.discourse.org/t/graceful-theme/93040/145 "2024-07-20T16:06:49Z")

</div>

在主题选项中，如果您点击“编辑参数”  
您可以更改此处的 JSON：

```json
[
	{
		"setting": "background_image",
		"value": "false"
	},
	{
		"setting": "tile_background",
		"value": false
	},
	{
		"setting": "no_background_image",
		"value": false
	}
]

```

这将删除背景 SVG

---

<div class="post-metadata">

### Author: ![GoldenSound](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/goldensound/32/488850_2.png) [@GoldenSound](https://meta.discourse.org/u/GoldenSound)
#### Post date: [2025年二月16日 05:43 UTC](https://meta.discourse.org/t/graceful-theme/93040/146 "2025-02-16T05:43:41Z")

</div>

有人找到方法用这个主题正确调整论坛宽度吗？

我的 CSS 更改似乎没有效果，而 [Canapin 的自定义宽度组件](https://github.com/Canapin/Discourse-custom-width) 在默认主题上运行正常，但在 Graceful 主题上似乎没有效果。

默认情况下，论坛非常狭窄，能够更改这一点将非常棒。

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [2025年二月16日 17:20 UTC](https://meta.discourse.org/t/graceful-theme/93040/148 "2025-02-16T17:20:47Z")

</div>

Canapin 的 TC 在此主题上对我有用。  
此 TC 设置了 `--d-max-width` 和 `--topic-body-width` CSS 变量。  
您可能还有其他会覆盖这些值的 TC 或自定义设置。

您可以尝试手动设置，例如：

```css
body {
    --d-max-width: 1500px;
    --topic-body-width: 1500px;
}

```

---

<div class="post-metadata">

### Author: ![GoldenSound](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/goldensound/32/488850_2.png) [@GoldenSound](https://meta.discourse.org/u/GoldenSound)
#### Post date: [2025年二月17日 05:05 UTC](https://meta.discourse.org/t/graceful-theme/93040/149 "2025-02-17T05:05:49Z")

</div>

这奏效了，谢谢！

---

<div class="post-metadata">

### Author: ![GoldenSound](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/goldensound/32/488850_2.png) [@GoldenSound](https://meta.discourse.org/u/GoldenSound)
#### Post date: [2025年二月17日 05:09 UTC](https://meta.discourse.org/t/graceful-theme/93040/150 "2025-02-17T05:09:06Z")

</div>

桌面版的宽度问题已解决，但我现在遇到了三个问题：

1. 我似乎无法使用 CSS 更改用户头衔的颜色。

使用：

```plaintext
.user-title{
background: #F55;
border-radius: 3px;
color: #FFF !important;
font-size: 12px!important;
padding-left: 7px;
}

```

作为示例，填充、背景等的更改均已正确应用，但实际文本颜色被忽略，仍为默认的黄色。我是否应该使用其他方法来更改它？默认情况下，黄色在白色背景上非常难以阅读。

1. 在移动设备上，论坛的宽度现在略大于屏幕应有的宽度，有没有办法让它在移动设备上保持最大 100% 的宽度而不超出，同时又不撤销桌面用户的宽度增加？

2. 我遇到了与 @Solari 在上面遇到的相同问题，即移动设备上的颜色条不存在。我尝试使用建议的 CSS 代码进行响应，但这似乎并未解决问题，有人找到方法在移动设备上恢复分类颜色条了吗？

---

<div class="post-metadata">

### Author: ![GoldenSound](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/goldensound/32/488850_2.png) [@GoldenSound](https://meta.discourse.org/u/GoldenSound)
#### Post date: [2025年二月17日 17:38 UTC](https://meta.discourse.org/t/graceful-theme/93040/151 "2025-02-17T17:38:24Z")

</div>

看起来问题 1 的原因是主题已在用户标题颜色上添加了 !important 标签

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/1/e/81e14648411e996bc0d43d9b03d4d2452530a42f.png)

鉴于我们无法编辑此主题的 HTML/CSS，是否有办法更改或覆盖它？

---

<div class="post-metadata">

### Author: ![danvanmoll](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danvanmoll/32/365209_2.png) [@danvanmoll](https://meta.discourse.org/u/danvanmoll)
#### Post date: [2025年四月27日 12:55 UTC](https://meta.discourse.org/t/graceful-theme/93040/152 "2025-04-27T12:55:25Z")

</div>

您好！

垂直彩色条在论坛的移动版本上仍然没有显示。我是不是遗漏了什么？

[https://forum.twogeeksonecup.wtf](https://forum.twogeeksonecup.wtf)

谢谢！  
Dan

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2025年五月1日 23:59 UTC](https://meta.discourse.org/t/graceful-theme/93040/153 "2025-05-01T23:59:21Z")

</div>

您能提供一张详细说明这些垂直条在哪里吗？

顺便说一句，这个论坛很棒。

---

<div class="post-metadata">

### Author: ![danvanmoll](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danvanmoll/32/365209_2.png) [@danvanmoll](https://meta.discourse.org/u/danvanmoll)
#### Post date: [2025年五月2日 00:03 UTC](https://meta.discourse.org/t/graceful-theme/93040/154 "2025-05-02T00:03:02Z")

</div>

谢谢！

我附上了另一个论坛的截图，上面确实有这些栏。

 ![截图显示了一个论坛，其中包含标题为“Foren-Infos”的部分，有三个主题选项，以及标题为“News”的部分，其中包含各种博客文章。（由AI加注）](https://global.discourse-cdn.com/meta/original/4X/d/7/6/d7690af5686cb1ccc9d12d889d56774d3dedf6b2.jpeg)

基本上和桌面版上显示的栏目相同。

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2025年五月2日 00:07 UTC](https://meta.discourse.org/t/graceful-theme/93040/155 "2025-05-02T00:07:25Z")

</div>

不客气。

好的，我正在查看 Meta 的 Graceful 主题。在移动设备上，不知何故没有像桌面版那样的彩色条。我自己也不确定为什么。

不过，在桌面版中，在侧边栏切换到移动视图，应该可以使用检查元素。我也会在桌面模式下检查，看看 CSS 有何不同。如果需要，很可能可以创建一个自定义组件，在移动版中进行覆盖，以使彩色条按预期工作。

---

<div class="post-metadata">

### Author: ![danvanmoll](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danvanmoll/32/365209_2.png) [@danvanmoll](https://meta.discourse.org/u/danvanmoll)
#### Post date: [2025年五月2日 00:09 UTC](https://meta.discourse.org/t/graceful-theme/93040/156 "2025-05-02T00:09:07Z")

</div>

谢谢！我很感激。由于其他用户在此主题中更早地报告了此问题，我希望有一个更永久的修复程序，即使在 Grace 将来更新后也能保持有效。

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2025年五月2日 00:16 UTC](https://meta.discourse.org/t/graceful-theme/93040/157 "2025-05-02T00:16:57Z")

</div>

建议将这个问题作为 #Contribute > Bug 发布，并添加 #ux 和 #graceful-theme 标签，

这样有助于提高可见度。

另外，这个主题组件提供了不错的分类视图，它在 Air 主题中有所使用。

> **[GitHub - discourse/discourse-minimal-category-boxes](https://github.com/discourse/discourse-minimal-category-boxes)**
>
> Contribute to discourse/discourse-minimal-category-boxes development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![danvanmoll](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danvanmoll/32/365209_2.png) [@danvanmoll](https://meta.discourse.org/u/danvanmoll)
#### Post date: [2025年五月2日 00:17 UTC](https://meta.discourse.org/t/graceful-theme/93040/158 "2025-05-02T00:17:59Z")

</div>

谢谢！！我一定会看看！

---

<div class="post-metadata">

### Author: ![PatrickH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickh/32/116296_2.png) [@PatrickH](https://meta.discourse.org/u/PatrickH)
#### Post date: [2025年九月25日 11:53 UTC](https://meta.discourse.org/t/graceful-theme/93040/159 "2025-09-25T11:53:01Z")

</div>

很棒的主题！  
是否可以在背景中添加文字，例如（C）姓名？  
我希望每个月都有用户的照片作为背景。

---

<div class="post-metadata">

### Author: ![Orioni](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/orioni/32/542679_2.png) [@Orioni](https://meta.discourse.org/u/Orioni)
#### Post date: [2026年四月24日 14:20 UTC](https://meta.discourse.org/t/graceful-theme/93040/160 "2026-04-24T14:20:36Z")

</div>

并非有意冒犯，但我一直好奇为什么默认背景图中包含一个卐字标志。这是我注意到的最早的事情之一。可能只是我的“蜘蛛感应”在起作用，时刻警惕潜在的有毒社区成员。

 ![Screenshot 2026-04-24 at 16.19.24](https://global.discourse-cdn.com/meta/original/4X/1/d/4/1d4645172f7b097937eed19bb8b3436172b566f1.png)

[上一頁](https://meta.discourse.org/t/graceful-theme/93040.md?page=2)

[下一頁](https://meta.discourse.org/t/graceful-theme/93040.md?page=4)
