Fonts
To change the font used by the theme:
-
Add Font Files:
In the theme folder, you will find an empty folder named fonts
/theme/nice/fonts/Place your font files inside this folder.
Example:
/theme/nice/fonts/Roboto-Regular.ttf/theme/nice/fonts/Roboto-VariableFont_wght.ttf -
Register Fonts in Raw Initial SCSS:
Go to: Site administration > Appearance > Themes > Nice Learning > Advanced settings
Paste the following in Raw initial SCSS:
@font-face {font-family: 'Roboto';src: url([[font:theme|Roboto-Regular.ttf]]) format('truetype');font-weight: 400;font-style: normal;}@font-face {font-family: 'Roboto VF';src: url([[font:theme|Roboto-VariableFont_wght.ttf]]) format('truetype');font-weight: 100 1000;font-style: normal;} -
Raw SCSS
Paste
body, h1, h2, h3, h4, h5, h6, p, input, textarea, select, button {font-family: 'Roboto', sans-serif;}Or if you want to use the variable version:
font-family: 'Roboto', sans-serif; -
Purge Moodle Cache
Go to: Site administration > Development > Purge all caches
Then refresh your site — font should now be active throughout your theme.
Optional: Language-Specific Styling
If you want to apply the font only to specific languages:
html[lang="en"] body {font-family: 'Roboto', sans-serif;}
Was this page helpful?