A quick guide to change the style of your wiki posts:
更改背景颜色:
在您的 /admin/customize/themes 中,将以下 CSS 添加到 Common -> CSS 下方
.wiki .topic-body .cooked {
background-color: #dcffdc; /*light green*/
}
更改文本大小
如果您愿意,也可以更改使用的字体或文本的大小,甚至是颜色
.wiki .topic-body .cooked p {
font-size: 18px;
color: green;
}
添加文本
您可以添加一段文本,向用户明确他们看到的是一篇 wiki 帖子
.post-info.edits .wiki::before {
content: "EDIT THIS WIKI POST";
color: green;
background-color: #d2e2d2;
margin-right: 3px;
font-weight: bold;
border: 1px solid green;
padding: 3px;
}
This document is version controlled - suggest changes on github 。
22 个赞
Hey, we just changed the background color of wikis on the Fairphone forum, but like all other posts each wiki starts out as staff-blue when you load it, then slowly turns white and only then turns green.
Is there a way to disable this animation for wiki posts?
I believe this should do the trick:
.wiki .topic-body {animation: none;}
6 个赞
Here’s a Theme Component which makes Wikified posts pale green again, and incorporates @Kris ’s animation: none tweak. (I chose an essentially random pale green as I did this surreptitiously while I was supposed to be paying attention in a meeting. But you can change the RGB value in the Theme Component CSS after installation)
Improvements always welcome by pull request.
A very simple Discourse Theme Component which adds a distinctive green (but customisable) background colour to Wikified posts (like they used t' be back when ah wer' a young lad)
4 个赞
sca
(SumitC)
2021 年6 月 17 日 19:31
5
有没有办法根据浅色或深色主题设置背景?期待您的回复。
1 个赞
dax
(Daniela)
2021 年7 月 7 日 12:03
6
最简单的方法是创建两个不同的主题组件,一个用于浅色主题,另一个用于深色主题,这样您就不需要再编写任何 CSS 了。
2 个赞
nathank
(Nathan Kershaw)
2021 年7 月 28 日 02:50
7
为了使 Wiki 自定义在私聊中配合新变更 正常工作,我建议对 CSS 稍作调整,使其针对 .cooked 类:
// 自定义 Wiki 帖子
.wiki .topic-body .cooked {
background-color: #e8f9fd;
animation: none;
}
.post-info.edits .wiki::before {
content: "Wiki Post";
margin-right: 5px;
font-weight: bold;
}
我也会将其添加到原始帖子(OP)中。
稍后……
出于好玩,我将其制作成了主题组件,并支持自定义背景色和文本。
Simple Description
This theme component enables you to make Wiki posts (and Shared Edits posts) more obvious.
Wikis and Shared Edits are a powerful feature of Discourse, but many users are unfamiliar with the concept and find the UI just a bit too subtle. This component makes it crystal clear, packaging the content from Change the style of a wiki post .
Screenshots
[image]
Detailed Description
Installing this component enables you to control the background colour of Wiki posts, and to add s…
2 个赞