summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkToast.vue
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-01-14 11:48:30 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-01-14 11:48:30 +0900
commitc84d86b368fc5e60308c9c53db38d5a20c6b8ff1 (patch)
treee682e9fe67b541feba8e35c6d3e75342733add53 /packages/frontend/src/components/MkToast.vue
parentrefactor(client): use css modules (diff)
downloadmisskey-c84d86b368fc5e60308c9c53db38d5a20c6b8ff1.tar.gz
misskey-c84d86b368fc5e60308c9c53db38d5a20c6b8ff1.tar.bz2
misskey-c84d86b368fc5e60308c9c53db38d5a20c6b8ff1.zip
refactor(client): use css modules
Diffstat (limited to 'packages/frontend/src/components/MkToast.vue')
-rw-r--r--packages/frontend/src/components/MkToast.vue58
1 files changed, 30 insertions, 28 deletions
diff --git a/packages/frontend/src/components/MkToast.vue b/packages/frontend/src/components/MkToast.vue
index 118f7126fc..4db8b40935 100644
--- a/packages/frontend/src/components/MkToast.vue
+++ b/packages/frontend/src/components/MkToast.vue
@@ -1,8 +1,14 @@
<template>
-<div class="mk-toast">
- <Transition :name="$store.state.animation ? 'toast' : ''" appear @after-leave="emit('closed')">
- <div v-if="showing" class="body _acrylic" :style="{ zIndex }">
- <div class="message">
+<div>
+ <Transition
+ :enter-active-class="$store.state.animation ? $style.transition_toast_enterActive : ''"
+ :leave-active-class="$store.state.animation ? $style.transition_toast_leaveActive : ''"
+ :enter-from-class="$store.state.animation ? $style.transition_toast_enterFrom : ''"
+ :leave-to-class="$store.state.animation ? $style.transition_toast_leaveTo : ''"
+ appear @after-leave="emit('closed')"
+ >
+ <div v-if="showing" class="_acrylic" :class="$style.root" :style="{ zIndex }">
+ <div style="padding: 16px 24px;">
{{ message }}
</div>
</div>
@@ -32,35 +38,31 @@ onMounted(() => {
});
</script>
-<style lang="scss" scoped>
-.toast-enter-active, .toast-leave-active {
+<style lang="scss" module>
+.transition_toast_enterActive,
+.transition_toast_leaveActive {
transition: opacity 0.3s, transform 0.3s !important;
}
-.toast-enter-from, .toast-leave-to {
+.transition_toast_enterFrom,
+.transition_toast_leaveTo {
opacity: 0;
transform: translateY(-100%);
}
-.mk-toast {
- > .body {
- position: fixed;
- left: 0;
- right: 0;
- top: 0;
- margin: 0 auto;
- margin-top: 16px;
- min-width: 300px;
- max-width: calc(100% - 32px);
- width: min-content;
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
- border-radius: 8px;
- overflow: clip;
- text-align: center;
- pointer-events: none;
-
- > .message {
- padding: 16px 24px;
- }
- }
+> .root {
+ position: fixed;
+ left: 0;
+ right: 0;
+ top: 0;
+ margin: 0 auto;
+ margin-top: 16px;
+ min-width: 300px;
+ max-width: calc(100% - 32px);
+ width: min-content;
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
+ border-radius: 8px;
+ overflow: clip;
+ text-align: center;
+ pointer-events: none;
}
</style>