Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
feat: color
Browse files Browse the repository at this point in the history
  • Loading branch information
Candinya committed Oct 14, 2021
1 parent 7fa5ae5 commit 3735a74
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/AccountItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@touchstart="isHover = true"
@touchend="isHover = false"
/>
<Tooltip v-if="$props.address" v-show="isHover" :text="$props.address" />
<Tooltip v-if="$props.address" v-show="isHover" :text="$props.address" view-option="account" />
<Button
v-show="deleteMode"
size="sm"
Expand Down
29 changes: 20 additions & 9 deletions src/components/Tooltip.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<span
class="tooltip"
:class="[marginLeftClass, widthClass, heightClass, !widthClass && !heightClass ? 'whitespace-nowrap' : '']"
:class="{
'color-default': viewOption === 'default' || !viewOption,
'color-account': viewOption === 'account',
}"
>{{ text }}</span
>
</template>
Expand All @@ -12,31 +15,39 @@ import { Vue, Options } from 'vue-class-component';
@Options({
props: {
text: String,
heightClass: String,
widthClass: String,
marginLeftClass: String,
viewOption: String,
},
})
export default class Tooltip extends Vue {
text!: String;
heightClass!: String;
widthClass!: String;
marginLeftClass!: String;
}
</script>

<style lang="postcss" scoped>
@layer components {
.tooltip {
@apply absolute rounded-sm px-2 py-1 text-primary-text bg-primary-link font-normal border-link border-primary-link-border z-10;
@apply absolute rounded-sm px-2 py-1 font-normal border-link z-10 whitespace-nowrap;
left: calc(100% + 5px);
top: calc(50% - 14px);
}
.tooltip::after {
content: '';
@apply absolute bottom-full left-0 -ml-2 top-3 border-solid border-4;
border-color: transparent var(--color-sharebutton-border) transparent transparent;
}
.color-default {
@apply text-primary-text bg-primary-link border-primary-link-border;
&.tooltip::after {
border-color: transparent var(--color-sharebutton-border) transparent transparent;
}
}
.color-account {
@apply text-account-title bg-account-bg shadow-account;
&.tooltip::after {
border-color: transparent var(--color-account-bg) transparent transparent;
}
}
}
</style>

0 comments on commit 3735a74

Please sign in to comment.