From 4a5a4077af02c395eaa13ec65bc262ced5a8ce7e Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Wed, 2 Nov 2022 14:42:00 +0530 Subject: [PATCH] chore: improvements to tooltips and popovers --- .../hoppscotch-app/assets/scss/styles.scss | 102 ++++++++++-------- .../src/components/app/Header.vue | 24 ++--- .../src/components/http/Request.vue | 39 ++++--- .../editor/extensions/HoppEnvironment.ts | 11 +- .../src/helpers/editor/themes/baseTheme.ts | 8 +- packages/hoppscotch-app/src/modules/tippy.ts | 6 +- 6 files changed, 111 insertions(+), 79 deletions(-) diff --git a/packages/hoppscotch-app/assets/scss/styles.scss b/packages/hoppscotch-app/assets/scss/styles.scss index 97f3f3cb6..4da6bc012 100644 --- a/packages/hoppscotch-app/assets/scss/styles.scss +++ b/packages/hoppscotch-app/assets/scss/styles.scss @@ -138,63 +138,79 @@ a { } } -.tippy-box[data-theme="tooltip"] { +.tippy-box[data-theme~="tooltip"] { @apply bg-tooltip; - @apply text-primary; - @apply font-semibold; - @apply py-1 px-2; + @apply border-solid border-tooltip; @apply rounded; - @apply truncate; @apply shadow; - @apply leading-normal; - @apply items-center; - font-size: 86%; - kbd { - @apply hidden; - @apply font-sans; - @apply bg-gray-500/45; - @apply text-primaryLight; - @apply rounded-sm; - @apply px-1; - @apply my-0 ml-1; + .tippy-content { + @apply flex; + @apply text-tiny text-primary; + @apply font-semibold; + @apply py-1 px-2; @apply truncate; - @apply sm: inline-flex; - } - - .tippy-svg-arrow svg { - @apply fill-tooltip; - } - - .env-icon { - @apply inline-flex; + @apply leading-normal; @apply items-center; - @apply mr-1; - @apply text-accentDark; + + kbd { + @apply hidden; + @apply font-sans; + @apply bg-gray-500/45; + @apply text-primaryLight; + @apply rounded-sm; + @apply px-1; + @apply my-0 ml-1; + @apply truncate; + @apply sm: inline-flex; + } + + .env-icon { + @apply inline-flex; + @apply items-center; + @apply mr-1; + @apply text-accentDark; + } + } + + .tippy-svg-arrow { + svg:first-child { + @apply fill-tooltip; + } + + svg:last-child { + @apply fill-tooltip; + } } } -.tippy-box[data-theme="popover"] { - @apply flex flex-col; - @apply max-h-56; - @apply items-stretch; - @apply overflow-y-auto; +.tippy-box[data-theme~="popover"] { @apply bg-popover; - @apply text-secondary text-body; - @apply p-2; + @apply border-solid border-dividerDark; + @apply rounded; @apply shadow-lg; - @apply leading-normal; - @apply border border-dividerDark; - @apply focus: outline-none; - scroll-behavior: smooth; - .tippy-svg-arrow svg { - @apply fill-popover; + .tippy-content { + @apply flex flex-col; + @apply max-h-56; + @apply items-stretch; + @apply overflow-y-auto; + @apply text-secondary text-body; + @apply p-2; + @apply leading-normal; + @apply focus: outline-none; + scroll-behavior: smooth; } -} -.tippy-content { - @apply p-0; + .tippy-svg-arrow { + svg:first-child { + @apply fill-dividerDark; + } + + svg:last-child { + @apply fill-popover; + } + } } [data-v-tippy] { diff --git a/packages/hoppscotch-app/src/components/app/Header.vue b/packages/hoppscotch-app/src/components/app/Header.vue index 6922c04bd..1c3e07511 100644 --- a/packages/hoppscotch-app/src/components/app/Header.vue +++ b/packages/hoppscotch-app/src/components/app/Header.vue @@ -100,18 +100,6 @@ " />