-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs (Guides): Mat elevation guide #3917
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
935554e
added some basic information
M-a-c a4a430c
fixed some spelling
M-a-c 3de9111
added some examples there are still some problems
M-a-c 2033bb4
added an example
M-a-c 04dff5d
fixed some spelling
M-a-c 6160ef2
added scss comment block
M-a-c 9b73991
fixed lint and made sure to link the style url
M-a-c 3efe1ec
fixed link to theming
M-a-c 0952077
docs (md elevation guide): $s removed from code.
M-a-c 8b54aab
fixed spelling, and pr
M-a-c 2db4d31
removed no-elevation class
M-a-c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# mat-elevation | ||
mat-elevation exists to give you separation between elements. | ||
All material design elements have resting elevations. | ||
[`Material design`](https://material.io/guidelines/material-design/elevation-shadows.html) | ||
explains how best to use elevation. | ||
|
||
|
||
Elevation is implemented with a class, simply adding the class `mat-elevation-z#` where # is the elevation number you want, 0-24. | ||
|
||
## Example | ||
<!-- example(elevation-overview) --> | ||
|
||
|
||
## Mixins | ||
In order to use the mixin for Elevation you must | ||
`@import '~@angular/material/theming';` | ||
$zValue must be a value between 0 and 24, inclusive. | ||
`@include mat-elevation($zValue);` | ||
|
||
|
||
How to use the mixin | ||
```scss | ||
.myClass { | ||
@include mat-elevation(2); | ||
|
||
&:active { | ||
@include mat-elevation(8); | ||
} | ||
} | ||
``` | ||
|
||
## Deprecated | ||
The `mdElevation($zValue)` directive is deprecated. |
5 changes: 5 additions & 0 deletions
5
src/examples/elevation-overview/elevation-overview-example.html
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,5 @@ | ||
<div class="dynamic">Hover over me!</div> | ||
|
||
<div>No Elevation</div> | ||
|
||
<div class="mat-elevation-z24">Static class for styling</div> |
21 changes: 21 additions & 0 deletions
21
src/examples/elevation-overview/elevation-overview-example.scss
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,21 @@ | ||
@import '~@angular/material/theming'; | ||
|
||
div { | ||
width: auto; | ||
display: block; | ||
text-align: center; | ||
height: 50px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
background-color: lightblue; | ||
margin-top: 10px; | ||
} | ||
|
||
|
||
.dynamic { | ||
@include mat-elevation(2); | ||
|
||
&:hover { | ||
@include mat-elevation(8); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. newline |
9 changes: 9 additions & 0 deletions
9
src/examples/elevation-overview/elevation-overview-example.ts
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,9 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'elevation-overview-example', | ||
styleUrls: ['./elevation-overview-example.scss'], | ||
templateUrl: './elevation-overview-example.html', | ||
}) | ||
|
||
export class ElevationOverviewExample {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do you feel about this?