Custom Code

:discourse2: Summary Custom Code allows you to customize the font and colors for source shared on the site.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-custom-code
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Some details

Generally, the fonts used to write code are part of the monospace family. The most known fonts are:

(That said, this does not prevent anyone from experimenting with the most disparate fonts!)

To change font go to https://fonts.google.com

  • choose the font you want to use

  • and customize it

  • Select EMBED and copy the string relative to the family font (1) inside the theme setting Font

  • Copy and paste the string relative to CSS (2) inside the theme setting font-family (do not add the character ; at the end of the string).

All the other settings should be clear enough.

The settings of this component are divided between light and dark theme. If you use both, remember to add the component to both themes.


29 Likes