Skip to content

Commit 3202089

Browse files
authored
docs: specify language in code snippets (#31523)
Some snippets were being interpreted as HTML, because we hadn't set a language. Fixes #31520.
1 parent 4f96ef3 commit 3202089

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

guides/schematics.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Using the command below will install Angular Material, the [Component Dev Kit](h
1212
and [Angular Animations](https://angular.dev/guide/animations) in your project. Then it will run the
1313
installation schematic.
1414

15-
```
15+
```bash
1616
ng add @angular/material
1717
```
1818

1919
In case you just want to install the `@angular/cdk`, there are also schematics for the [Component Dev Kit](https://material.angular.dev/cdk)
2020

21-
```
21+
```bash
2222
ng add @angular/cdk
2323
```
2424

@@ -65,7 +65,7 @@ started with a Material Design form group consisting of:
6565
* Material Design radio controls
6666
* Material Design buttons
6767

68-
```
68+
```bash
6969
ng generate @angular/material:address-form <component-name>
7070
```
7171

@@ -75,7 +75,7 @@ The `navigation` schematic will create a new component that includes
7575
a toolbar with the app name, and a responsive side nav based on Material
7676
breakpoints.
7777

78-
```
78+
```bash
7979
ng generate @angular/material:navigation <component-name>
8080
```
8181

@@ -84,7 +84,7 @@ ng generate @angular/material:navigation <component-name>
8484
The table schematic will create a component that renders an Angular Material `<table>` which has
8585
been pre-configured with a datasource for sorting and pagination.
8686

87-
```
87+
```bash
8888
ng generate @angular/material:table <component-name>
8989
```
9090

@@ -93,7 +93,7 @@ ng generate @angular/material:table <component-name>
9393
The `dashboard` schematic will create a new component that contains
9494
a dynamic grid list of Material Design cards.
9595

96-
```
96+
```bash
9797
ng generate @angular/material:dashboard <component-name>
9898
```
9999

@@ -102,7 +102,7 @@ ng generate @angular/material:dashboard <component-name>
102102
The `tree` schematic can be used to quickly generate an Angular component that uses the Angular
103103
Material `<mat-tree>` component to visualize a nested folder structure.
104104

105-
```
105+
```bash
106106
ng generate @angular/material:tree <component-name>
107107
```
108108

@@ -111,7 +111,7 @@ ng generate @angular/material:tree <component-name>
111111
The `drag-drop` schematic is provided by the `@angular/cdk` and can be used to generate a component
112112
that uses the CDK drag and drop directives.
113113

114-
```
114+
```bash
115115
ng generate @angular/cdk:drag-drop <component-name>
116116
```
117117

@@ -121,7 +121,7 @@ The `theme-color` schematic will generate a file with Material 3 palettes from t
121121
that can be used in a theme file. It also generates high contrast color override mixins if
122122
specified.
123123

124-
```
124+
```bash
125125
ng generate @angular/material:theme-color
126126
```
127127

guides/theming.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ entire application. The `color-scheme` is explicitly set to `light dark` so that
3535
the end user's system preferences are used to determine whether the application
3636
appears in light or dark mode.
3737

38-
```
38+
```scss
3939
@use '@angular/material' as mat;
4040

4141
html {
@@ -51,7 +51,7 @@ html {
5151
You can use the following styles to apply the theme’s surface background and
5252
on-surface text colors as a default across your application:
5353

54-
```
54+
```scss
5555
body {
5656
background: var(--mat-sys-surface);
5757
color: var(--mat-sys-on-surface);
@@ -105,7 +105,7 @@ tertiary color. The theme-type is set to `light` which means that only the light
105105
color values will be set for the application. The typography is set to Roboto
106106
with a standard density setting.
107107

108-
```
108+
```scss
109109
@use '@angular/material' as mat;
110110

111111
html {
@@ -150,7 +150,7 @@ and the Open Sans font family to brand text. It specifies that bold weight is
150150
900, medium weight is 500, and regular weight is 300\. The color scheme uses the
151151
violet color palette with a standard density.
152152

153-
```
153+
```scss
154154
@use '@angular/material' as mat;
155155

156156
html {
@@ -182,7 +182,7 @@ The following example theme file has a density setting of \-2 which causes most
182182
components to include less whitespace in their layout. The color scheme uses the
183183
violet color palette and applies Roboto as the font-family.
184184

185-
```
185+
```scss
186186
@use '@angular/material' as mat;
187187

188188
html {
@@ -234,7 +234,7 @@ builds custom color palettes based on a single color input for the primary
234234
color, and optionally color inputs to further customize secondary, tertiary, and
235235
neutral palettes:
236236

237-
```
237+
```bash
238238
ng generate @angular/material:theme-color
239239
```
240240

@@ -244,7 +244,7 @@ You can use Google Fonts as one option to load fonts in your application. For
244244
example, the following code in an application’s `<head>` loads the font family
245245
Roboto with the font weights 700, 500, and 400:
246246

247-
```
247+
```html
248248
<link rel="preconnect" href="https://fonts.googleapis.com">
249249
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
250250
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
@@ -268,7 +268,7 @@ You can define `color-scheme: light` or `color-scheme: dark` to explicitly
268268
define your application’s mode. To set the mode depending on the user’s system
269269
preferences, use `color-scheme: light-dark` as shown in the following example:
270270

271-
```
271+
```scss
272272
@use '@angular/material' as mat;
273273

274274
html {
@@ -286,7 +286,7 @@ that the mode depends on whether that class has been applied. In the following
286286
example, the application always displays the light mode theme unless the class
287287
“dark-mode” is added to the HTML body.
288288

289-
```
289+
```scss
290290
@use '@angular/material' as mat;
291291

292292
html {
@@ -322,7 +322,7 @@ different contexts. In this case, a cyan-based palette is applied to a container
322322
of information about deleting data, causing buttons and other components to have
323323
a unique and attention-grabbing style applied:
324324

325-
```
325+
```scss
326326
@use '@angular/material' as mat;
327327

328328
html {
@@ -356,7 +356,7 @@ The following example styles demonstrate a component using the color and
356356
typography variables to create an application-wide banner presenting important
357357
information to the user:
358358

359-
```
359+
```scss
360360
:host {
361361
background: var(--mat-sys-primary-container);
362362
color: var(--mat-sys-on-primary-container);
@@ -389,7 +389,7 @@ the application.
389389
The following example applies a violet color palette for the application, but
390390
alters the `primary-container` token to a specific shade of blue.
391391

392-
```
392+
```scss
393393
@use '@angular/material' as mat;
394394

395395
html {
@@ -411,7 +411,7 @@ html {
411411
Alternatively, an optional override map can be provided in the `mat.theme` mixin
412412
to replace values applied by the mixin:
413413

414-
```
414+
```scss
415415
@use '@angular/material' as mat;
416416

417417
html {
@@ -439,7 +439,7 @@ The following example demonstrates the Card’s `overrides` API to change the
439439
background color to red, increase the corner border radius, and specify a larger
440440
title font size.
441441

442-
```
442+
```scss
443443
html {
444444
@include mat.card-overrides((
445445
elevated-container-color: red,

0 commit comments

Comments
 (0)