Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit c79aa0c

Browse files
sayriscopybara-github
authored andcommitted
style(dialog): Adjusting sizing logic for full-screen dialogs.
PiperOrigin-RevId: 398717272
1 parent 65084ba commit c79aa0c

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

packages/mdc-dialog/_mixins.scss

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -735,19 +735,25 @@
735735
@mixin _fullscreen-dialog-size($query: feature-targeting.all()) {
736736
$feat-structure: feature-targeting.create-target($query, structure);
737737
.mdc-dialog__surface {
738+
@include feature-targeting.targets($feat-structure) {
739+
// Reset the max-width so the default dialog sizing doesn't interfere with
740+
// the full-screen dialog sizing.
741+
max-width: none;
742+
}
743+
738744
// Medium screens
739-
@media (max-width: 960px) and (max-height: 1440px) {
745+
@media (max-width: 960px) {
740746
@include feature-targeting.targets($feat-structure) {
741747
max-height: 560px;
742-
max-width: 560px;
748+
width: 560px;
743749
@include _modal-header(
744750
$close-icon-padding: variables.$close-icon-padding
745751
);
746752
}
747753
}
748754

749755
// Small screens
750-
@media (max-width: 720px) and (max-height: 1023px) {
756+
@media (max-width: 720px) {
751757
@include feature-targeting.targets($feat-structure) {
752758
$max-small-height: 560px;
753759
$max-small-width: 560px;
@@ -773,7 +779,7 @@
773779
height: 100%;
774780
max-height: 100vh;
775781
max-width: 100vw;
776-
width: 100%;
782+
width: 100vw;
777783
@include _fullscreen-header(
778784
$close-icon-padding: variables.$close-icon-padding,
779785
$title-side-padding: variables.$title-side-padding
@@ -782,8 +788,8 @@
782788
@include shape-mixins.radius(0, $query: $query);
783789
}
784790

785-
// X-Small Screens (vertical)
786-
@media (max-width: 600px) and (max-height: 960px) {
791+
// X-Small Screens
792+
@media (max-width: 600px) {
787793
@include feature-targeting.targets($feat-structure) {
788794
// Use 100% instead of vw/vh so the url bar is taken into account on
789795
// mobile.
@@ -800,10 +806,10 @@
800806
}
801807

802808
// Large to X-Large screens
803-
@media (min-width: 960px) and (min-height: 1440px) {
809+
@media (min-width: 960px) {
804810
@include feature-targeting.targets($feat-structure) {
805811
$min-horizontal-margin: 200px;
806-
max-width: calc(100vw - #{$min-horizontal-margin * 2});
812+
width: calc(100vw - #{$min-horizontal-margin * 2});
807813
@include _modal-header(
808814
$close-icon-padding: variables.$close-icon-padding
809815
);
@@ -828,10 +834,10 @@
828834
$max-width-breakpoint: $max-width + ($horizontal-margin * 2);
829835

830836
@media (max-width: $max-width-breakpoint) {
831-
max-width: $max-width-calc-expr;
837+
width: $max-width-calc-expr;
832838
}
833839
@media (min-width: $max-width-breakpoint) {
834-
max-width: $max-width;
840+
width: $max-width;
835841
}
836842

837843
$max-height-calc-expr: calc(100vh - #{$vertical-margin * 2});

0 commit comments

Comments
 (0)