kinoute / typora-github-night-theme

Dark Typora themes that reproduce the new GitHub Dark Themes as much as possible.
https://theme.typora.io/theme/Github-Night/
202 stars 26 forks source link

Custom fonts not working #12

Closed Lraxer closed 3 years ago

Lraxer commented 3 years ago

I'm using Typora (version 0.10.11) and github night theme (version 0.5.0) in Windows 10. I want to use custom fonts, so I followed the instruction, creating base.user.css under theme folder and appending these lines in it:

body {
  font-family: Consolas, "思源宋体";
}

It worked in themes such as Github theme, you can see the difference. Before using base.user.css:

typora-github-theme-before

After using base.user.css: typora-github-theme-after

But in github night theme, base.user.css can not work. Before: typora-github-night-theme-before

After: typora-github-night-theme-after

I'm sorry that I know little about css, I just tried to remove 思源宋体 in base.user.css but nothing changed.

body {
  font-family: Consolas;
}

I also tried {current-theme}.user.css, which didn't work either. Is there any way to solve this problem? Thank you!

kinoute commented 3 years ago

Hello,

I'm not familiar with the xxx.user.css system to override fonts. I will look at it!

In the meantime, you could try to edit the github-night.css file directly. We use "Nunito" as our main font. To change that to Consolas, you can edit every line that looks like this:

    font-family: "Nunito", sans-serif;

to

    font-family: "Consolas", sans-serif;

Example:

https://github.com/kinoute/typora-github-night-theme/blob/161ca5f3211adf0584e553e8822ff14241f420f9/github-night.css#L154-L158

etc.

I just did it for you here: https://gist.github.com/kinoute/238cc57dbc4929faeb6f3e204a48e336

Replace the content of the github-night.css file by the one in the link.

Yann

Lraxer commented 3 years ago

Thanks for your help! It would be nice if github-night supported xxx.user.css.