Fix #167: align item name when subtitle is empty

This commit is contained in:
Georgi Gardev 2020-12-23 16:11:47 +02:00
parent c1b5f6adab
commit 6f2b141bf7
2 changed files with 23 additions and 17 deletions

View File

@ -197,6 +197,11 @@ body {
} }
} }
.media.no-subtitle {
display: flex;
align-items: center;
}
.media-content { .media-content {
overflow: hidden; overflow: hidden;
text-overflow: inherit; text-overflow: inherit;

View File

@ -1,16 +1,3 @@
<script>
export default {};
</script>
<style></style>
*/
<script>
export default {};
</script>
<style></style>
<template> <template>
<div> <div>
<div <div
@ -20,7 +7,7 @@ export default {};
> >
<a :href="item.url" :target="item.target" rel="noreferrer"> <a :href="item.url" :target="item.target" rel="noreferrer">
<div class="card-content"> <div class="card-content">
<div class="media"> <div :class="mediaClass">
<div v-if="item.logo" class="media-left"> <div v-if="item.logo" class="media-left">
<figure class="image is-48x48"> <figure class="image is-48x48">
<img :src="item.logo" :alt="`${item.name} logo`" /> <img :src="item.logo" :alt="`${item.name} logo`" />
@ -33,7 +20,9 @@ export default {};
</div> </div>
<div class="media-content"> <div class="media-content">
<p class="title is-4">{{ item.name }}</p> <p class="title is-4">{{ item.name }}</p>
<p class="subtitle is-6">{{ item.subtitle }}</p> <p class="subtitle is-6" v-if="item.subtitle">
{{ item.subtitle }}
</p>
</div> </div>
</div> </div>
<div class="tag" :class="item.tagstyle" v-if="item.tag"> <div class="tag" :class="item.tagstyle" v-if="item.tag">
@ -51,11 +40,23 @@ export default {
props: { props: {
item: Object, item: Object,
}, },
computed: {
mediaClass: function () {
return { media: true, "no-subtitle": !this.item.subtitle };
},
},
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.media-left img { .media-left {
.image {
display: flex;
align-items: center;
}
img {
max-height: 100%; max-height: 100%;
}
} }
</style> </style>