refactor(client): use css modules

This commit is contained in:
syuilo 2023-01-10 05:17:54 +09:00
parent 4d39d1caf6
commit 06f55ffb37
5 changed files with 425 additions and 480 deletions

View file

@ -1,6 +1,6 @@
<template>
<img v-if="isCustom" class="mk-emoji custom" :class="{ normal, noStyle }" :src="url" :alt="alt" :title="alt" decoding="async"/>
<img v-else-if="char && !useOsNativeEmojis" class="mk-emoji" :src="url" :alt="alt" decoding="async" @pointerenter="computeTitle"/>
<img v-if="isCustom" :class="[$style.root, $style.custom, { [$style.normal]: normal, [$style.noStyle]: noStyle }]" :src="url" :alt="alt" :title="alt" decoding="async"/>
<img v-else-if="char && !useOsNativeEmojis" :class="$style.root" :src="url" :alt="alt" decoding="async" @pointerenter="computeTitle"/>
<span v-else-if="char && useOsNativeEmojis" :alt="alt" @pointerenter="computeTitle">{{ char }}</span>
<span v-else>{{ emoji }}</span>
</template>
@ -47,32 +47,32 @@ function computeTitle(event: PointerEvent): void {
}
</script>
<style lang="scss" scoped>
.mk-emoji {
<style lang="scss" module>
.root {
height: 1.25em;
vertical-align: -0.25em;
}
.custom {
height: 2.5em;
vertical-align: middle;
transition: transform 0.2s ease;
&:hover {
transform: scale(1.2);
}
}
.normal {
height: 1.25em;
vertical-align: -0.25em;
&.custom {
height: 2.5em;
vertical-align: middle;
transition: transform 0.2s ease;
&:hover {
transform: scale(1.2);
}
&.normal {
height: 1.25em;
vertical-align: -0.25em;
&:hover {
transform: none;
}
}
}
&.noStyle {
height: auto !important;
&:hover {
transform: none;
}
}
.noStyle {
height: auto !important;
}
</style>