# Trouble using css styling for accent color and font in Publish

**URL:** <https://forum.obsidian.md/t/trouble-using-css-styling-for-accent-color-and-font-in-publish/77706>\
**Category:** Devs: Theme Design & Custom CSS\
**Tags:** custom-css, publish\
**Created:** [February 28, 2024, 10:12am UTC](https://forum.obsidian.md/t/trouble-using-css-styling-for-accent-color-and-font-in-publish/77706 "2024-02-28T10:12:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ariehen](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ariehen/32/46932_2.png) [@ariehen](https://forum.obsidian.md/u/ariehen)\
**Post date:** [March 1, 2024, 2:14am UTC](https://forum.obsidian.md/t/trouble-using-css-styling-for-accent-color-and-font-in-publish/77706/2 "2024-03-01T02:14:06Z")

</div>

For the fonts, you could have a look here:

> **[Site fonts - Developer Documentation](https://docs.obsidian.md/Reference/CSS+variables/Publish/Site+fonts)**
>
> To load remote fonts we recommend using CSS with @import or defining your fonts with @font-face and an absolute URL. Learn more. For example you can use Google Fonts in your publish.css file. Here's …

> [@Obsidian Publish resources](https://forum.obsidian.md/t/obsidian-publish-resources/74582/2):
>
> Here are two good topics on setting custom fonts for Publish:

* * *

For the text on accent, `–color-red` needs to be written as `var(--color-red)`. You may need to define that for both light and dark modes; I’m not sure. e.g.

```css
.theme-light {
    --text-on-accent: #f2f3f5;
    --text-on-accent-inverted: var(--color-red);
}

.theme-dark {
    --text-on-accent: #c7cbd4   
    --text-on-accent-inverted: var(--color-red);
}

```

---

_[View the full topic](https://forum.obsidian.md/t/trouble-using-css-styling-for-accent-color-and-font-in-publish/77706)._
