aboutsummaryrefslogtreecommitdiff
path: root/src/components/popover/popover.vue
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-12 14:17:56 +0000
committerlain <lain@soykaf.club>2020-06-12 14:17:56 +0000
commitfd109fa355ac491b86d1e10fcbfcdd577f1ac4d7 (patch)
treec27c2f3b684540b10ef9d4477349b4a8681eb7b2 /src/components/popover/popover.vue
parent1946661911c97651ba5356db22a0ddd00ba04864 (diff)
parent48365819d14d80d2aeb7174bca05bf76eee2e8e0 (diff)
Merge branch 'develop' into 'chore/improve-default-tos'
# Conflicts: # static/terms-of-service.html
Diffstat (limited to 'src/components/popover/popover.vue')
-rw-r--r--src/components/popover/popover.vue118
1 files changed, 118 insertions, 0 deletions
diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue
new file mode 100644
index 00000000..a271cb1b
--- /dev/null
+++ b/src/components/popover/popover.vue
@@ -0,0 +1,118 @@
+<template>
+ <div
+ @mouseenter="onMouseenter"
+ @mouseleave="onMouseleave"
+ >
+ <div
+ ref="trigger"
+ @click="onClick"
+ >
+ <slot name="trigger" />
+ </div>
+ <div
+ v-if="!hidden"
+ ref="content"
+ :style="styles"
+ class="popover"
+ :class="popoverClass"
+ >
+ <slot
+ name="content"
+ class="popover-inner"
+ :close="hidePopover"
+ />
+ </div>
+ </div>
+</template>
+
+<script src="./popover.js" />
+
+<style lang=scss>
+@import '../../_variables.scss';
+
+.popover {
+ z-index: 8;
+ position: absolute;
+ min-width: 0;
+ transition: opacity 0.3s;
+
+ box-shadow: 1px 1px 4px rgba(0,0,0,.6);
+ box-shadow: var(--panelShadow);
+ border-radius: $fallback--btnRadius;
+ border-radius: var(--btnRadius, $fallback--btnRadius);
+
+ background-color: $fallback--bg;
+ background-color: var(--popover, $fallback--bg);
+ color: $fallback--text;
+ color: var(--popoverText, $fallback--text);
+ --faint: var(--popoverFaintText, $fallback--faint);
+ --faintLink: var(--popoverFaintLink, $fallback--faint);
+ --lightText: var(--popoverLightText, $fallback--lightText);
+ --postLink: var(--popoverPostLink, $fallback--link);
+ --postFaintLink: var(--popoverPostFaintLink, $fallback--link);
+ --icon: var(--popoverIcon, $fallback--icon);
+}
+
+.dropdown-menu {
+ display: block;
+ padding: .5rem 0;
+ font-size: 1rem;
+ text-align: left;
+ list-style: none;
+ max-width: 100vw;
+ z-index: 10;
+ white-space: nowrap;
+
+ .dropdown-divider {
+ height: 0;
+ margin: .5rem 0;
+ overflow: hidden;
+ border-top: 1px solid $fallback--border;
+ border-top: 1px solid var(--border, $fallback--border);
+ }
+
+ .dropdown-item {
+ line-height: 21px;
+ margin-right: 5px;
+ overflow: auto;
+ display: block;
+ padding: .25rem 1.0rem .25rem 1.5rem;
+ clear: both;
+ font-weight: 400;
+ text-align: inherit;
+ white-space: nowrap;
+ border: none;
+ border-radius: 0px;
+ background-color: transparent;
+ box-shadow: none;
+ width: 100%;
+ height: 100%;
+
+ --btnText: var(--popoverText, $fallback--text);
+
+ &-icon {
+ padding-left: 0.5rem;
+
+ i {
+ margin-right: 0.25rem;
+ color: var(--menuPopoverIcon, $fallback--icon)
+ }
+ }
+
+ &:active, &:hover {
+ background-color: $fallback--lightBg;
+ background-color: var(--selectedMenuPopover, $fallback--lightBg);
+ color: $fallback--link;
+ color: var(--selectedMenuPopoverText, $fallback--link);
+ --faint: var(--selectedMenuPopoverFaintText, $fallback--faint);
+ --faintLink: var(--selectedMenuPopoverFaintLink, $fallback--faint);
+ --lightText: var(--selectedMenuPopoverLightText, $fallback--lightText);
+ --icon: var(--selectedMenuPopoverIcon, $fallback--icon);
+ i {
+ color: var(--selectedMenuPopoverIcon, $fallback--icon);
+ }
+ }
+
+ }
+}
+</style>