Skip to content

Commit 58ecb18

Browse files
authored
docs(material/theming): Fix broken theme guide formatting (#28015)
Our docs site does not support the definition-list markdown, so I switched to headers instead. I also added a link from the generated schematic comment to the relevant documentation so users can learn more.
1 parent f1bf12f commit 58ecb18

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

guides/theming.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,37 +241,43 @@ your project's `angular.json` file][adding-styles].
241241

242242
#### Theming dimensions
243243

244-
Angular Material themes are divided along several dimensions:
244+
Angular Material themes are divided along four dimensions: base, color, typography, and density.
245245

246-
Base
247-
: Common base styles for the design system. These styles don't change based on your configured
246+
##### Base
247+
248+
Common base styles for the design system. These styles don't change based on your configured
248249
colors, typography, or density, so they only need to be included once per application. These
249250
mixins include structural styles such as border-radius, border-width, etc. All components have a base
250251
mixin that can be used to include its base styles. (For example,
251252
`@include mat.checkbox-base($theme)`)
252253

253-
Color
254-
: Styles related to the colors in your application. These style should be included at least once in
254+
##### Color
255+
256+
Styles related to the colors in your application. These style should be included at least once in
255257
your application. Depending on your needs, you may need to include these styles multiple times
256258
with different configurations. (For example, if your app supports light and dark theme colors.)
257259
All components have a color mixin that can be used to include its color styles. (For example,
258260
`@include mat.checkbox-color($theme)`)
259261

260-
Typography
261-
: Styles related to the fonts used in your application, including the font family, size, weight,
262+
##### Typography
263+
264+
Styles related to the fonts used in your application, including the font family, size, weight,
262265
line-height, and letter-spacing. These style should be included at least once in your application.
263266
Depending on your needs, you may need to include these styles multiple times with different
264267
configurations. (For example, if your app supports reading content in either a serif or sans-serif
265268
font.) All components have a typography mixin that can be used to include its typography
266269
styles. (For example, `@include mat.checkbox-typography($theme)`)
267270

268-
Density
269-
: Styles related to the size and spacing of elements in your application. These style should be
271+
##### Density
272+
273+
Styles related to the size and spacing of elements in your application. These style should be
270274
included at least once in your application. Depending on your needs, you may need to include these
271275
styles multiple times with different configurations. (For example, if your app supports both a
272276
normal and compact mode). All components have a density mixin that can be used to include its
273277
density styles. (For example, `@include mat.checkbox-density($theme)`)
274278

279+
##### Theme mixin
280+
275281
All components also support a theme mixin that can be used to include the component's styles for all
276282
theme dimensions at once. (For example, `@include mat.checkbox-theme($theme)`).
277283

src/material/schematics/ng-update/migrations/theme-base-v17/migration.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const MISSING_MIXIN_PREAMBLE_LINES = `
1717
// Please note: you do not need to include the 'base' mixins, if you include the corresponding
1818
// 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
1919
//
20+
// To learn more about "base" theme styles visit our theming guide:
21+
// https://material.angular.io/guide/theming#theming-dimensions
22+
//
2023
// TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
2124
// your theme to them. This will ensure the correct values for your app are included.\
2225
`.split('\n');

src/material/schematics/ng-update/test-cases/theme-base.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ describe('theme base mixins migration', () => {
5656
// Please note: you do not need to include the 'base' mixins, if you include the corresponding
5757
// 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
5858
//
59+
// To learn more about "base" theme styles visit our theming guide:
60+
// https://material.angular.io/guide/theming#theming-dimensions
61+
//
5962
// TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
6063
// your theme to them. This will ensure the correct values for your app are included.
6164
@include mat.button-base(/* TODO(v17): pass $your-theme here */);
@@ -91,6 +94,9 @@ describe('theme base mixins migration', () => {
9194
// Please note: you do not need to include the 'base' mixins, if you include the corresponding
9295
// 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
9396
//
97+
// To learn more about "base" theme styles visit our theming guide:
98+
// https://material.angular.io/guide/theming#theming-dimensions
99+
//
94100
// TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
95101
// your theme to them. This will ensure the correct values for your app are included.
96102
@include material.all-component-bases(/* TODO(v17): pass $your-theme here */);
@@ -123,6 +129,9 @@ describe('theme base mixins migration', () => {
123129
// Please note: you do not need to include the 'base' mixins, if you include the corresponding
124130
// 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
125131
//
132+
// To learn more about "base" theme styles visit our theming guide:
133+
// https://material.angular.io/guide/theming#theming-dimensions
134+
//
126135
// TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
127136
// your theme to them. This will ensure the correct values for your app are included.
128137
@include mat.card-base(/* TODO(v17): pass $your-theme here */);
@@ -160,6 +169,9 @@ describe('theme base mixins migration', () => {
160169
// Please note: you do not need to include the 'base' mixins, if you include the corresponding
161170
// 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
162171
//
172+
// To learn more about "base" theme styles visit our theming guide:
173+
// https://material.angular.io/guide/theming#theming-dimensions
174+
//
163175
// TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
164176
// your theme to them. This will ensure the correct values for your app are included.
165177
@include mat.all-component-bases(/* TODO(v17): pass $your-theme here */);
@@ -225,6 +237,9 @@ describe('theme base mixins migration', () => {
225237
// Please note: you do not need to include the 'base' mixins, if you include the corresponding
226238
// 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
227239
//
240+
// To learn more about "base" theme styles visit our theming guide:
241+
// https://material.angular.io/guide/theming#theming-dimensions
242+
//
228243
// TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
229244
// your theme to them. This will ensure the correct values for your app are included.
230245
@include mat.slider-base(/* TODO(v17): pass $your-theme here */);
@@ -244,6 +259,9 @@ describe('theme base mixins migration', () => {
244259
// Please note: you do not need to include the 'base' mixins, if you include the corresponding
245260
// 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
246261
//
262+
// To learn more about "base" theme styles visit our theming guide:
263+
// https://material.angular.io/guide/theming#theming-dimensions
264+
//
247265
// TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
248266
// your theme to them. This will ensure the correct values for your app are included.
249267
@include mat.slider-base(/* TODO(v17): pass $your-theme here */);
@@ -296,6 +314,9 @@ describe('theme base mixins migration', () => {
296314
// Please note: you do not need to include the 'base' mixins, if you include the corresponding
297315
// 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
298316
//
317+
// To learn more about "base" theme styles visit our theming guide:
318+
// https://material.angular.io/guide/theming#theming-dimensions
319+
//
299320
// TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
300321
// your theme to them. This will ensure the correct values for your app are included.
301322
@include mat.form-field-base(/* TODO(v17): pass $your-theme here */);

0 commit comments

Comments
 (0)