|
88 | 88 | );
|
89 | 89 | @include theme.property(z-index, $z-index);
|
90 | 90 | }
|
| 91 | + |
| 92 | + &.mdc-dialog--fullscreen { |
| 93 | + @include _fullscreen-dialog-size($query: $query); |
| 94 | + } |
91 | 95 | }
|
92 | 96 |
|
93 | 97 | .mdc-dialog__scrim {
|
|
579 | 583 | }
|
580 | 584 | }
|
581 | 585 | }
|
| 586 | + |
| 587 | +@mixin _fullscreen-dialog-size($query: feature-targeting.all()) { |
| 588 | + $feat-structure: feature-targeting.create-target($query, structure); |
| 589 | + .mdc-dialog__surface { |
| 590 | + // Medium screens |
| 591 | + @media (max-width: 960px) and (max-height: 1440px) { |
| 592 | + @include feature-targeting.targets($feat-structure) { |
| 593 | + max-height: 560px; |
| 594 | + max-width: 560px; |
| 595 | + } |
| 596 | + } |
| 597 | + |
| 598 | + // Small screens |
| 599 | + @media (max-width: 720px) and (max-height: 1023px) { |
| 600 | + @include feature-targeting.targets($feat-structure) { |
| 601 | + $max-small-height: 560px; |
| 602 | + $max-small-width: 560px; |
| 603 | + $min-horizontal-small-margin: 56px; |
| 604 | + $min-vertical-small-margin: 80px; |
| 605 | + @include _fluid-size-calc( |
| 606 | + $vertical-margin: $min-vertical-small-margin, |
| 607 | + $max-height: $max-small-height, |
| 608 | + $horizontal-margin: $min-horizontal-small-margin, |
| 609 | + $max-width: $max-small-width |
| 610 | + ); |
| 611 | + } |
| 612 | + } |
| 613 | + |
| 614 | + // X-Small Screens (horizontal) |
| 615 | + @media (max-width: 720px) and (max-height: 400px) { |
| 616 | + @include feature-targeting.targets($feat-structure) { |
| 617 | + max-width: 100vw; |
| 618 | + width: 100vw; |
| 619 | + max-height: 100vh; |
| 620 | + height: 100vh; |
| 621 | + } |
| 622 | + @include shape-mixins.radius(0, $query: $query); |
| 623 | + } |
| 624 | + |
| 625 | + // X-Small Screens (vertical) |
| 626 | + @media (max-width: 600px) and (max-height: 960px) { |
| 627 | + @include feature-targeting.targets($feat-structure) { |
| 628 | + max-width: 100vw; |
| 629 | + width: 100vw; |
| 630 | + max-height: 100vh; |
| 631 | + height: 100vh; |
| 632 | + } |
| 633 | + @include shape-mixins.radius(0, $query: $query); |
| 634 | + } |
| 635 | + |
| 636 | + // Large to X-Large screens |
| 637 | + @media (min-width: 960px) and (min-height: 1440px) { |
| 638 | + @include feature-targeting.targets($feat-structure) { |
| 639 | + $min-horizontal-margin: 200px; |
| 640 | + max-width: calc(100vw - #{$min-horizontal-margin * 2}); |
| 641 | + } |
| 642 | + } |
| 643 | + } |
| 644 | +} |
| 645 | + |
| 646 | +/// Defines styling to specify a fluid dialog size while maintaining a specific |
| 647 | +/// vertical and horizontal margin. |
| 648 | +/// @param {Number} $vertical-margin |
| 649 | +/// @param {Number} $max-height |
| 650 | +/// @param {Number} $horizontal-margin |
| 651 | +/// @param {Number} $max-width |
| 652 | +@mixin _fluid-size-calc( |
| 653 | + $vertical-margin, |
| 654 | + $max-height, |
| 655 | + $horizontal-margin, |
| 656 | + $max-width |
| 657 | +) { |
| 658 | + $max-width-calc-expr: calc(100vw - #{$horizontal-margin * 2}); |
| 659 | + $max-width-breakpoint: $max-width + ($horizontal-margin * 2); |
| 660 | + |
| 661 | + @media (max-width: $max-width-breakpoint) { |
| 662 | + max-width: $max-width-calc-expr; |
| 663 | + } |
| 664 | + @media (min-width: $max-width-breakpoint) { |
| 665 | + max-width: $max-width; |
| 666 | + } |
| 667 | + |
| 668 | + $max-height-calc-expr: calc(100vh - #{$vertical-margin * 2}); |
| 669 | + $max-height-breakpoint: $max-height + ($vertical-margin * 2); |
| 670 | + |
| 671 | + @media (max-height: $max-height-breakpoint) { |
| 672 | + max-height: $max-height-calc-expr; |
| 673 | + } |
| 674 | + @media (min-height: $max-height-breakpoint) { |
| 675 | + max-height: $max-height; |
| 676 | + } |
| 677 | +} |
0 commit comments