Close
Angular React Web Components Blazor Angular

Typography

The typography in Ignite UI for Angular is modeled after the Material Type System. It’s non-intrusive and optional, allowing you to modify the type styles using CSS only.

Overview

The type system is a type scale consisting of 13 different category type styles used across most components. All of the scale categories are completely reusable and adjustable by the end user.

Here’s a list of all 13 category styles as defined for the Material Theme in Ignite UI for Angular:

Scale CategoryFont FamilyFont WeightFont SizeText TransformLetter SpacingLine HeightCSS ClassCSS Variables
h1Titillium Web3006 remnone-.09375 rem7 remig-typography__h1--ig-h1-*
h2Titillium Web3003.75 remnone-.0312 rem4.4375 remig-typography__h2--ig-h2-*
h3Titillium Web4003 remnone03.5625 remig-typography__h3--ig-h3-*
h4Titillium Web4002.125 remnone.015625 rem2.5 remig-typography__h4--ig-h4-*
h5Titillium Web4001.5 remnone01.75 remig-typography__h4--ig-h5-*
h6Titillium Web6001.25 remnone.009375 rem1.5 remig-typography__h4--ig-h6-*
subtitle-1Titillium Web4001 remnone.009375 rem1.5 remig-typography__subtitle-1--ig-subtitle-1-*
subtitle-2Titillium Web600.875 remnone.00625 rem1.5 remig-typography__subtitle-2--ig-subtitle-2-*
body-1Titillium Web4001 remnone.03125 rem1.75 remig-typography__body-1--ig-body-1-*
body-2Titillium Web400.875 remnone.015625 rem1.25 remig-typography__body-2--ig-body-2-*
buttonTitillium Web600.875 remuppercase.0468751 remig-typography__button--ig-button-*
captionTitillium Web400.75 remnone.025 rem1 remig-typography__caption--ig-caption-*
overlineTitillium Web400.625 remuppercase.09375 rem1 remig-typography__overline--ig-overline-*

Each theme defines its own type scale. This means each one of the themes we ship - Material, Fluent, Bootstrap, and Indigo will have its own type scale. They all share the same scale categories, but can have different font family, weight, size, text transform, letter spacing, and line height.

Usage

By default we don’t apply any typography styles. To use our typography in your application you have to set the ig-typography CSS class on a top-level element. All of its children will then use our typography styles.

We have selected Titillium Web to be the default font for the Material Theme in Ignite UI for Angular. To use it you have to host it yourself, or include it from Google Fonts:

<link
  href="https://fonts.googleapis.com/css?family=Titillium+Web:300,400,600,700"
  rel="stylesheet"
/>

Enable the typography styles by setting the ig-typography class on the body element.

{/* index.html */}
<body class="ig-typography">
  <app-root></app-root>
</body>

Changing the Font Family

To change the font family in all components, all you have to do is overwrite the --ig-typography CSS variable with another font-family value;

/* styles.css */
:root {
    --ig-font-family: "Open Sans", sans-serif;
}

Type Styles

The type styles are used internally by most of the components in Ignite UI for Angular. For instance, the documentation says the button component uses the button type style. This means that we can modify the typography of the button component by overwriting the included --ig-button-* CSS variables.

Let’s say we want to change the text of the button in the Material Theme to always be lowercase.

:root {
    --ig-button-text-transform: lowercase;
}

Additional Resources


Our community is active and always welcoming to new ideas.