Customize
Branding
Fonts

Fonts easy

This section provides you with the guidance to tailor the typography of your site to suit your brand's style and enhance readability. To use custom fonts in your repository site, follow these steps:

Provide font assets

Copy your font asset files to fonts folder inside branding folder:

cp {my-font.ttf,my-heading-font.ttf} myrepo/ui/branding/semantic-ui/less/fonts/

Configure font styles

Declare corresponding @font-face (opens in a new tab) rules inside your Global stylesheet:

ui/branding/semantic-ui/less/global/site.overrides
@font-face {
  font-family: 'MyFont';
  src: url("~@less/fonts/my-font.ttf");
}
 
@font-face {
  font-family: 'MyHeading';
  src: url("~@less/fonts/my-heading-font.ttf");
}

Use your fonts in styles

Now you can use your font in your branding style overrides.

Here we set a global font face for the whole site:

ui/branding/semantic-ui/less/global/site.overrides
html {
    font-family: "MyFont";
    //...
}

This font face will be used just for the Header component instances (elements having CSS classes ui header):

ui/branding/semantic-ui/less/default/elements/header.overrides
/*  */
.ui.header {
    font-family: "MyHeading";
    //...
}