# Change font in Obsidian Publish

**URL:** <https://forum.obsidian.md/t/change-font-in-obsidian-publish/69456>\
**Category:** Help\
**Tags:** custom-css, publish\
**Created:** [October 16, 2023, 1:58am UTC](https://forum.obsidian.md/t/change-font-in-obsidian-publish/69456 "2023-10-16T01:58:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiq](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/h/3da27b/32.png) [@hiq](https://forum.obsidian.md/u/hiq)\
**Post date:** [October 16, 2023, 1:58am UTC](https://forum.obsidian.md/t/change-font-in-obsidian-publish/69456/1 "2023-10-16T01:58:31Z")

</div>

Hello everyone, I have a question regarding changing the font in Obsidian Publish. I use the “Inter” font in the application, along with a CSS to change the weight of the titles. I applied the same CSS for weight in Publish, but I also used one to change the font.

The issue is that when I change the font in Obsidian Publish, it no longer adjusts the weight. Does anyone know how to resolve this?

```auto
body {
 	--h1-size: 1.7em !important;
	--h2-size: 1.55em !important;
	--h3-size: 1.4em !important;
	--h4-size: 1.2em !important;
	--h5-size: 1.15em !important;
	--h6-size: 1.125em !important;
	--h1-weight: 700 !important;
	--h2-weight: 650 !important;
	--h3-weight: 650 !important;
	--h4-weight: 600 !important;
	--h5-weight: 600 !important;
	--h6-weight: 600 !important;
	--font-text-theme: 'Inter' !important;
}

```

 ![image](https://forum.obsidian.md/uploads/default/original/3X/7/4/74eedef1410b21373d34b5316bcb9547753d42ac.png)

Another question is how do I put this line break that appears after H2 (Obsidian Publish) in a CSS?

---

<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:** [October 16, 2023, 2:47am UTC](https://forum.obsidian.md/t/change-font-in-obsidian-publish/69456/2 "2023-10-16T02:47:09Z")

</div>

Font weights don’t have `n50` values AFAIK, so you’ll want to pick `600` or `700` in your CSS. [https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)

Also, you may need to import the font and its weights to get it working properly. The links in here may be of some help:

> [@Setup custom font - Obsidian Publish](https://forum.obsidian.md/t/setup-custom-font-obsidian-publish/60600/2):
>
> I reached out on Obsidian’s Discord server and got my problem solved there. The following articles were instrumental in figuring out what I need to do:

---

<div class="post-metadata">

**Author:** ![kepano](https://forum.obsidian.md/user_avatar/forum.obsidian.md/kepano/32/23113_2.png) [@kepano](https://forum.obsidian.md/u/kepano)\
**Post date:** [October 16, 2023, 3:53am UTC](https://forum.obsidian.md/t/change-font-in-obsidian-publish/69456/3 "2023-10-16T03:53:07Z")

</div>

You should not use `!important` inside variables, it’s not necessary and can cause some unexpected effects.

---

<div class="post-metadata">

**Author:** ![hiq](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/h/3da27b/32.png) [@hiq](https://forum.obsidian.md/u/hiq)\
**Post date:** [October 16, 2023, 2:36pm UTC](https://forum.obsidian.md/t/change-font-in-obsidian-publish/69456/4 "2023-10-16T14:36:49Z")

</div>

Thank you for the help, I figured it out! @ariehen @kepano

```auto
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

body {
 	--h1-size: 1.7em;
	--h2-size: 1.55em;
	--h3-size: 1.4em;
	--h4-size: 1.2em;
	--h5-size: 1.15em;
	--h6-size: 1.125em;
	--h1-weight: 700;
	--h2-weight: 700;
	--h3-weight: 700;
	--h4-weight: 600;
	--h5-weight: 600;
	--h6-weight: 600;
	--font-family: 'Inter', sans-serif;
}

```

 ![image](https://forum.obsidian.md/uploads/default/original/3X/8/c/8c5b65d166bfb264d4dd735289441c8e86176189.png)

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [October 23, 2023, 2:37pm UTC](https://forum.obsidian.md/t/change-font-in-obsidian-publish/69456/5 "2023-10-23T14:37:05Z")

</div>

Closed on October 23, 2023, 2:37pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
