forked from Dogfalo/materialize
-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #556 from materializecss/modal-with-dialog
Modal with Html5 dialog element
- Loading branch information
Showing
9 changed files
with
353 additions
and
868 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,101 +1,68 @@ | ||
// use with dialog html element | ||
.modal { | ||
--modal-footer-height: 56px; | ||
--modal-footer-divider-height: 1px; | ||
--modal-border-radius: 28px; | ||
--modal-padding: 24px; | ||
|
||
&:focus { | ||
outline: none; | ||
} | ||
--modal-padding-bottom: 16px; | ||
|
||
@extend .z-depth-5; | ||
|
||
display: none; | ||
position: fixed; | ||
left: 0; | ||
right: 0; | ||
background-color: var(--md-sys-color-surface); | ||
border: none; | ||
outline: none; | ||
padding: 0; | ||
max-height: 70%; | ||
width: 55%; | ||
margin: auto; | ||
overflow-y: auto; | ||
|
||
border-radius: var(--modal-border-radius); | ||
will-change: top, opacity; | ||
|
||
// Dialog open | ||
&[open] { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
// Background | ||
background-color: color-mix(in srgb, var(--md-sys-color-surface), var(--md-sys-color-surface-tint) 17%); | ||
|
||
@media #{$medium-and-down} { | ||
width: 80%; | ||
} | ||
|
||
h1,h2,h3,h4 { | ||
margin-top: 0; | ||
// custom backdrop blur | ||
&::backdrop { | ||
backdrop-filter: blur(1px); | ||
} | ||
|
||
.modal-content { | ||
.modal-header { | ||
padding: var(--modal-padding); | ||
overflow-y: hidden; | ||
padding-bottom: var(--modal-padding-bottom); | ||
flex-shrink: 0; | ||
} | ||
|
||
.modal-close { | ||
cursor: pointer; | ||
.modal-content { | ||
padding: 0 var(--modal-padding); | ||
overflow-y: auto; | ||
} | ||
|
||
.modal-footer { | ||
border-radius: 0 0 var(--modal-border-radius) var(--modal-border-radius); | ||
background-color: var(--md-sys-color-surface); | ||
padding: 4px 6px; | ||
height: var(--modal-footer-height); | ||
width: 100%; | ||
padding: var(--modal-padding); | ||
text-align: right; | ||
|
||
.btn, .btn-flat { | ||
margin: 6px 0; | ||
} | ||
flex-shrink: 0; | ||
} | ||
} | ||
|
||
.modal-overlay { | ||
position: fixed; | ||
z-index: 999; | ||
top: -25%; | ||
left: 0; | ||
bottom: 0; | ||
right: 0; | ||
height: 125%; | ||
width: 100%; | ||
background: #000; | ||
display: none; | ||
will-change: opacity; | ||
} | ||
|
||
// Modal with fixed action footer | ||
.modal.modal-fixed-footer { | ||
padding: 0; | ||
height: 70%; | ||
|
||
.modal-content { | ||
position: absolute; | ||
height: calc(100% - var(--modal-footer-height)); | ||
max-height: 100%; | ||
width: 100%; | ||
overflow-y: auto; | ||
.modal-close { | ||
cursor: pointer; | ||
} | ||
|
||
.modal-footer { | ||
border-top: var(--modal-footer-divider-height) solid var(--md-sys-color-outline-variant); | ||
position: absolute; | ||
bottom: var(--modal-footer-divider-height); | ||
// todo: remove maybe | ||
h1,h2,h3,h4,h5,h6 { | ||
margin: 0; | ||
} | ||
} | ||
|
||
// Modal Bottom Sheet Style | ||
.modal.bottom-sheet { | ||
top: auto; | ||
bottom: -100%; | ||
margin: 0; | ||
width: 100%; | ||
margin-bottom: 0; | ||
max-height: 45%; | ||
border-radius: 0; | ||
border-bottom-left-radius: 0; | ||
border-bottom-right-radius: 0; | ||
will-change: bottom, opacity; | ||
} |
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
Oops, something went wrong.