@@ -14,13 +14,16 @@ To get started you need to include your custom font in the `/src/index.html` hea
14
14
``` html
15
15
<link href =" https://fonts.googleapis.com/css?family=Muli" rel =" stylesheet" >
16
16
```
17
-
17
+ When adding custom typography, please be aware of angular material version
18
+ (there are two different versions of typography levels: 2014 and 2018). Current
19
+ version is 14.
18
20
After you need to change your ` /src/custom-style.scss ` to include the new font:
19
21
20
22
``` scss
21
23
/*
22
24
* Include only packages that you are using (and core by default)
23
25
*/
26
+ @use ' @angular/material' as mat ;
24
27
@import ' ~@angular/material/theming' ;
25
28
@import ' ~ng2-alfresco-core/styles/theming' ;
26
29
@import ' ~ng2-alfresco-core/styles/index' ;
@@ -35,29 +38,38 @@ After you need to change your `/src/custom-style.scss` to include the new font:
35
38
@import ' ~ng2-alfresco-upload/styles/index' ;
36
39
@import ' ~ng2-alfresco-userinfo/styles/index' ;
37
40
38
- $custom-typography : mat-typography-config (
41
+ $custom-typography : mat . define -typography-config (
39
42
$font-family : ' Muli, Roboto, "Helvetica Neue", sans-serif' ,
40
- $display-4 : mat-typography-level (112px , 112px , 300 ),
41
- $display-3 : mat-typography-level (56px , 56px , 400 ),
42
- $display-2 : mat-typography-level (45px , 48px , 400 ),
43
- $display-1 : mat-typography-level (34px , 40px , 400 ),
44
- $headline : mat-typography-level (24px , 32px , 400 ),
45
- $title : mat-typography-level (20px , 32px , 500 ),
46
- $subheading-2 : mat-typography-level (16px , 28px , 400 ),
47
- $subheading-1 : mat-typography-level (15px , 24px , 400 ),
48
- $body-2 : mat-typography-level (14px , 24px , 500 ),
49
- $body-1 : mat-typography-level (14px , 20px , 400 ),
50
- $caption : mat-typography-level (12px , 20px , 400 ),
51
- $button : mat-typography-level (14px , 14px , 500 ),
52
- $input : mat-typography-level (16px , 1.25 , 400 )
43
+ $display-4 : mat . define -typography-level (112px , 112px , 300 ),
44
+ $display-3 : mat . define -typography-level (56px , 56px , 400 ),
45
+ $display-2 : mat . define -typography-level (45px , 48px , 400 ),
46
+ $display-1 : mat . define -typography-level (34px , 40px , 400 ),
47
+ $headline : mat . define -typography-level (24px , 32px , 400 ),
48
+ $title : mat . define -typography-level (20px , 32px , 500 ),
49
+ $subheading-2 : mat . define -typography-level (16px , 28px , 400 ),
50
+ $subheading-1 : mat . define -typography-level (15px , 24px , 400 ),
51
+ $body-2 : mat . define -typography-level (14px , 24px , 500 ),
52
+ $body-1 : mat . define -typography-level (14px , 20px , 400 ),
53
+ $caption : mat . define -typography-level (12px , 20px , 400 ),
54
+ $button : mat . define -typography-level (14px , 14px , 500 ),
55
+ $input : mat . define -typography-level (16px , 1.25 , 400 )
53
56
);
54
57
55
- @include mat- core ($custom-typography );
58
+ @include mat . core ();
56
59
57
- $primary : mat-palette ($alfresco-accent-orange );
58
- $accent : mat-palette ($alfresco-accent-purple );
59
- $warn : mat-palette ($alfresco-warn );
60
- $theme : mat-light-theme ($primary , $accent , $warn );
60
+ $primary : mat .define-palette ($alfresco-accent-orange );
61
+ $accent : mat .define-palette ($alfresco-accent-purple );
62
+ $warn : mat .define-palette ($alfresco-warn );
63
+ $theme : mat .define-light-theme (
64
+ (
65
+ color : (
66
+ primary: $primary ,
67
+ accent: $accent ,
68
+ warn: $warn ,
69
+ ),
70
+ typography: $custom-typography
71
+ )
72
+ );
61
73
62
74
@include angular-material-theme ($theme );
63
75
@@ -75,4 +87,4 @@ $theme: mat-light-theme($primary, $accent, $warn);
75
87
76
88
```
77
89
78
- for more details about typography refer to [ Material 2 documentation] ( https://github.com/angular/material2/blob/master/guides/typography.md )
90
+ for more details about typography refer to [ Material 2 documentation] ( https://github.com/angular/material2/blob/master/guides/typography.md )
0 commit comments