Skip to content

docs(ui): add animated underline for nav tabs#21912

Merged
sebslight merged 1 commit intomainfrom
docs/ui-animated-nav-underline
Feb 20, 2026
Merged

docs(ui): add animated underline for nav tabs#21912
sebslight merged 1 commit intomainfrom
docs/ui-animated-nav-underline

Conversation

@sebslight
Copy link
Copy Markdown
Member

@sebslight sebslight commented Feb 20, 2026

Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

  • Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
    element, including transitions, positioning, and dark mode color.
  • Hide default first h1 in #content to keep header layout consistent.
  • Add docs/nav-tabs-underline.js to create and manage the underline
    element, observe DOM mutations, and update underline position/width on
    changes, resize, and when fonts load.
  • Preserve last known underline position/width across re-initializations
    to avoid visual jumps.

Greptile Summary

Adds a polished animated underline indicator for navigation tabs in the documentation. Implemented via CSS custom properties for smooth positioning transitions and a JavaScript module that tracks active tab state using MutationObservers. The underline animates smoothly when switching tabs and preserves position across DOM re-initializations to prevent visual jumps.

Key changes:

  • Created nav-tabs-underline.js with observers to track active tab and update underline position/width
  • Added CSS in style.css for the underline element with 260ms transitions and dark mode support
  • Hides default navigation underlines by setting .nav-tabs-item > div opacity to 0
  • Handles edge cases: resize events, font loading, and DOM mutations

The implementation is clean and uses modern JavaScript patterns. One minor suggestion about observer cleanup in SPA contexts.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are purely additive (new files only) and implement a straightforward UI enhancement. The code is well-structured, uses modern JavaScript patterns appropriately, and handles edge cases like resize and font loading. The CSS is clean with no conflicts. The only suggestion is a minor best practice about observer cleanup in SPA contexts, which doesn't affect current functionality.
  • No files require special attention

Last reviewed commit: 2a6981a

Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.
@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Feb 20, 2026
@sebslight sebslight merged commit 1b886e7 into main Feb 20, 2026
24 checks passed
@sebslight sebslight deleted the docs/ui-animated-nav-underline branch February 20, 2026 14:33
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +86 to +95
const rootObserver = new MutationObserver(setupObservers);

if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", () => {
setupObservers();
rootObserver.observe(document.body, { childList: true, subtree: true });
});
} else {
setupObservers();
rootObserver.observe(document.body, { childList: true, subtree: true });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider storing rootObserver cleanup logic if script might be reloaded in SPA context to prevent potential memory leaks from multiple observers.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/nav-tabs-underline.js
Line: 86-95

Comment:
Consider storing `rootObserver` cleanup logic if script might be reloaded in SPA context to prevent potential memory leaks from multiple observers.

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Protocol-zero-0 added a commit to Protocol-zero-0/openclaw that referenced this pull request Feb 20, 2026
Introduced by openclaw#21912 — needed to unblock CI for all open PRs.

Co-authored-by: Cursor <[email protected]>
Protocol-zero-0 added a commit to Protocol-zero-0/openclaw that referenced this pull request Feb 20, 2026
Introduced by openclaw#21912 — needed to unblock CI for all open PRs.

Co-authored-by: Cursor <[email protected]>
Protocol-zero-0 added a commit to Protocol-zero-0/openclaw that referenced this pull request Feb 20, 2026
Introduced by openclaw#21912 — needed to unblock CI for all open PRs.

Co-authored-by: Cursor <[email protected]>
Protocol-zero-0 added a commit to Protocol-zero-0/openclaw that referenced this pull request Feb 20, 2026
Introduced by openclaw#21912 — needed to unblock CI for all open PRs.

Co-authored-by: Cursor <[email protected]>
Protocol-zero-0 added a commit to Protocol-zero-0/openclaw that referenced this pull request Feb 20, 2026
Introduced by openclaw#21912 — needed to unblock CI for all open PRs.

Co-authored-by: Cursor <[email protected]>
Protocol-zero-0 added a commit to Protocol-zero-0/openclaw that referenced this pull request Feb 20, 2026
Introduced by openclaw#21912 — needed to unblock CI for all open PRs.

Co-authored-by: Cursor <[email protected]>
rodrigogs pushed a commit to rodrigogs/openclaw that referenced this pull request Feb 20, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.
Hansen1018 added a commit to Hansen1018/openclaw that referenced this pull request Feb 21, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.
vincentkoc pushed a commit that referenced this pull request Feb 21, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.
dgarson pushed a commit to dgarson/clawdbot that referenced this pull request Feb 21, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.
mmyyfirstb pushed a commit to mmyyfirstb/openclaw that referenced this pull request Feb 21, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.
obviyus pushed a commit to guirguispierre/openclaw that referenced this pull request Feb 22, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.

(cherry picked from commit 1b886e7)
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.

(cherry picked from commit 1b886e7)
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
Add a responsive, animated underline indicator for navigation tabs to
improve visual focus and active-state feedback.

- Introduce CSS for .nav-tabs, .nav-tabs-item and a .nav-tabs-underline
  element, including transitions, positioning, and dark mode color.
- Hide default first h1 in #content to keep header layout consistent.
- Add docs/nav-tabs-underline.js to create and manage the underline
  element, observe DOM mutations, and update underline position/width on
  changes, resize, and when fonts load.
- Preserve last known underline position/width across re-initializations
  to avoid visual jumps.

This change makes active tab state visible with smooth movement and
ensures the underline stays synchronized with dynamic content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant