Hiding post buttons

AI 生成的摘要

The discussion revolves around hiding post buttons in Discourse. avron inquires about controlling the visibility of buttons below a topic and shares their success in hiding buttons within a post using a specific setting. cpradio suggests using CSS to achieve this. Ivan_Rapekas provides CSS examples to hide various topic buttons, including single buttons (e.g., Assign, Defer, Flag) and multiple buttons at once. They also explain the process of applying these changes to external themes by forking the original Github repo and updating the theme in Discourse.

Is it possible to control the visibility of the buttons below a topic? I refer specifically to:

I’ve been able to hide the buttons within the post:

Using:

But do similar settings exist for the the buttons identified above?

2 个赞

You can use CSS to do it.

1 个赞

CSS 示例:

// 隐藏主题按钮
// 分配
#topic-footer-button-assign {
	display: none;
}

// 延迟
#topic-footer-button-defer {
	display: none;
}

// 标记
#topic-footer-button-flag {
	display: none;
}

// 收藏
#topic-footer-button-bookmark {
	display: none;
}

// 分享
#topic-footer-button-share-and-invite {
	display: none;
}

或者

// 一次性隐藏主要按钮,但保留关注
#topic-footer-buttons .topic-footer-main-buttons {
	display: none;
}

或者

// 隐藏所有按钮,包括关注
#topic-footer-buttons {
	display: none;
}

要将此代码应用于外部主题,您需要分叉原始 Github 存储库,使用您的存储库 URL 重新安装主题,将此代码应用于您的存储库(desktop.scss 等),提交更改,然后在 Discourse 中更新主题。

2 个赞