SUNScholar/XMLUI Theme/M2/Customisation/Typography
Revision as of 13:42, 26 May 2015 by Hgibson (talk | contribs) (→Step 3 - Define font headings CSS)
Back to Mirage 2 Customisation
Contents
Introduction
This wiki page has instructions on how to configure the fonts used in your custom Mirage 2 theme.
Step 1 - Define fonts reference
Modify XSL to use custom fonts. Check the following link:
This is equivalent to:
nano $HOME/source/dspace-xmlui-mirage2/src/main/webapp/xsl/core/page-structure.xsl
Go to line 194 and insert the following:
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,bold">
Make sure to indent and format the insertion correctly.
Step 2 - Define fonts CSS
Modify CSS to use the custom fonts. Check the following link:
This is equivalent to:
nano $HOME/source/dspace-xmlui-mirage2/src/main/webapp/styles/_style.scss
Go to the bottom of the file and add the following:
$font-family-base: "Ubuntu","Bitstream Vera Sans","DejaVu Sans",Tahoma; $font-family-serif: "Ubuntu","Bitstream Vera Sans","DejaVu Sans",Tahoma,serif; $font-family-sans-serif: "Ubuntu","Bitstream Vera Sans","DejaVu Sans",Tahoma,sans-serif; $font-family-monospace: "Ubuntu","Courier New",monospace;
Step 3 - Define font headings CSS
Type the following:
nano $HOME/source/dspace-xmlui-mirage2/src/main/webapp/styles/_style.scss
Go to the bottom of the file and add the following:
$font-size-base: 14px; $font-size-large: ceil((@font-size-base * 1.25)); // ~18px $font-size-small: ceil((@font-size-base * 0.85)); // ~12px $font-size-h1: floor((@font-size-base * 2.6)); // ~36px $font-size-h2: floor((@font-size-base * 2.15)); // ~30px $font-size-h3: ceil((@font-size-base * 1.7)); // ~24px $font-size-h4: ceil((@font-size-base * 1.25)); // ~18px $font-size-h5: ceil((@font-size-base * 1.00)); $font-size-h6: ceil((@font-size-base * 0.85)); // ~12px $headings-font-family: inherit; $headings-font-weight: 500; $headings-line-height: 1.1; $headings-color: inherit;
Adjust the settings to suit you.