Skip to content

Commit 09c43e5

Browse files
committed
Fix anchor navigation offset for fixed header
1 parent 08a18af commit 09c43e5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

core/src/main/resources/lib/layout/layout.jelly

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ THE SOFTWARE.
115115
<j:if test="${attrs.nogrid==null or attrs.nogrid.equals(false)}">
116116
<link rel="stylesheet" href="${resURL}/css/responsive-grid.css" type="text/css" />
117117
</j:if>
118+
<style>
119+
/*
120+
* Prevent anchor targets from being hidden behind the fixed Jenkins header
121+
* See: https://github.com/jenkinsci/jenkins/issues/16803
122+
*/
123+
:target {
124+
scroll-margin-top: 4rem;
125+
}
126+
</style>
118127
<j:if test="${attrs.css!=null}">
119128
<link rel="stylesheet" href="${resURL}${attrs.css}" type="text/css" />
120129
</j:if>

core/src/main/resources/lib/layout/skeleton/skeleton.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,3 @@ body:has(.jenkins-form-skeleton) {
9595
margin: 0 !important;
9696
}
9797
}
98-
/*
99-
* Prevent anchor targets from being hidden behind the Jenkins header
100-
* See: https://github.com/jenkinsci/jenkins/issues/16803
101-
*/
102-
[id] {
103-
scroll-margin-top: 4rem;
104-
}

0 commit comments

Comments
 (0)