diff options
author | silverwind <me@silverwind.io> | 2022-08-09 14:37:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-09 14:37:34 +0200 |
commit | 1b2cd4c4e19c78390be329b4a3ad50ff8857ca8d (patch) | |
tree | c3c9af67b599f92af60c9cd5bb7feee056d97734 /web_src/less | |
parent | 36f9ee5813beba0fc4b394a5db636f76afc5cc38 (diff) | |
download | gitea-1b2cd4c4e19c78390be329b4a3ad50ff8857ca8d.tar.gz gitea-1b2cd4c4e19c78390be329b4a3ad50ff8857ca8d.zip |
Replace fomantic popup module with tippy.js (#20428)
- replace fomantic popup module with tippy.js
- fix chaining and add comment
- add 100ms delay to tooltips
- stopwatch improvments, raise default maxWidth
- update web_src/js/features/common-global.js
- use type=submit instead of js
Diffstat (limited to 'web_src/less')
-rw-r--r-- | web_src/less/_base.less | 39 | ||||
-rw-r--r-- | web_src/less/modules/tippy.less | 37 |
2 files changed, 35 insertions, 41 deletions
diff --git a/web_src/less/_base.less b/web_src/less/_base.less index dc518eea95..f2711c4482 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -155,6 +155,8 @@ --color-caret: var(--color-text-dark); --color-reaction-bg: #0000000a; --color-reaction-active-bg: var(--color-primary-alpha-20); + --color-tooltip-bg: #000000f0; + --color-tooltip-text: #ffffff; /* backgrounds */ --checkbox-mask-checked: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 -1 18 18" width="16" height="16"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>'); --checkbox-mask-indeterminate: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2 7.75A.75.75 0 012.75 7h10a.75.75 0 010 1.5h-10A.75.75 0 012 7.75z"></path></svg>'); @@ -1313,7 +1315,7 @@ footer { } .hide { - display: none; + display: none !important; &.show-outdated { display: none !important; @@ -1873,41 +1875,6 @@ a.ui.basic.label:hover { color: #f05133; /* from https://upload.wikimedia.org/wikipedia/commons/e/e0/Git-logo.svg */ } -.ui.popup { - background-color: var(--color-body); - color: var(--color-secondary-dark-6); - border-color: var(--color-secondary); -} - -.ui.popup::before { - box-shadow: 1px 1px 0 0 var(--color-secondary); -} - -.ui.bottom.popup::before, -.ui.top.popup::before, -.ui.right.center.popup::before, -.ui.left.center.popup::before { - background-color: var(--color-body); -} - -.ui.bottom.left.popup::before, -.ui.bottom.right.popup::before, -.ui.bottom.center.popup::before { - box-shadow: -1px -1px 0 0 var(--color-secondary); -} - -.ui.left.center.popup::before { - box-shadow: 1px -1px 0 0 var(--color-secondary); -} - -.ui.right.center.popup::before { - box-shadow: -1px 1px 0 0 var(--color-secondary); -} - -.ui.popup .ui.label { - margin-bottom: .4em; -} - .color-icon { display: inline-block; border-radius: 100%; diff --git a/web_src/less/modules/tippy.less b/web_src/less/modules/tippy.less index aa2aed6ce2..1fcd0372ce 100644 --- a/web_src/less/modules/tippy.less +++ b/web_src/less/modules/tippy.less @@ -1,9 +1,5 @@ /* styles are based on node_modules/tippy.js/dist/tippy.css */ -.tippy-box[data-animation="fade"][data-state="hidden"] { - opacity: 0; -} - [data-tippy-root] { max-width: calc(100vw - 10px); } @@ -15,7 +11,21 @@ border: 1px solid var(--color-secondary); border-radius: var(--border-radius); font-size: 1rem; - transition-property: transform, visibility, opacity; +} + +.tippy-box[data-theme="tooltip"] { + background-color: var(--color-tooltip-bg); + color: var(--color-tooltip-text); + border: none; +} + +.tippy-box[data-theme="menu"] { + background-color: none; + color: var(--color-tooltip-text); +} + +.tippy-box[data-theme="menu"] .ui.menu { + border: none; } .tippy-content { @@ -24,6 +34,14 @@ z-index: 1; } +.tippy-box[data-theme="tooltip"] .tippy-content { + padding: .5rem 1rem; +} + +.tippy-box[data-theme="menu"] .tippy-content { + padding: 0; +} + .tippy-box[data-placement^="top"] > .tippy-svg-arrow { bottom: 0; } @@ -82,3 +100,12 @@ .tippy-svg-arrow-inner { fill: var(--color-body); } + +.tippy-box[data-theme="tooltip"] .tippy-svg-arrow-inner, +.tippy-box[data-theme="tooltip"] .tippy-svg-arrow-outer { + fill: var(--color-tooltip-bg); +} + +.tippy-box[data-theme="menu"] .tippy-svg-arrow-inner { + fill: var(--color-menu); +} |