8000 Clone button enhancements (#33362) · GiteaBot/gitea@cb4b170 · GitHub
[go: up one dir, main page]

Skip to content

Commit cb4b170

Browse files
silverwindwxiaoguang
authored andcommitted
Clone button enhancements (go-gitea#33362)
- Add box-shadow to default tippy theme - Make colors for tabs match the ones from `.ui.tabular.menu` - Remove tippy arrow and slightly offset tooltip closer to the button - Fix setting of `aria-haspopup` when default role is used with tippy --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 parent 12347f0 commit cb4b170

File tree

5 files changed

+12
-4
lines changed
  • web_src
    • css
      • modules
  • repo
  • js
  • 5 files changed

    +12
    -4
    lines changed

    web_src/css/modules/tippy.css

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -28,6 +28,10 @@
    2828
    z-index: 1;
    2929
    }
    3030

    31+
    .tippy-box[data-theme="default"] {
    32+
    box-shadow: 0 6px 18px var(--color-shadow);
    33+
    }
    34+
    3135
    /* bare theme, no styling at all, except box-shadow */
    3236
    .tippy-box[data-theme="bare"] {
    3337
    border: none;

    web_src/css/repo.css

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1669,7 +1669,7 @@ td .commit-summary {
    16691669
    }
    16701670

    16711671
    .repo-button-row-left {
    1672-
    flex: 1;
    1672+
    flex-grow: 1;
    16731673
    }
    16741674

    16751675
    .repo-button-row .button {

    web_src/css/repo/clone.css

    Lines changed: 3 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -20,10 +20,12 @@
    2020
    .clone-panel-tab .item {
    2121
    padding: 5px 10px;
    2222
    background: none;
    23+
    color: var(--color-text-light-2);
    2324
    }
    2425

    2526
    .clone-panel-tab .item.active {
    26-
    border-bottom: 3px solid var(--color-secondary);
    27+
    color: var(--color-text-dark);
    28+
    border-bottom: 3px solid currentcolor;
    2729
    }
    2830

    2931
    .clone-panel-tab + .divider {

    web_src/js/features/repo-common.ts

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -99,6 +99,7 @@ function initClonePanelButton(btn: HTMLButtonElement) {
    9999
    placement: 'bottom-end',
    100100
    interactive: true,
    101101
    hideOnClick: true,
    102+
    arrow: false,
    102103
    });
    103104
    }
    104105

    web_src/js/modules/tippy.ts

    Lines changed: 3 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -42,16 +42,17 @@ export function createTippy(target: Element, opts: TippyOpts = {}): Instance {
    4242
    visibleInstances.add(instance);
    4343
    return onShow?.(instance);
    4444
    },
    45-
    arrow: arrow || (theme === 'bare' ? false : arrowSvg),
    45+
    arrow: arrow ?? (theme === 'bare' ? false : arrowSvg),
    4646
    // HTML role attribute, ideally the default role would be "popover" but it does not exist
    4747
    role: role || 'menu',
    4848
    // CSS theme, either "default", "tooltip", "menu", "box-with-header" or "bare"
    4949
    theme: theme || role || 'default',
    50+
    offset: [0, arrow ? 10 : 6],
    5051
    plugins: [followCursor],
    5152
    ...other,
    5253
    } satisfies Partial<Props>);
    5354

    54-
    if (role === 'menu') {
    55+
    if (instance.props.role === 'menu') {
    5556
    target.setAttribute('aria-haspopup', 'true');
    5657
    }
    5758

    0 commit comments

    Comments
     (0)
    0