Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/src/main/resources/lib/layout/layout.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scroll-margin-top: 4rem is smaller than the current header height (--header-height: 4.125rem in src/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 appropriate calc(...)) instead of a hard-coded value so this stays correct if the header height changes.

Suggested change
scroll-margin-top: 4rem;
scroll-margin-top: var(--header-height);

Copilot uses AI. Check for mistakes.
}
</style>
Comment on lines +118 to +126
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a global CSS rule via an inline <style> in layout.jelly. Since this affects every page and Jenkins already centralizes global layout styles in the compiled styles.css bundle (from src/main/scss/...), it would be more maintainable (and better for caching) to move this rule into the appropriate SCSS file (e.g. alongside the existing scroll/header rules in src/main/scss/base/_core.scss).

Suggested change
<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>

Copilot uses AI. Check for mistakes.
<j:if test="${attrs.css!=null}">
<link rel="stylesheet" href="${resURL}${attrs.css}" type="text/css" />
</j:if>
Expand Down
Loading