Skip to content

Commit

Permalink
Fix potrait mode styles in Rank-2 and MOS modals
Browse files Browse the repository at this point in the history
Use deep scoped media selectors instead of style hacks.

ref #785
  • Loading branch information
frostburn committed Jul 19, 2024
1 parent f9509ed commit 3bd3dba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
6 changes: 1 addition & 5 deletions src/components/ModalDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ const props = defineProps({
default: true,
type: Boolean
},
extraStyle: {
default: '',
type: String
},
right: {
default: false,
type: Boolean
Expand Down Expand Up @@ -80,7 +76,7 @@ watch(
<Transition name="modal">
<div v-if="show" :class="{ 'modal-mask': true, right }" @mousedown.self="$emit('cancel')">
<div class="modal-wrapper">
<div class="modal-container" :style="extraStyle">
<div class="modal-container">
<div class="modal-header">
<slot name="header">default header</slot>
</div>
Expand Down
15 changes: 9 additions & 6 deletions src/components/modals/generation/MosScale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,7 @@ function edoClick(info: MosScaleInfo) {
</script>

<template>
<Modal
:show="show"
extraStyle="min-width: 40rem;max-width: 41rem"
@confirm="generate"
@cancel="$emit('cancel')"
>
<Modal :show="show" @confirm="generate" @cancel="$emit('cancel')">
<template #header>
<h2>Generate MOS scale</h2>
</template>
Expand Down Expand Up @@ -346,4 +341,12 @@ function edoClick(info: MosScaleInfo) {
width: 4.5em;
}
}
/* Content layout (medium) */
@media screen and (min-width: 600px) {
.modal-mask :deep(.modal-container) {
min-width: 40rem;
max-width: 41rem;
}
}
</style>
15 changes: 9 additions & 6 deletions src/components/modals/generation/RankTwo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,7 @@ function generate(expand = true) {
</script>

<template>
<Modal
:show="show"
extraStyle="min-width: 30rem;max-width: 31rem"
@confirm="generate"
@cancel="$emit('cancel')"
>
<Modal :show="show" @confirm="generate" @cancel="$emit('cancel')">
<template #header>
<h2>Generate rank 2 temperament</h2>
</template>
Expand Down Expand Up @@ -440,4 +435,12 @@ p.warning {
width: 29em;
overflow-y: hidden;
}
/* Content layout (medium) */
@media screen and (min-width: 600px) {
.modal-mask :deep(.modal-container) {
min-width: 30rem;
max-width: 31rem;
}
}
</style>

0 comments on commit 3bd3dba

Please sign in to comment.