Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/components/Modal/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,18 @@ export default {
default: false,
},
/**
* Defines the modal size
* Default is 'normal'
* Available are 'prompt', 'small', 'medium', 'normal', 'large' and 'full'
* All sizes except 'prompt' and 'small' change automatically to full-screen on mobile
* Defines the modal size.
* Default is 'normal'.
* Available sizes are 'prompt', 'small', 'medium', 'normal', 'large' and 'full'.
* All sizes except 'prompt' and 'small' change automatically to full-screen on mobile.
* Additionally available is 'custom' which allows to set a custom size but its usage is unappreciated.
* This size only defines a max height and width of 100%. The size must then be set manually.
*/
size: {
type: String,
default: 'normal',
validator: size => {
return ['prompt', 'small', 'medium', 'normal', 'large', 'full'].includes(size)
return ['prompt', 'small', 'medium', 'normal', 'large', 'full', 'custom'].includes(size)
},
},
/**
Expand Down Expand Up @@ -768,10 +770,16 @@ export default {
border-radius: 0;
}
}
&--custom {
.modal-container {
max-width: 100%;
max-height: 100%;
}
}

// Make modal always full screen on mobile independent from modal size
// Make modal full screen on mobile
@media only screen and (max-width: $breakpoint-mobile/2) {
&:not(&--prompt):not(&--small) .modal-container {
&:not(&--prompt):not(&--small):not(&--custom) .modal-container {
max-width: initial;
width: 100%;
max-height: initial;
Expand Down