Add themes for handling ft-prompt styling

This is a portal-compatible way of affecting prompt styling, as ':deep' does not work for portals.
This commit is contained in:
Jason Henriquez 2024-04-18 10:53:49 -05:00
parent fbb6332758
commit 8b2fb32b41
8 changed files with 36 additions and 35 deletions

View File

@ -6,16 +6,6 @@
text-align: center; text-align: center;
} }
/* Style for `ft-prompt` */
:deep(.promptCard) {
/* Currently only this prompt has enough content to make prompt too high */
max-block-size: 95%;
/* Some child(s) will grow vertically */
display: flex;
flex-direction: column;
}
.searchInputsRow { .searchInputsRow {
display: grid; display: grid;

View File

@ -1,5 +1,6 @@
<template> <template>
<ft-prompt <ft-prompt
theme="flex-column"
@click="hide" @click="hide"
> >
<h2 class="heading"> <h2 class="heading">

View File

@ -17,6 +17,7 @@
.promptCard { .promptCard {
overflow-y: scroll; overflow-y: scroll;
max-block-size: 95%;
} }
.promptCard.autosize { .promptCard.autosize {
@ -34,6 +35,31 @@
box-sizing: border-box; box-sizing: border-box;
} }
.promptCard.flex-column {
/* Some child(ren) will grow vertically */
display: flex;
flex-direction: column;
}
.promptCard.slim {
max-inline-size: 70%;
inset-inline-start: 15%;
padding-block: 10px;
}
.center { .center {
text-align: center; text-align: center;
} }
@media only screen and (width <= 680px) {
.promptCard.slim {
padding-block: 5px;
}
}
@media only screen and (width <= 500px) {
.promptCard.slim {
max-inline-size: 80%;
inset-inline-start: 10%;
}
}

View File

@ -36,6 +36,10 @@ export default defineComponent({
autosize: { autosize: {
type: Boolean, type: Boolean,
default: false default: false
},
theme: {
type: String,
default: 'base'
} }
}, },
emits: ['click'], emits: ['click'],

View File

@ -9,7 +9,9 @@
> >
<ft-card <ft-card
class="promptCard" class="promptCard"
:class="{ autosize }" :class="{ autosize, [theme]: true }"
role="dialog"
aria-modal="true"
:aria-labelledby="('dialog-' + sanitizedLabel)" :aria-labelledby="('dialog-' + sanitizedLabel)"
> >
<slot> <slot>

View File

@ -4,16 +4,6 @@
user-select: none; user-select: none;
} }
/* Style for `ft-prompt` */
:deep(.promptCard):has(.searchFilterCloseButtonContainer) {
max-inline-size: 70%;
inset-inline-start: 15%;
padding-block: 10px;
/* Currently only this prompt has enough content to make prompt too high */
max-block-size: 95%;
}
.searchRadio { .searchRadio {
padding: 5px; padding: 5px;
} }
@ -29,11 +19,6 @@
} }
@media only screen and (width <= 680px) { @media only screen and (width <= 680px) {
/* Style for `ft-prompt` */
:deep(.promptCard):has(.searchFilterCloseButtonContainer) {
padding-block: 5px;
}
.searchRadio { .searchRadio {
border-inline-end: 0; border-inline-end: 0;
padding-block-start: 0; padding-block-start: 0;
@ -43,11 +28,3 @@
flex-flow: column; flex-flow: column;
} }
} }
@media only screen and (width <= 500px) {
/* Style for `ft-prompt` */
:deep(.promptCard):has(.searchFilterCloseButtonContainer) {
max-inline-size: 80%;
inset-inline-start: 10%;
}
}

View File

@ -1,4 +1,4 @@
import { defineComponent, nextTick } from 'vue' import { defineComponent } from 'vue'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue' import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
import FtRadioButton from '../ft-radio-button/ft-radio-button.vue' import FtRadioButton from '../ft-radio-button/ft-radio-button.vue'

View File

@ -1,5 +1,6 @@
<template> <template>
<ft-prompt <ft-prompt
theme="slim"
@click="hideSearchFilters" @click="hideSearchFilters"
> >
<div> <div>