Skip to content

Commit 57331b5

Browse files
committed
docs: mention that typography hierarchy isn't included by default (#26563)
We no longer include the typography hierarchy automatically. These changes update the docs to mention it. Fixes #26524. (cherry picked from commit e6536b7)
1 parent d62327a commit 57331b5

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

guides/typography.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,20 @@ $kids-typography: mat.define-typography-config(
164164

165165
## Using typography styles in your application
166166

167-
In addition to styles shared between components, the `core` mixin includes CSS classes for styling
168-
your application. These CSS classes correspond to the typography levels in your typography config.
169-
This mixin also emits styles for native header elements scoped within the `.mat-typography` CSS
170-
class. The table below lists the CSS classes emitted and the native elements styled.
167+
In addition to styles shared between components, the `typography-hierarchy` mixin includes CSS
168+
classes for styling your application. These CSS classes correspond to the typography levels in your
169+
typography config. This mixin also emits styles for native header elements scoped within the
170+
`.mat-typography` CSS class.
171+
172+
```scss
173+
@use '@angular/material' as mat;
174+
175+
// Use the default configuration.
176+
$my-typography: mat.define-typography-config();
177+
@include mat.typography-hierarchy($my-typography);
178+
```
179+
180+
The table below lists the CSS classes emitted and the native elements styled.
171181

172182
| CSS class | Level name | Native elements |
173183
|------------------------------------------|----------------|-----------------|
@@ -194,11 +204,8 @@ typography level. The `.mat-h5` style uses the `body-2` level with the font-size
194204

195205
The `button` and `input` typography levels do not map to CSS classes.
196206

197-
You can also manually emit the CSS rules for these CSS classes and native elements by calling the `typography-hierarchy`
198-
mixin. This mixin accepts a typography config and a CSS selector under which the styles are scopes (defaulting to
199-
`.mat-typography`).
200-
201-
The following example demonstrates usage of the typography styles emitted by the `core` mixin.
207+
The following example demonstrates usage of the typography styles emitted by the
208+
`typography-hierarchy` mixin.
202209

203210
```html
204211
<body>

guides/v15-mdc-migration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ DOM and CSS of the components, you may need to tweak some of your application's
159159
instead of `mat-button`. However, not all elements in the previous implementation have an
160160
equivalent element in the new implementation.
161161

162+
* The styles associated with the `mat-typography` class are no longer generated automatically. You
163+
have to include them using the `mat.typography-hierarchy` mixin.
164+
162165
### Theming
163166

164167
* Default typography levels defined by `mat.define-typography-config` have been updated to reflect

0 commit comments

Comments
 (0)