Skip to content

Commit 2196ba5

Browse files
GiteaBotsilverwindwxiaoguang
authored
Clone button enhancements (#33362) (#33404)
Backport #33362 by @silverwind - 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 <img width="335" alt="image" src="https://github.com/user-attachments/assets/8633ebac-a43f-457a-86bd-7a88a83519ee" /> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 parent 12347f0 commit 2196ba5

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

web_src/css/modules/tippy.css

+4
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

+1-1
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

+3-1
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

+1
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

+3-2
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)