fix(client): fix tooltip style

This commit is contained in:
syuilo 2021-11-14 13:13:22 +09:00
parent 8a40026c5c
commit 50e1040f1e
2 changed files with 50 additions and 28 deletions

View File

@ -6,21 +6,11 @@
<div class="name">{{ reaction.replace('@.', '') }}</div> <div class="name">{{ reaction.replace('@.', '') }}</div>
</div> </div>
<div class="users"> <div class="users">
<template v-if="users.length <= 10"> <div class="user" v-for="u in users" :key="u.id">
<b v-for="u in users" :key="u.id" style="margin-right: 12px;"> <MkAvatar class="avatar" :user="u"/>
<MkAvatar :user="u" style="width: 24px; height: 24px; margin-right: 2px;"/> <MkUserName class="name" :user="u" :nowrap="true"/>
<br/> </div>
<MkUserName :user="u" :nowrap="false" style="line-height: 24px;"/> <div v-if="users.length > 10" class="omitted">+{{ count - 10 }}</div>
</b>
</template>
<template v-if="10 < users.length">
<b v-for="u in users" :key="u.id" style="margin-right: 12px;">
<MkAvatar :user="u" style="width: 24px; height: 24px; margin-right: 2px;"/>
<br/>
<MkUserName :user="u" :nowrap="false" style="line-height: 24px;"/>
</b>
<span slot="omitted">+{{ count - 10 }}</span>
</template>
</div> </div>
</div> </div>
</MkTooltip> </MkTooltip>
@ -81,13 +71,31 @@ export default defineComponent({
} }
> .users { > .users {
display: flex;
flex: 1; flex: 1;
min-width: 0; min-width: 0;
font-size: 0.9em; font-size: 0.9em;
border-left: solid 0.5px var(--divider); border-left: solid 0.5px var(--divider);
padding-left: 10px; padding-left: 10px;
margin-left: 10px; margin-left: 10px;
margin-right: 14px;
text-align: left;
> .user {
line-height: 24px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:not(:last-child) {
margin-bottom: 3px;
}
> .avatar {
width: 24px;
height: 24px;
margin-right: 3px;
}
}
} }
} }
</style> </style>

View File

@ -1,11 +1,11 @@
<template> <template>
<MkTooltip :source="source" ref="tooltip" @closed="$emit('closed')" :max-width="340"> <MkTooltip :source="source" ref="tooltip" @closed="$emit('closed')" :max-width="250">
<div class="renoteTooltip"> <div class="beaffaef">
<b v-for="u in users" :key="u.id"> <div class="user" v-for="u in users" :key="u.id">
<MkAvatar :user="u" style="width: 24px; height: 24px;"/><br/> <MkAvatar class="avatar" :user="u"/>
<MkUserName :user="u" :nowrap="false" style="line-height: 24px;"/> <MkUserName class="name" :user="u" :nowrap="true"/>
</b> </div>
<span v-if="users.length < count" slot="omitted">+{{ count - users.length }}</span> <div v-if="users.length < count" class="omitted">+{{ count - users.length }}</div>
</div> </div>
</MkTooltip> </MkTooltip>
</template> </template>
@ -36,11 +36,25 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.renoteTooltip { .beaffaef {
display: flex;
flex: 1;
min-width: 0;
font-size: 0.9em; font-size: 0.9em;
gap: 12px; text-align: left;
> .user {
line-height: 24px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:not(:last-child) {
margin-bottom: 3px;
}
> .avatar {
width: 24px;
height: 24px;
margin-right: 3px;
}
}
} }
</style> </style>