-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix anchor links being obscured by header #26103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8211c2b
ad554ee
b559888
37e1cd9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -115,6 +115,15 @@ THE SOFTWARE. | |||||||||||||||||||
| <j:if test="${attrs.nogrid==null or attrs.nogrid.equals(false)}"> | ||||||||||||||||||||
| <link rel="stylesheet" href="${resURL}/css/responsive-grid.css" type="text/css" /> | ||||||||||||||||||||
| </j:if> | ||||||||||||||||||||
| <style> | ||||||||||||||||||||
| /* | ||||||||||||||||||||
| * Prevent anchor targets from being hidden behind the fixed Jenkins header | ||||||||||||||||||||
| * See: https://github.com/jenkinsci/jenkins/issues/16803 | ||||||||||||||||||||
| */ | ||||||||||||||||||||
| :target { | ||||||||||||||||||||
| scroll-margin-top: 4rem; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| </style> | ||||||||||||||||||||
|
Comment on lines
+118
to
+126
|
||||||||||||||||||||
| <style> | |
| /* | |
| * Prevent anchor targets from being hidden behind the fixed Jenkins header | |
| * See: https://github.com/jenkinsci/jenkins/issues/16803 | |
| */ | |
| :target { | |
| scroll-margin-top: 4rem; | |
| } | |
| </style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scroll-margin-top: 4remis smaller than the current header height (--header-height: 4.125reminsrc/main/scss/abstracts/_theme.scss), so anchor targets can still end up partially obscured (e.g., due to the extra 0.125rem plus border/rounding/zoom). Use the existing CSS variable (e.g.,var(--header-height)or an appropriatecalc(...)) instead of a hard-coded value so this stays correct if the header height changes.