neater looks for shadow-related things

This commit is contained in:
Henry Jameson 2024-10-07 01:30:53 +03:00
parent cfe52185f7
commit 97c058ebda
4 changed files with 42 additions and 11 deletions

View file

@ -250,6 +250,7 @@
v-model="editedShadow" v-model="editedShadow"
:disabled="!isShadowPresent" :disabled="!isShadowPresent"
:no-preview="true" :no-preview="true"
:compact="true"
:separate-inset="shadowSelected === 'avatar' || shadowSelected === 'avatarStatus'" :separate-inset="shadowSelected === 'avatar' || shadowSelected === 'avatarStatus'"
@subShadowSelected="onSubShadow" @subShadowSelected="onSubShadow"
/> />
@ -272,7 +273,7 @@
id="palette-selector" id="palette-selector"
v-model="selectedPaletteId" v-model="selectedPaletteId"
class="list-select" class="list-select"
size="10" size="4"
> >
<option <option
v-for="(p, index) in palettes" v-for="(p, index) in palettes"
@ -358,6 +359,7 @@
<ShadowControl <ShadowControl
v-if="selectedVirtualDirective.valType === 'shadow'" v-if="selectedVirtualDirective.valType === 'shadow'"
v-model="selectedVirtualDirectiveParsed" v-model="selectedVirtualDirectiveParsed"
:compact="true"
/> />
</div> </div>
</div> </div>

View file

@ -41,7 +41,12 @@ const toModel = (input) => {
export default { export default {
props: [ props: [
'modelValue', 'fallback', 'separateInset', 'noPreview', 'disabled' 'modelValue',
'fallback',
'separateInset',
'noPreview',
'disabled',
'compact'
], ],
emits: ['update:modelValue', 'subShadowSelected'], emits: ['update:modelValue', 'subShadowSelected'],
data () { data () {

View file

@ -1,12 +1,32 @@
.settings-modal .settings-modal-panel .shadow-control { .ShadowControl {
display: flex; display: grid;
flex-wrap: wrap; grid-template-columns: 10em 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas: "selector preview tweak";
grid-gap: 0.5em;
justify-content: stretch; justify-content: stretch;
grid-gap: 0.25em;
margin-bottom: 1em; margin-bottom: 1em;
width: 100%; width: 100%;
&.-compact {
grid-template-columns: 1fr;
grid-template-rows: 10em auto auto;
grid-template-areas:
"selector"
"preview"
"tweak";
&.-no-preview {
grid-template-columns: 1fr;
grid-template-rows: 10em 1fr;
grid-template-areas:
"selector"
"tweak";
}
}
.shadow-switcher { .shadow-switcher {
grid-area: selector;
order: 1; order: 1;
flex: 1 0 6em; flex: 1 0 6em;
min-width: 6em; min-width: 6em;
@ -20,6 +40,7 @@
} }
.shadow-tweak { .shadow-tweak {
grid-area: tweak;
order: 3; order: 3;
flex: 2 0 10em; flex: 2 0 10em;
min-width: 10em; min-width: 10em;
@ -65,6 +86,10 @@
} }
&.-no-preview { &.-no-preview {
grid-template-columns: 10em 1fr;
grid-template-rows: 1fr;
grid-template-areas: "selector tweak";
.shadow-tweak { .shadow-tweak {
order: 0; order: 0;
flex: 2 0 8em; flex: 2 0 8em;
@ -87,8 +112,7 @@
} }
.shadow-preview { .shadow-preview {
order: 2; grid-area: preview;
flex: 3 3 15em;
min-width: 10em; min-width: 10em;
margin-left: 0.125em; margin-left: 0.125em;
align-self: start; align-self: start;

View file

@ -1,7 +1,7 @@
<template> <template>
<div <div
class="label shadow-control" class="ShadowControl label shadow-control"
:class="{ disabled: disabled || !present, '-no-preview': noPreview }" :class="{ disabled: disabled || !present, '-no-preview': noPreview, '-compact': compact }"
> >
<ComponentPreview <ComponentPreview
v-if="!noPreview" v-if="!noPreview"
@ -16,7 +16,7 @@
id="shadow-list" id="shadow-list"
v-model="selectedId" v-model="selectedId"
class="shadow-list" class="shadow-list"
size="10" size="4"
:disabled="disabled || shadowsAreNull" :disabled="disabled || shadowsAreNull"
> >
<option <option