Skip to content

Commit aeea56d

Browse files
committed
Sync with Kendo UI Professional
1 parent 5183fb1 commit aeea56d

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
title: Set Global Font Size
3+
description: How can I set global font size for the Telerik UI components, for example the Grid?
4+
type: how-to
5+
page_title: Set Global Font Size In Pixels
6+
slug: set-global-font-size
7+
tags: font, size, grid
8+
res_type: kb
9+
component: grid
10+
---
11+
12+
## Environment
13+
14+
<table>
15+
<tr>
16+
<td>Product</td>
17+
<td>Progress® Telerik® {{ site.product_short }}</td>
18+
</tr>
19+
</table>
20+
21+
## Description
22+
23+
This KB article demonstrates how to adjust the global font size of the text displayed inside the Telerik UI {{ site.product_short }} components.
24+
25+
## Solution
26+
27+
The default font size of the components is 14px by default.
28+
29+
However, font sizes now operate in rem-s, and this might lead to different results depending on the environment. For instance, the default value of the **kendo-font-size** variable inside the SASS theme is 0.875rem. In some systems, this might translate to 14px, in others to 18px, and in third ones - to 12.5px.
30+
31+
To set the global font size in pixels, you can use one of these different options:
32+
33+
**Option 1:**
34+
35+
You can set a value like this:
36+
```CSS
37+
html {
38+
font-size: 16px;
39+
}
40+
```
41+
42+
Which will result to something like 14px in the components operating with rem units, because **kendo-font-size** is 0.875rem.
43+
44+
**Option 2:**
45+
46+
By modifying the variable you can set final value in pixels dynamically:
47+
```CSS
48+
html {
49+
--kendo-font-size: 16px;
50+
}
51+
```
52+
53+
**Option 2:**
54+
55+
By modifying the variable in rem-s, you can again let the pixel value unmodified:
56+
```CSS
57+
html {
58+
--kendo-font-size: 1rem;
59+
font-size: 16px;
60+
}
61+
```
62+
63+
And this will also result in text font size of 16px.
64+
65+
## See Also
66+
67+
- [Theme Variables](https://www.telerik.com/design-system/docs/themes/theme-default/theme-variables)
68+
- [Themes Foundation - Typography](https://www.telerik.com/design-system/docs/foundation/typography/)
69+
- [Themes Default - Typography](https://www.telerik.com/design-system/docs/themes/theme-default/customization/#typography)

0 commit comments

Comments
 (0)