# 自定义链接文本格式的最佳方法？

**URL:** <https://meta.discourse.org/t/best-way-to-customise-the-formatting-of-the-link-text/277619>\
**Category:** Development\
**Tags:** custom-header-links\
**Created:** [2019 年5 月 1 日 14:31 UTC](https://meta.discourse.org/t/best-way-to-customise-the-formatting-of-the-link-text/277619 "2019-05-01T14:31:39Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

作者： ![manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manuel/32/468169_2.png) [@manuel](https://meta.discourse.org/u/manuel)\
发布日期： [2021 年2 月 10 日 10:25 UTC](https://meta.discourse.org/t/best-way-to-customise-the-formatting-of-the-link-text/277619/5 "2021-02-10T10:25:30Z")

</div>

这很可能与颜色声明从 SCSS 切换到 CSS 变量有关。在自定义 CSS 中赋值 $header\_primary 不起作用，但如果您使用

```plaintext
.custom-header-links .headerLink a {
    color: var(--header_primary);
}

```

颜色就能正确生效。

---

_[View the full topic](https://meta.discourse.org/t/best-way-to-customise-the-formatting-of-the-link-text/277619)._
