refactor(client): use css modules

This commit is contained in:
syuilo 2023-01-10 05:40:53 +09:00
parent 4df43a9107
commit c2d05b507a

View file

@ -1,15 +1,15 @@
<template> <template>
<div class="yohlumlk"> <div :class="$style.root">
<MkAvatar class="avatar" :user="note.user"/> <MkAvatar :class="$style.avatar" :user="note.user"/>
<div class="main"> <div :class="$style.main">
<MkNoteHeader class="header" :note="note" :mini="true"/> <MkNoteHeader :class="$style.header" :note="note" :mini="true"/>
<div class="body"> <div>
<p v-if="note.cw != null" class="cw"> <p v-if="note.cw != null" :class="$style.cw">
<Mfm v-if="note.cw != ''" class="text" :text="note.cw" :author="note.user" :i="$i"/> <Mfm v-if="note.cw != ''" style="margin-right: 8px;" :text="note.cw" :author="note.user" :i="$i"/>
<MkCwButton v-model="showContent" :note="note"/> <MkCwButton v-model="showContent" :note="note"/>
</p> </p>
<div v-show="note.cw == null || showContent" class="content"> <div v-show="note.cw == null || showContent">
<MkSubNoteContent class="text" :note="note"/> <MkSubNoteContent :class="$style.text" :note="note"/>
</div> </div>
</div> </div>
</div> </div>
@ -31,15 +31,16 @@ const props = defineProps<{
const showContent = $ref(false); const showContent = $ref(false);
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.yohlumlk { .root {
display: flex; display: flex;
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow: clip; overflow: clip;
font-size: 0.95em; font-size: 0.95em;
}
> .avatar { .avatar {
flex-shrink: 0; flex-shrink: 0;
display: block; display: block;
margin: 0 10px 0 0; margin: 0 10px 0 0;
@ -48,56 +49,42 @@ const showContent = $ref(false);
border-radius: 8px; border-radius: 8px;
} }
> .main { .main {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
}
> .header { .header {
margin-bottom: 2px; margin-bottom: 2px;
} }
> .body { .cw {
> .cw {
cursor: default; cursor: default;
display: block; display: block;
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow-wrap: break-word; overflow-wrap: break-word;
> .text {
margin-right: 8px;
}
} }
> .content { .text {
> .text {
cursor: default; cursor: default;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
}
}
}
}
@container (min-width: 350px) { @container (min-width: 350px) {
.yohlumlk { .avatar {
> .avatar {
margin: 0 10px 0 0; margin: 0 10px 0 0;
width: 44px; width: 44px;
height: 44px; height: 44px;
} }
} }
}
@container (min-width: 500px) { @container (min-width: 500px) {
.yohlumlk { .avatar {
> .avatar {
margin: 0 12px 0 0; margin: 0 12px 0 0;
width: 48px; width: 48px;
height: 48px; height: 48px;
} }
} }
}
</style> </style>