|
2 | 2 | @import '../../cdk/a11y/a11y';
|
3 | 3 |
|
4 | 4 | $mat-toolbar-height-desktop: 64px !default;
|
| 5 | +$mat-toolbar-height-mobile: 56px !default; |
| 6 | +$mat-toolbar-row-padding: 16px !default; |
| 7 | + |
| 8 | +/** @deprecated @deletion-target 8.0.0 */ |
5 | 9 | $mat-toolbar-height-mobile-portrait: 56px !default;
|
| 10 | +/** @deprecated @deletion-target 8.0.0 */ |
6 | 11 | $mat-toolbar-height-mobile-landscape: 48px !default;
|
7 | 12 |
|
8 |
| -$mat-toolbar-row-padding: 16px !default; |
9 | 13 |
|
10 |
| - |
11 |
| -@mixin mat-toolbar-height($height) { |
12 |
| - .mat-toolbar-multiple-rows { |
| 14 | +// In order to avoid breaking changes with an increase of specificity, we introduce the |
| 15 | +// `$target-selector` parameter. This allows us to target specific toolbars with a selector |
| 16 | +// (e.g. `.mat-toolbar-dense`), or just set the height for the default toolbar classes. |
| 17 | +@mixin mat-toolbar-height($height, $target-selector: '') { |
| 18 | + // If the toolbar has multiple rows, only set a minimum height to not limit the height of the |
| 19 | + // toolbar because it should grow based on the amount of rows. |
| 20 | + #{$target-selector}.mat-toolbar-multiple-rows { |
13 | 21 | min-height: $height;
|
14 | 22 | }
|
15 |
| - .mat-toolbar-row, .mat-toolbar-single-row { |
| 23 | + |
| 24 | + // If the toolbar element itself acts as the first row, set the height to the same value |
| 25 | + // as an actual toolbar row would have. |
| 26 | + .mat-toolbar-row, #{$target-selector}.mat-toolbar-single-row { |
16 | 27 | height: $height;
|
17 | 28 | }
|
18 | 29 | }
|
@@ -49,10 +60,9 @@ $mat-toolbar-row-padding: 16px !default;
|
49 | 60 | // Set the default height for the toolbar.
|
50 | 61 | @include mat-toolbar-height($mat-toolbar-height-desktop);
|
51 | 62 |
|
52 |
| -// As per specs, mobile devices will use a different height for toolbars than for desktop. |
53 |
| -// The height for mobile landscape devices has been ignored since relying on `@media orientation` |
54 |
| -// is causing issues on devices with a soft-keyboard. |
55 |
| -// See: https://material.io/guidelines/layout/structure.html#structure-app-bar |
| 63 | +// As per specs, toolbars should have a different height in mobile devices. This has been |
| 64 | +// specified in the old guidelines and is still observable in the new specifications by looking at |
| 65 | +// the spec images. See: https://material.io/design/components/app-bars-top.html#anatomy |
56 | 66 | @media ($mat-xsmall) {
|
57 |
| - @include mat-toolbar-height($mat-toolbar-height-mobile-portrait); |
| 67 | + @include mat-toolbar-height($mat-toolbar-height-mobile); |
58 | 68 | }
|
0 commit comments