Font configuration options

Originally from @schu, moved from GitHub #211:

Is there a way to a) change the font throughout(!) writefreely and b) disable/remove all default fonts and related resources (webfont.js etc)?

For example, to change the font to Inter I added the following customization (via the web UI):

@import url('https://rsms.me/inter/inter.css');
html, body, textarea, pre, body#post article, body#collection article, body#subpage article, span, .font { font-family: 'Inter', sans-serif !important; }
@supports (font-variation-settings: normal) {
  html, body, textarea, pre, body#post article, body#collection article, body#subpage article, span, .font { font-family: 'Inter var', sans-serif !important; }
}

in combination with setting both disable_js = true and webfont = false in my config. That works to some extent (public pages are mostly using Inter now), but writefreely still loads all its default fonts and the menu and admin area still using the default fonts as well.

It looks like templates and theming are pretty tied to the code and it’s not possible without actually changing the code.

Am I missing something?

1 Like

Right now, yes, the best way to change fonts throughout WF would be to modify the core templates. At the moment, those config values don’t do much, and the custom CSS set through the web UI only affects individual blogs.

In the future, we plan to let admins set instance-wide custom CSS, which may address this without forcing you to modify the application code. Do you think that would work for what you’re doing?

1 Like

In the future, we plan to let admins set instance-wide custom CSS , which may address this without forcing you to modify the application code. Do you think that would work for what you’re doing?

If it will allow me to use a different font easily (and avoid loading default fonts unnecessarily), it would work for me :slight_smile: Good to hear it’s on the list already. Thanks.

2 Likes