# 使用变量样式化Discourse：支持更简单语义的案例

**URL:** <https://meta.discourse.org/t/styling-discourse-with-variables-a-case-for-simpler-semantics/378001>\
**Category:** Development\
**Created:** [2025年八月9日 18:31 UTC](https://meta.discourse.org/t/styling-discourse-with-variables-a-case-for-simpler-semantics/378001 "2025-08-09T18:31:28Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [2025年八月11日 20:40 UTC](https://meta.discourse.org/t/styling-discourse-with-variables-a-case-for-simpler-semantics/378001/5 "2025-08-11T20:40:15Z")

</div>

> [@RGJ](#):
>
> 示例：仅定位 `.btn` 或 `button`：

简短的回答是不要这样做 😅

你最好定位一个辅助按钮类，如 `btn-default`、`btn-primary`、`btn-flat` —— 这些辅助类代表了按钮的视觉类型。

`.btn` 和 `button` 更广泛地表示“这是一个按钮”，而不是任何特定的外观。

---

_[View the full topic](https://meta.discourse.org/t/styling-discourse-with-variables-a-case-for-simpler-semantics/378001)._
