|
2 | 2 | @use '@material/animation/animation' as mdc-animation;
|
3 | 3 | @use '@material/dialog/dialog-theme' as mdc-dialog-theme;
|
4 | 4 | @use '../core/tokens/m2/mdc/dialog' as tokens-mdc-dialog;
|
| 5 | +@use '../core/tokens/m2/mat/dialog' as tokens-mat-dialog; |
5 | 6 | @use '../core/mdc-helpers/mdc-helpers';
|
| 7 | +@use '../core/tokens/token-utils'; |
| 8 | +@use '../core/style/variables'; |
6 | 9 | @use './mdc-dialog-structure-overrides';
|
7 | 10 |
|
8 | 11 | // Dialog content max height. This has been copied from the standard dialog
|
@@ -52,22 +55,63 @@ $mat-dialog-button-horizontal-margin: 8px !default;
|
52 | 55 | }
|
53 | 56 | }
|
54 | 57 |
|
| 58 | +// This needs extra specificity so it doesn't get overwritten by the CDK structural styles. |
| 59 | +.cdk-overlay-pane.mat-mdc-dialog-panel { |
| 60 | + @include token-utils.use-tokens(tokens-mat-dialog.$prefix, tokens-mat-dialog.get-token-slots()) { |
| 61 | + @include token-utils.create-token-slot(max-width, container-max-width); |
| 62 | + @include token-utils.create-token-slot(min-width, container-min-width); |
| 63 | + |
| 64 | + @media (variables.$xsmall) { |
| 65 | + @include token-utils.create-token-slot(max-width, container-small-max-width); |
| 66 | + } |
| 67 | + } |
| 68 | +} |
| 69 | + |
| 70 | +.mat-mdc-dialog-title { |
| 71 | + @include token-utils.use-tokens(tokens-mat-dialog.$prefix, tokens-mat-dialog.get-token-slots()) { |
| 72 | + @include token-utils.create-token-slot(padding, headline-padding); |
| 73 | + } |
| 74 | +} |
| 75 | + |
55 | 76 | // MDC sets the display behavior for title and actions, but not for content. Since we support
|
56 | 77 | // using the `mdc-dialog__content` as custom element, we need to set the element to `block`.
|
57 | 78 | .mat-mdc-dialog-content {
|
58 | 79 | display: block;
|
| 80 | + |
| 81 | + @include token-utils.use-tokens(tokens-mat-dialog.$prefix, tokens-mat-dialog.get-token-slots()) { |
| 82 | + // These styles need a bit more specificity. |
| 83 | + .mat-mdc-dialog-container & { |
| 84 | + @include token-utils.create-token-slot(padding, content-padding); |
| 85 | + } |
| 86 | + |
| 87 | + .mat-mdc-dialog-container:has(.mat-mdc-dialog-actions) & { |
| 88 | + @include token-utils.create-token-slot(padding, with-actions-content-padding); |
| 89 | + } |
| 90 | + } |
| 91 | + |
| 92 | + .mat-mdc-dialog-container .mat-mdc-dialog-title + & { |
| 93 | + padding-top: 0; |
| 94 | + } |
59 | 95 | }
|
60 | 96 |
|
61 | 97 | .mat-mdc-dialog-actions {
|
62 | 98 | // For backwards compatibility, actions align at start by default. MDC usually
|
63 | 99 | // aligns actions at the end of the container.
|
64 |
| - justify-content: start; |
| 100 | + @include token-utils.use-tokens(tokens-mat-dialog.$prefix, tokens-mat-dialog.get-token-slots()) { |
| 101 | + @include token-utils.create-token-slot(padding, actions-padding); |
| 102 | + @include token-utils.create-token-slot(justify-content, actions-alignment); |
| 103 | + } |
| 104 | + |
| 105 | + // .mat-mdc-dialog-actions-align-{start|center|end} are set by directive input "align" |
| 106 | + // [align='start'], [align='center'] and [align='right'] are kept for backwards compability |
| 107 | + &.mat-mdc-dialog-actions-align-start, &[align='start'] { |
| 108 | + justify-content: start; |
| 109 | + } |
65 | 110 |
|
66 |
| - // .mat-mdc-dialog-actions-align-{center|end} are set by directive input "align" |
67 |
| - // [align='center'] and [align='right'] are kept for backwards compability |
68 | 111 | &.mat-mdc-dialog-actions-align-center, &[align='center'] {
|
69 | 112 | justify-content: center;
|
70 | 113 | }
|
| 114 | + |
71 | 115 | &.mat-mdc-dialog-actions-align-end, &[align='end'] {
|
72 | 116 | justify-content: flex-end;
|
73 | 117 | }
|
|
0 commit comments