-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prototype(card): create prototype card based on MDC web (#16588)
- Loading branch information
Showing
15 changed files
with
605 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,122 @@ | ||
<!-- TODO: copy in demo template from existing mat-card demo. --> | ||
Not yet implemented. | ||
<div class="demo-card-container"> | ||
|
||
<!-- TODO(jelbourn): re-add dividers and footers with progress bars once the MDC versions exist --> | ||
|
||
<mat-card> | ||
Card with only text content | ||
</mat-card> | ||
|
||
<mat-card> | ||
<mat-card-content> | ||
Card with only <code><mat-card-content></code> and text content. | ||
</mat-card-content> | ||
</mat-card> | ||
|
||
<mat-card> | ||
<mat-card-subtitle>Subtitle</mat-card-subtitle> | ||
<mat-card-title>Card with title and footer</mat-card-title> | ||
<mat-card-content> | ||
<p>This is supporting text.</p> | ||
<p>{{longText}}</p> | ||
</mat-card-content> | ||
<mat-card-actions> | ||
<button mat-button>Like</button> | ||
<button mat-button>Share</button> | ||
</mat-card-actions> | ||
</mat-card> | ||
|
||
<mat-card> | ||
<mat-card-subtitle>Subtitle</mat-card-subtitle> | ||
<mat-card-title>Card with title, footer, and inset-divider</mat-card-title> | ||
<mat-card-content> | ||
<p>This is supporting text.</p> | ||
<p>{{longText}}</p> | ||
</mat-card-content> | ||
<mat-card-actions> | ||
<button mat-button>Like</button> | ||
<button mat-button>Share</button> | ||
</mat-card-actions> | ||
|
||
</mat-card> | ||
|
||
<mat-card> | ||
<img mat-card-image src="https://material.angularjs.org/latest/img/washedout.png"> | ||
<mat-card-title>Content Title</mat-card-title> | ||
<mat-card-content> | ||
<p>Here is some content</p> | ||
</mat-card-content> | ||
<mat-card-actions align="end"> | ||
<button mat-button>Like</button> | ||
<button mat-button>Share</button> | ||
</mat-card-actions> | ||
</mat-card> | ||
|
||
<mat-card> | ||
<mat-card-header> | ||
<img mat-card-avatar> | ||
<mat-card-title>Header title</mat-card-title> | ||
<mat-card-subtitle>Header subtitle</mat-card-subtitle> | ||
</mat-card-header> | ||
<img mat-card-image src="https://material.angularjs.org/latest/img/washedout.png"> | ||
<mat-card-content> | ||
<p>Here is some content</p> | ||
</mat-card-content> | ||
</mat-card> | ||
|
||
<mat-card class="demo-card-blue mat-card-flat"> | ||
<mat-card-title>Easily customizable</mat-card-title> | ||
<mat-card-actions> | ||
<button mat-button>First</button> | ||
<button mat-button>Second</button> | ||
</mat-card-actions> | ||
</mat-card> | ||
|
||
<hr> | ||
<h2>Cards with media area</h2> | ||
|
||
<mat-card> | ||
<mat-card-title-group> | ||
<mat-card-title>Card</mat-card-title> | ||
<mat-card-subtitle>Small</mat-card-subtitle> | ||
<img mat-card-sm-image> | ||
</mat-card-title-group> | ||
<mat-card-content> | ||
{{longText}} | ||
</mat-card-content> | ||
</mat-card> | ||
|
||
<mat-card> | ||
<mat-card-title-group> | ||
<mat-card-title>Card</mat-card-title> | ||
<mat-card-subtitle>Medium</mat-card-subtitle> | ||
<img mat-card-md-image> | ||
</mat-card-title-group> | ||
<mat-card-content> | ||
{{longText}} | ||
</mat-card-content> | ||
</mat-card> | ||
|
||
<mat-card> | ||
<mat-card-title-group> | ||
<mat-card-title>Card</mat-card-title> | ||
<mat-card-subtitle>Large</mat-card-subtitle> | ||
<img mat-card-lg-image> | ||
</mat-card-title-group> | ||
<mat-card-content> | ||
{{longText}} | ||
</mat-card-content> | ||
</mat-card> | ||
|
||
<mat-card> | ||
<mat-card-title-group> | ||
<mat-card-title>Card</mat-card-title> | ||
<mat-card-subtitle>Extra large</mat-card-subtitle> | ||
<img mat-card-xl-image> | ||
</mat-card-title-group> | ||
<mat-card-content> | ||
{{longText}} | ||
</mat-card-content> | ||
</mat-card> | ||
|
||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
// TODO: copy in demo styles from existing mat-card demo. | ||
.demo-card-container { | ||
display: flex; | ||
flex-flow: column nowrap; | ||
|
||
.mat-mdc-card { | ||
margin: 0 16px 16px 0; | ||
width: 350px; | ||
} | ||
|
||
// Use a gray background instead of real images for that "mock" feel. | ||
img { | ||
background-color: gray; | ||
} | ||
|
||
.mdc-button { | ||
text-transform: uppercase; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,34 @@ | ||
@import '@material/card/mixins'; | ||
@import '@material/typography/mixins'; | ||
@import '../mdc-helpers/mdc-helpers'; | ||
|
||
@mixin mat-card-theme-mdc($theme) { | ||
$foreground: map-get($theme, foreground); | ||
$is-dark-theme: map-get($theme, is-dark); | ||
|
||
@include mat-using-mdc-theme($theme) { | ||
// TODO: MDC theme styles here. | ||
@include mdc-card-without-ripple($query: $mat-theme-styles-query); | ||
|
||
// Card subtitles are an Angular Material construct (not MDC), so we explicitly set their | ||
// color to secondary text here. | ||
.mat-mdc-card-subtitle { | ||
color: mat-color($foreground, secondary-text); | ||
} | ||
} | ||
} | ||
|
||
@mixin mat-card-typography-mdc($config) { | ||
@include mat-using-mdc-typography($config) { | ||
// TODO: MDC typography styles here. | ||
@include mdc-card-without-ripple($query: $mat-typography-styles-query); | ||
|
||
// Card subtitles and titles are an Angular Material construct (not MDC), so we explicitly | ||
// set their typographic styles here. | ||
.mat-mdc-card-title { | ||
@include mdc-typography(headline6); | ||
} | ||
|
||
.mat-mdc-card-subtitle { | ||
@include mdc-typography(subtitle2); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<ng-content select="[mat-card-avatar], [matCardAvatar]"></ng-content> | ||
<div class="mat-mdc-card-header-text"> | ||
<ng-content | ||
select="mat-card-title, mat-card-subtitle, | ||
[mat-card-title], [mat-card-subtitle], | ||
[matCardTitle], [matCardSubtitle]"></ng-content> | ||
</div> | ||
<ng-content></ng-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div> | ||
<ng-content | ||
select="mat-card-title, mat-card-subtitle, | ||
[mat-card-title], [mat-card-subtitle], | ||
[matCardTitle], [matCardSubtitle]"></ng-content> | ||
</div> | ||
<ng-content select="[mat-card-image], [matCardImage], | ||
[mat-card-sm-image], [matCardImageSmall], | ||
[mat-card-md-image], [matCardImageMedium], | ||
[mat-card-lg-image], [matCardImageLarge], | ||
[mat-card-xl-image], [matCardImageXLarge]"></ng-content> | ||
<ng-content></ng-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!-- TODO: MDC template here. --> | ||
<ng-content></ng-content> |
Oops, something went wrong.