Skip to content

Commit 8ddcbf5

Browse files
committed
main - 3b329e9 docs(material/card): use better example for overview (#30868)
1 parent 34477a5 commit 8ddcbf5

File tree

18 files changed

+63
-132
lines changed

18 files changed

+63
-132
lines changed

docs-content/examples-highlighted/material/card/card-fancy/card-fancy-example-html.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs-content/examples-highlighted/material/card/card-fancy/card-fancy-example-ts.html

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs-content/examples-highlighted/material/card/card-fancy/card-fancy-example-css.html renamed to docs-content/examples-highlighted/material/card/card-overview/card-overview-example-css.html

File renamed without changes.
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1-
<span class="hljs-tag">&lt;<span class="hljs-name">mat-card</span> <span class="hljs-attr">appearance</span>=<span class="hljs-string">&quot;outlined&quot;</span>&gt;</span>
2-
<span class="hljs-tag">&lt;<span class="hljs-name">mat-card-content</span>&gt;</span>Simple card<span class="hljs-tag">&lt;/<span class="hljs-name">mat-card-content</span>&gt;</span>
1+
<span class="hljs-tag">&lt;<span class="hljs-name">mat-card</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-card&quot;</span> <span class="hljs-attr">appearance</span>=<span class="hljs-string">&quot;outlined&quot;</span>&gt;</span>
2+
<span class="hljs-tag">&lt;<span class="hljs-name">mat-card-header</span>&gt;</span>
3+
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">mat-card-avatar</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example-header-image&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
4+
<span class="hljs-tag">&lt;<span class="hljs-name">mat-card-title</span>&gt;</span>Shiba Inu<span class="hljs-tag">&lt;/<span class="hljs-name">mat-card-title</span>&gt;</span>
5+
<span class="hljs-tag">&lt;<span class="hljs-name">mat-card-subtitle</span>&gt;</span>Dog Breed<span class="hljs-tag">&lt;/<span class="hljs-name">mat-card-subtitle</span>&gt;</span>
6+
<span class="hljs-tag">&lt;/<span class="hljs-name">mat-card-header</span>&gt;</span>
7+
<span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">mat-card-image</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;https://material.angular.io/assets/img/examples/shiba2.jpg&quot;</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">&quot;Photo of a Shiba Inu&quot;</span>&gt;</span>
8+
<span class="hljs-tag">&lt;<span class="hljs-name">mat-card-content</span>&gt;</span>
9+
<span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>
10+
The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
11+
A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally
12+
bred for hunting.
13+
<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
14+
<span class="hljs-tag">&lt;/<span class="hljs-name">mat-card-content</span>&gt;</span>
15+
<span class="hljs-tag">&lt;<span class="hljs-name">mat-card-actions</span>&gt;</span>
16+
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">matButton</span>&gt;</span>LIKE<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
17+
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">matButton</span>&gt;</span>SHARE<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
18+
<span class="hljs-tag">&lt;/<span class="hljs-name">mat-card-actions</span>&gt;</span>
319
<span class="hljs-tag">&lt;/<span class="hljs-name">mat-card</span>&gt;</span>
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<span class="hljs-keyword">import</span> {ChangeDetectionStrategy, Component} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@angular/core&#x27;</span>;
2+
<span class="hljs-keyword">import</span> {MatButtonModule} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@angular/material/button&#x27;</span>;
23
<span class="hljs-keyword">import</span> {MatCardModule} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@angular/material/card&#x27;</span>;
34

45
<span class="hljs-comment">/**
5-
* <span class="hljs-doctag">@title </span>Basic cards
6+
* <span class="hljs-doctag">@title </span>Card overview
67
*/</span>
78
<span class="hljs-meta">@Component</span>({
89
<span class="hljs-attr">selector</span>: <span class="hljs-string">&#x27;card-overview-example&#x27;</span>,
910
<span class="hljs-attr">templateUrl</span>: <span class="hljs-string">&#x27;card-overview-example.html&#x27;</span>,
10-
<span class="hljs-attr">imports</span>: [MatCardModule],
11+
<span class="hljs-attr">styleUrl</span>: <span class="hljs-string">&#x27;card-overview-example.css&#x27;</span>,
12+
<span class="hljs-attr">imports</span>: [MatCardModule, MatButtonModule],
1113
<span class="hljs-attr">changeDetection</span>: ChangeDetectionStrategy.OnPush,
1214
})
1315
<span class="hljs-keyword">export</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">CardOverviewExample</span> </span>{}

docs-content/examples-highlighted/material/card/index-ts.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<span class="hljs-keyword">export</span> {CardFancyExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./card-fancy/card-fancy-example&#x27;</span>;
21
<span class="hljs-keyword">export</span> {CardOverviewExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./card-overview/card-overview-example&#x27;</span>;
32
<span class="hljs-keyword">export</span> {CardHarnessExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./card-harness/card-harness-example&#x27;</span>;
43
<span class="hljs-keyword">export</span> {CardActionsExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./card-actions/card-actions-example&#x27;</span>;

docs-content/examples-source/material/card/card-fancy/card-fancy-example.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs-content/examples-source/material/card/card-fancy/card-fancy-example.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs-content/examples-source/material/card/card-fancy/card-fancy-example.css renamed to docs-content/examples-source/material/card/card-overview/card-overview-example.css

File renamed without changes.
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1-
<mat-card appearance="outlined">
2-
<mat-card-content>Simple card</mat-card-content>
1+
<mat-card class="example-card" appearance="outlined">
2+
<mat-card-header>
3+
<div mat-card-avatar class="example-header-image"></div>
4+
<mat-card-title>Shiba Inu</mat-card-title>
5+
<mat-card-subtitle>Dog Breed</mat-card-subtitle>
6+
</mat-card-header>
7+
<img mat-card-image src="https://material.angular.io/assets/img/examples/shiba2.jpg" alt="Photo of a Shiba Inu">
8+
<mat-card-content>
9+
<p>
10+
The Shiba Inu is the smallest of the six original and distinct spitz breeds of dog from Japan.
11+
A small, agile dog that copes very well with mountainous terrain, the Shiba Inu was originally
12+
bred for hunting.
13+
</p>
14+
</mat-card-content>
15+
<mat-card-actions>
16+
<button matButton>LIKE</button>
17+
<button matButton>SHARE</button>
18+
</mat-card-actions>
319
</mat-card>

0 commit comments

Comments
 (0)