Skip to content

Commit c00c764

Browse files
authored
AAE-12716 updated the typography documentation (#8277)
* AAE-12716 updated the typography documentation * tests trigger
1 parent 05e2033 commit c00c764

File tree

2 files changed

+53
-34
lines changed

2 files changed

+53
-34
lines changed

docs/user-guide/theming.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,22 @@ When you want more customization than a pre-built theme offers, you can create y
7070
/*
7171
* Include only packages that you are using (and core by default)
7272
*/
73+
@use '@angular/material' as mat;
7374
@import '~@angular/material/theming';
7475
@import '~@alfresco/adf-core/theming';
7576

76-
@include mat-core($alfresco-typography);
77+
@include mat.core();
7778

78-
$primary: mat-palette($alfresco-accent-orange);
79-
$accent: mat-palette($alfresco-accent-purple);
80-
$warn: mat-palette($alfresco-warn);
81-
$theme: mat-light-theme((
79+
$primary: mat.define-palette($alfresco-accent-orange);
80+
$accent: mat.define-palette($alfresco-accent-purple);
81+
$warn: mat.define-palette($alfresco-warn);
82+
$theme: mat.define-light-theme((
8283
color: (
8384
primary: $primary,
8485
accent: $accent,
85-
)
86+
warn: $warn,
87+
),
88+
typography: $alfresco-typography
8689
));
8790

8891
@include angular-material-theme($theme);
@@ -103,21 +106,25 @@ You can create multiple themes for your application:
103106

104107
@include mat-core($alfresco-typography);
105108

106-
$primary: mat-palette($alfresco-accent-orange);
107-
$accent: mat-palette($alfresco-accent-purple);
108-
$warn: mat-palette($alfresco-warn);
109-
$theme: mat-light-theme((
109+
$primary: mat.define-palette($alfresco-accent-orange);
110+
$accent: mat.define-palette($alfresco-accent-purple);
111+
$warn: mat.define-palette($alfresco-warn);
112+
$theme: mat.define-light-theme((
110113
color: (
111114
primary: $primary,
112115
accent: $accent,
113-
)
116+
warn: $warn,
117+
),
118+
typography: $alfresco-typography
114119
));
115120

116-
$dark-theme: mat-dark-theme((
121+
$dark-theme: mat.define-dark-theme((
117122
color: (
118123
primary: $primary,
119124
accent: $accent,
120-
)
125+
warn: $warn,
126+
),
127+
typography: $alfresco-typography
121128
));
122129

123130
@include alfresco-material-theme($theme);

docs/user-guide/typography.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ To get started you need to include your custom font in the `/src/index.html` hea
1414
```html
1515
<link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">
1616
```
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.
1820
After you need to change your `/src/custom-style.scss` to include the new font:
1921

2022
```scss
2123
/*
2224
* Include only packages that you are using (and core by default)
2325
*/
26+
@use '@angular/material' as mat;
2427
@import '~@angular/material/theming';
2528
@import '~ng2-alfresco-core/styles/theming';
2629
@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:
3538
@import '~ng2-alfresco-upload/styles/index';
3639
@import '~ng2-alfresco-userinfo/styles/index';
3740

38-
$custom-typography: mat-typography-config(
41+
$custom-typography: mat.define-typography-config(
3942
$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)
5356
);
5457

55-
@include mat-core($custom-typography);
58+
@include mat.core();
5659

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+
);
6173

6274
@include angular-material-theme($theme);
6375

@@ -75,4 +87,4 @@ $theme: mat-light-theme($primary, $accent, $warn);
7587

7688
```
7789

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

Comments
 (0)