Skip to content

fix(tabs): update padding and subtab height - #8499

Merged
mcoker merged 8 commits into
patternfly:mainfrom
jcmill:bug/8253-tabs-update
Jul 30, 2026
Merged

fix(tabs): update padding and subtab height#8499
mcoker merged 8 commits into
patternfly:mainfrom
jcmill:bug/8253-tabs-update

Conversation

@jcmill

@jcmill jcmill commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #8253

Updates Tabs padding tokens and subtab.

  • Tab link padding switched to --pf-t--global--spacer--action--horizontal--plain--plain.
  • Subtab link padding updated with dedicated tokens using --pf-t--global--spacer--control--vertical--compactand --pf-t--global--spacer--action--horizontal--plain--default
  • Subtab row height matches regular tab height with or without scroll buttons
  • Scroll buttons render only in examples when tabs list is scrollable.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Tabs scrolling controls so navigation buttons render only when the tab list is scrollable.
    • Correctly shows disabled left/right controls at the start or end of scrollable tab lists.
    • Prevents hidden or extra scroll buttons from appearing in non-scrollable scenarios.
  • Style
    • Refreshed Tabs and subtabs spacing/padding and adjusted subtab typography for more consistent alignment and visual rhythm.

@jcmill
jcmill requested a review from mcoker July 15, 2026 12:55
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Tabs templates suppress scroll buttons for non-scrollable lists while retaining disabled-state handling. Tabs styling updates link spacing tokens and adds subtab padding and block-margin variables.

Changes

Tabs updates

Layer / File(s) Summary
Conditional scroll-button rendering
src/patternfly/components/Tabs/__tabs-list.hbs, src/patternfly/components/Tabs/__tabs-list-secondary.hbs
Both tab-list templates render left and right scroll buttons only when tabs are scrollable, while preserving no-button guards and disabled first/last button states.
Tab and subtab spacing styles
src/patternfly/components/Tabs/tabs.scss
Base tab links use updated spacer tokens; subtab links define explicit padding, font size, and margin-block values through the subtab modifier.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: lboehling, mcoker

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes align with #8253 by updating tab and subtab padding, preserving scroll button sizing, and hiding scroll buttons in non-scrollable cases.
Out of Scope Changes check ✅ Passed The modified Tabs templates and styles stay within the requested padding, height, and scroll-button scope.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows conventional commit format and accurately reflects the Tabs padding and subtab height changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@patternfly-build

patternfly-build commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Comment thread src/patternfly/components/Tabs/tabs.scss Outdated
Comment thread src/patternfly/components/Tabs/tabs.scss Outdated
@mcoker

mcoker commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Sorry just thought of this but we should verify with design if vertical tabs need any updates, too.

@jcmill jcmill changed the title Bug/8253 tabs update fix(tabs): update padding and subtab height Jul 20, 2026
@jcmill
jcmill requested a review from lboehling July 20, 2026 14:31
@jcmill
jcmill marked this pull request as ready for review July 20, 2026 14:31
@jcmill
jcmill requested a review from mcoker July 20, 2026 14:31

// Subtab link
--#{$tabs}--m-subtab__link--MarginBlock: calc(var(--pf-t--global--spacer--control--vertical--plain) - var(--pf-t--global--spacer--control--vertical--compact) + (var(--pf-t--global--font--size--body--default) * var(--pf-t--global--font--line-height--body) - 1lh) / 2);
--#{$tabs}--m-subtab__link--FontSize: var(--pf-t--global--font--size--xs);

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.

While we're here can you update this to use the more semantic token?

Suggested change
--#{$tabs}--m-subtab__link--FontSize: var(--pf-t--global--font--size--xs);
--#{$tabs}--m-subtab__link--FontSize: var(--pf-t--global--font--size--body--sm);


&.pf-m-subtab {
--#{$tabs}__link--FontSize: var(--#{$tabs}--m-subtab__link--FontSize);
--#{$tabs}__link--PaddingBlockStart: var(--#{$tabs}--m-subtab__link--PaddingBlockStart);

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.

Just an aside - stylelint prefers logical directions in this order.

block-start
block-end
inline-start
inline-end

The order of vars doesn't matter and isn't linted, so you can write them however makes the most sense to you, but when I write new vars, I try to do them in the same order as property declarations just because that's how I've come to expect them in the code.

--#{$tabs}__add--c-button--FontSize: var(--#{$tabs}--m-subtab__add--c-button--FontSize);

.#{$tabs}__link {
margin-block-start: var(--#{$tabs}--m-subtab__link--MarginBlock);

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.

typo

Suggested change
margin-block-start: var(--#{$tabs}--m-subtab__link--MarginBlock);
margin-block-start: var(--#{$tabs}--m-subtab__link--MarginBlockStart);

@mcoker mcoker left a comment

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.

Looks like a million bucks to me!

@lboehling lboehling left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm! the only thing i see off is that the plain icon buttons in the tabs with actions appear to be stretched vertically... but that appears on tabs as is (not introduced by this PR) so maybe can be handled in a follow up?

Image

@mcoker
mcoker merged commit d1ed5f2 into patternfly:main Jul 30, 2026
6 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.6.0-prerelease.25 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - Tabs updates

4 participants