refactor(client): use css modules

This commit is contained in:
syuilo 2023-01-10 05:45:33 +09:00
parent c2d05b507a
commit 194fb14e07

View File

@ -1,25 +1,25 @@
<template> <template>
<div class="wrpstxzv" :class="{ children: depth > 1 }"> <div :class="[$style.root, { [$style.children]: depth > 1 }]">
<div class="main"> <div :class="$style.main">
<MkAvatar class="avatar" :user="note.user"/> <MkAvatar :class="$style.avatar" :user="note.user"/>
<div class="body"> <div :class="$style.body">
<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>
</div> </div>
<template v-if="depth < 5"> <template v-if="depth < 5">
<MkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" class="reply" :detail="true" :depth="depth + 1"/> <MkNoteSub v-for="reply in replies" :key="reply.id" :note="reply" :class="$style.reply" :detail="true" :depth="depth + 1"/>
</template> </template>
<div v-else class="more"> <div v-else :class="$style.more">
<MkA class="text _link" :to="notePage(note)">{{ i18n.ts.continueThread }} <i class="ti ti-chevron-double-right"></i></MkA> <MkA class="_link" :to="notePage(note)">{{ i18n.ts.continueThread }} <i class="ti ti-chevron-double-right"></i></MkA>
</div> </div>
</div> </div>
</template> </template>
@ -57,8 +57,8 @@ if (props.detail) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" module>
.wrpstxzv { .root {
padding: 16px 32px; padding: 16px 32px;
font-size: 0.9em; font-size: 0.9em;
@ -66,62 +66,54 @@ if (props.detail) {
padding: 10px 0 0 16px; padding: 10px 0 0 16px;
font-size: 1em; font-size: 1em;
} }
}
> .main { .main {
display: flex; display: flex;
}
> .avatar { .avatar {
flex-shrink: 0; flex-shrink: 0;
display: block; display: block;
margin: 0 8px 0 0; margin: 0 8px 0 0;
width: 38px; width: 38px;
height: 38px; height: 38px;
border-radius: 8px; border-radius: 8px;
} }
> .body { .body {
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 { .text {
margin-right: 8px; margin: 0;
} padding: 0;
} }
> .content { .reply, .more {
> .text { border-left: solid 0.5px var(--divider);
margin: 0; margin-top: 10px;
padding: 0; }
}
}
}
}
}
> .reply, > .more { .more {
border-left: solid 0.5px var(--divider); padding: 10px 0 0 16px;
margin-top: 10px;
}
> .more {
padding: 10px 0 0 16px;
}
} }
@container (max-width: 450px) { @container (max-width: 450px) {
.wrpstxzv { .root {
padding: 14px 16px; padding: 14px 16px;
&.children { &.children {