Typography
Understand how fonts and sizes are determined and utilizing in Rock Mobile.
Last updated
Understand how fonts and sizes are determined and utilizing in Rock Mobile.
Last updated
The default font family for iOS is SF Pro Display and the default for Android is Roboto. They are very similar in appearance, meaning you can style them identically without much visual differentiation.
Each platform has the option to specify additional weights through named font families.
The following system fonts can be referenced in CSS and XAML and will not affect iOS:
monospace
serif
sans-serif (or sansserif)
sans-serif-black (or sansserif-black)
sans-serif-condensed (or sansserif-condensed)
sans-serif-condensed-light (or sansserif-condensed-light)
sans-serif-light (or sansserif-light)
sans-serif-medium (or sansserif-medium)
The following system fonts can be referenced in CSS and XAML:
.SFUI-Light (also affects Android)
.SFUI-SemiBold
.SFUI-Bold
.SFUI-Heavy
.SFUI-Black (also affects Android)
Because each OS has a unique reference for similar outputs, you might consider using the OnPlatform class to set a value for each.
There are numerous, pre-defined helper classes to help easily determine proven and tested font sizes in your application. These classes are based on the Apple Human Interface Guidelines.
Title 1
28
Title 2
22
Title 3
20
Headline
17
Body
17
Callout
16
Subheadline
15
Footnote
13
Caption 1
12
Caption 2
11
These classes are only used to determine the size of text in Rock Mobile. To learn more about setting the color of your text, take a look at our colors documentation.
Read more about with CSS.