Skip to content

Commit e8d54c3

Browse files
docs(theming): add prebuilt themes section documenting M2 and M3 themes (#32832)
1 parent 429dda8 commit e8d54c3

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

guides/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The `ng add` command will install Angular Material, the [Component Dev Kit (CDK)
1818

1919
1. Choose a prebuilt theme name, or "custom" for a custom theme:
2020

21-
You can choose from [prebuilt material design themes](https://material.angular.dev/guide/theming#pre-built-themes) or set up an extensible [custom theme](https://material.angular.dev/guide/theming#defining-a-theme).
21+
You can choose from [prebuilt material design themes](https://material.angular.dev/guide/theming#prebuilt-themes) or set up an extensible [custom theme](https://material.angular.dev/guide/theming#getting-started).
2222

2323
2. Set up global Angular Material typography styles:
2424

guides/theming.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,43 @@ pop-up contexts, such as the date picker. The Material Design density guidance
216216
explicitly discourages changes to density for such interactions because they
217217
don't compete for space in the application's layout.
218218

219+
## Prebuilt Themes
220+
221+
Angular Material includes eight prebuilt theme CSS files as an alternative to
222+
defining a custom theme with Sass. Four of these themes use the current Material
223+
3 design system, while the other four use the older Material 2 design system.
224+
225+
If you want your application to follow the modern Material 3 design language,
226+
make sure to use one of the M3 themes. The M2 themes are provided for backwards
227+
compatibility and will be removed in a future version.
228+
229+
| Theme | Design system | Light or dark? | Palettes (primary, tertiary) |
230+
|--------------------------|---------------|----------------|------------------------------|
231+
| `azure-blue.css` | **M3** | Light | azure, blue |
232+
| `rose-red.css` | **M3** | Light | rose, red |
233+
| `cyan-orange.css` | **M3** | Dark | cyan, orange |
234+
| `magenta-violet.css` | **M3** | Dark | magenta, violet |
235+
| `deeppurple-amber.css` | M2 | Light | deep-purple, amber |
236+
| `indigo-pink.css` | M2 | Light | indigo, pink |
237+
| `pink-bluegrey.css` | M2 | Dark | pink, blue-grey |
238+
| `purple-green.css` | M2 | Dark | purple, green |
239+
240+
You can find the prebuilt theme files in the `prebuilt-themes` directory of
241+
Angular Material’s npm package (`@angular/material/prebuilt-themes`). To include
242+
a prebuilt theme in your application, add the chosen CSS file to the `styles`
243+
array of your project’s `angular.json` file:
244+
245+
```json
246+
"styles": [
247+
"@angular/material/prebuilt-themes/azure-blue.css"
248+
]
249+
```
250+
251+
You can [reference the source code for these prebuilt themes][prebuilt] to see
252+
examples of complete theme definitions.
253+
254+
[prebuilt]: https://github.com/angular/components/blob/main/src/material/core/theming/prebuilt
255+
219256
## Color Palettes
220257

221258
A color palette is a set of similar colors with different hues ranging from

0 commit comments

Comments
 (0)