feat(tabs): redesign (#DS-4761)#1762
Conversation
|
Visit the preview URL for this PR (updated for commit 663c1af): https://koobiq-next--prs-1762-s009mykw.web.app (expires Sun, 26 Jul 2026 14:47:06 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c |
🚨 E2E tests failedReview the report for details. 💡 Comment |
|
/approve-snapshots |
|
🔄 Updating snapshots. |
|
✅ Snapshots updated! |
There was a problem hiding this comment.
Pull request overview
This PR implements a visual redesign for the Tabs “underlined” variant, updating SCSS tokens/styles and adjusting TypeScript underline positioning logic so the active/hover underlines align to the tab content area (including new first-tab alignment behavior).
Changes:
- Updated underlined-mode styling: focus area geometry, hover underline pseudo-element, icon-only sizing/margins, and first-tab negative margin alignment.
- Adjusted active underline positioning calculations in
KbqTabHeaderandKbqTabNavBarto align the underline with content (not padding box). - Added unit tests validating the new active underline offset calculations.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/components/tabs/tabs-tokens.scss | Adds a new token for underlined icon-only tab sizing. |
| packages/components/tabs/tab-nav-bar.ts | Adjusts active underline width/left calculations for underlined nav bar. |
| packages/components/tabs/tab-nav-bar.spec.ts | Adds unit tests for nav bar active underline offset calculations. |
| packages/components/tabs/tab-header.spec.ts | Adds unit tests for tab header active underline offset calculations (incl. icon-only handling). |
| packages/components/tabs/tab-header.scss | Removes border radius in underlined mode. |
| packages/components/tabs/tab-header.component.ts | Adjusts active underline width/left calculations for tab header (incl. icon-only handling). |
| packages/components/tabs/_tabs-theme.scss | Adds hover-state styling to drive the new hover underline behavior. |
| packages/components/tabs/_tabs-common.scss | Refactors underlined-mode layout/pseudo-elements (focus inset, hover bar, icon-only sizing, first-tab alignment, underline radius). |
| packages/components-dev/tabs/module.ts | Adds the underlined example to the dev tabs showcase (but currently imports it from dist). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
🚨 E2E tests failedReview the report for details. 💡 Comment |
🚨 E2E tests failedReview the report for details. 💡 Comment |
|
/approve-snapshots |
|
🔄 Updating snapshots. |
|
✅ Snapshots updated! |
🚨 E2E tests failedReview the report for details. 💡 Comment |
|
/approve-snapshots |
|
🔄 Updating snapshots. |
|
✅ Snapshots updated! |
Summary
Tabs underlined variant - visual redesign
List of notable changes:
Layout
padding: 14pxoverrides for underlined tab items; horizontal padding now derives uniformly from--kbq-tabs-size-tab-item-padding-horizontal(12px) minus the focus outline width (2px).kbq-tab-list__contenttokenised from hardcoded8pxtovar(--kbq-size-s).kbq-tab-headerborder-radiusremoved in underlined modeIcon-only tabs
margin-inlinereduced globally from6px(--kbq-size-xs) to4px(--kbq-size-xxs)32pxto28pxvia new--kbq-tabs-size-tab-item-underlined-icon-only-sizetoken (calc(32px - 4px)), keeping the total header height at 48pxFirst tab alignment
padding-left: 0on:first-childwithmargin-inline-start: -12px(text tabs) /0(icon-only). Negative margin preserves the full padding on the element so the focus ring can extend beyond the container edge, whilepadding-left: 0would have clipped it underoverflow: hiddenHover underline
::afterpseudo-element on each underlined text/icon+text tab: 3px bar pinned to the separator, colouredvar(--kbq-line-contrast-fade)on hover, suppressed on the selected tab (active underline div takes over)left/rightoffsets are content-aligned —calc(padding-horizontal - border-width)— so hover and active underlines have identical width and position::afterfor the same hover bar (overriding the non-underlined click-expander role, which for underlined is already covered by::before)Active underline positioning (TypeScript)
activeTabOffsetWidth/activeTabOffsetLeftinKbqTabHeader: icon-only uses fulloffsetWidth/ rawoffsetLeft; text tabs subtract/addTAB_PADDING(12px) to align the underline with the content area, not the padding boxKbqTabNavBar(previously returned rawoffsetWidth/offsetLeftwith no adjustment)selectedIndex === 0special-casing removed — with negativemargin-inline-startthe first tab'soffsetLeftis negative, soleft + TAB_PADDINGresolves correctly for all positions uniformly