Wiki投稿のスタイルを変更する

Wiki投稿のスタイルを変更するための簡単なガイド:

背景色の変更:

/admin/customize/themesCommon > CSS の下に、この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;
}


このドキュメントはバージョン管理されています - 変更の提案は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.

「いいね!」 4

Is there a way to make background conditional on light and dark theme? Appreciate your response

「いいね!」 1

The simplest thing to do is create two different theme components, one for the Light theme and one for the Dark theme so you don’t need to write any more CSS

「いいね!」 2

For Wiki customisations to work well in Private Messages with the new changes, I suggest a slight tweak to the CSS so that it targets .cooked:

// customises wiki posts
.wiki .topic-body .cooked {
    background-color: #e8f9fd;
    animation: none;
}
.post-info.edits .wiki::before {
    content: "Wiki Post";
    margin-right: 5px;
    font-weight: bold;
}

I’ll pop this in the OP too.


Later…
And for the hell of it I turned it into the Theme Component with the ability to customise the background color and the text.

「いいね!」 2