summaryrefslogtreecommitdiff
path: root/source/features/sticky-sidebar.css
blob: fbae49a12d94cc5e3fcf3222d8f4d04ae3e8ed90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
[rgh-sticky-sidebar-enabled] #js-repo-pjax-container ul.pagehead-actions,
/* https://github.com/refined-github/refined-github/issues/6761 */
[rgh-sticky-sidebar-enabled] [id^='my-forks-menu'] {
	z-index: initial !important; /* This affects the social buttons. It seems to have no effect but it constantly causes trouble with other features. */
}

/*
Have the calculations available even when the sidebar isn't sticky so that `--rgh-sticky-sidebar-offset` can be used via JS.

Exclusively use simple sums and use `0px` instead of `0`
 */
#partial-discussion-sidebar {
	--rgh-sticky-header-height: 60px;
	--rgh-sticky-sidebar-offset: calc(
		var(--rgh-sticky-header-height, 0px) +
			var(--rgh-sticky-notifitication-header-height, 0px)
	);
}

.notification-shelf ~ .application-main #partial-discussion-sidebar {
	--rgh-sticky-notifitication-header-height: 69px;
}

.rgh-sticky-sidebar {
	position: sticky;
	top: var(--rgh-sticky-sidebar-offset, 0) !important;

	/* `sticky` will trap the `fixed` dialog’s z-index in some sidebars #3732 */
	/* Higher than sticky readme header #4192 */
	z-index: 90;
}

#partial-discussion-sidebar.rgh-sticky-sidebar {
	z-index: 1;
}

/* Hides the last divider (on pull requests) to avoid https://user-images.githubusercontent.com/10238474/62282128-af6fb980-b457-11e9-8b18-c29687b88da1.gif */
.rgh-sticky-sidebar + .border-top {
	display: none;
}

/* Avoid z-index issue with Stars dropdown in repo header #5214 */
[rgh-sticky-sidebar-enabled] .pagehead-actions .js-user-list-menu {
	z-index: unset;
}

/* z-index fights 🥲 This is the search dropdown on the repo root #6151 */
html[rgh-sticky-sidebar-enabled]:has(.rgh-sticky-sidebar)
	.search-input.expanded
	.search-with-dialog {
	z-index: 95; /* Native: 35 */
}

html[rgh-sticky-sidebar-enabled]:has(.rgh-sticky-sidebar)
	.search-input.expanded
	.dark-backdrop {
	z-index: 92; /* Native: 32 */
}