Skip to content

feat(tabs): add nav variant - #7924

Merged
mcoker merged 5 commits into
patternfly:mainfrom
srambach:7911-tabs-nav-variant
Oct 27, 2025
Merged

mcoker merged 5 commits into
patternfly:mainfrom
srambach:7911-tabs-nav-variant

Conversation

@srambach

Copy link
Copy Markdown
Member

Fixes #7911

Also has the old fashioned non-animated tab marker use the tab decoration color that the newer animated version uses.

@patternfly-build

patternfly-build commented Oct 23, 2025 •

Copy link
Copy Markdown
Collaborator

@srambach
srambach requested a review from mcoker October 23, 2025 15:47

@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 default accent colors broke. Otherwise just a couple of small nits that you did right but the POC code was incorrect.

@@ -125,7 +125,7 @@ $pf-v6-c-tabs--spacer-map: build-spacer-map("none", "sm", "md", "lg", "xl", "2xl
--#{$tabs}__link--after--BorderBlockStartWidth: 0;
--#{$tabs}__link--after--BorderInlineEndWidth: 0;
--#{$tabs}__link--after--BorderInlineStartWidth: 0;
--#{$tabs}__item--m-current__link--after--BorderColor: var(--pf-t--global--border--color--clicked);
--#{$tabs}__item--m-current__link--after--BorderColor: var(--#{$tabs}--link-accent--color);

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 this broke the existing accent borders since these vars now look to be defined by one another.

I don't think we have to fix this in this issue if that part is tricky. We can just theme --pf-v6-c-tabs__item--m-current__link--after--BorderColor instead, which will apply to both animated and default tabs.

@@ -205,6 +205,12 @@ $pf-v6-c-tabs--spacer-map: build-spacer-map("none", "sm", "md", "lg", "xl", "2xl
--#{$tabs}__add--PaddingInlineStart: var(--pf-t--global--spacer--sm);
--#{$tabs}__add--PaddingInlineEnd: var(--pf-t--global--spacer--sm);

// Nav variant
--#{$tabs}--m-nav--inset: var(--pf-t--global--spacer--xl);
--#{$tabs}--m-nav__link-accent--color: var(--pf-t--color--red--50);

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.

in the designs, buttons and other tabs are also red, which looks like a separate theme or maybe a change to the brand color tokens. I'd say we can take this out of the default component (and https://github.com/srambach/patternfly/blob/e613d7842f53406daee5d83df3fbeb5e3d676e14/src/patternfly/components/Tabs/tabs.scss#L522) and set this as an override/theme in the demos and mention it in compass docs on how to style it.

Image Image

@@ -205,6 +205,12 @@ $pf-v6-c-tabs--spacer-map: build-spacer-map("none", "sm", "md", "lg", "xl", "2xl
--#{$tabs}__add--PaddingInlineStart: var(--pf-t--global--spacer--sm);
--#{$tabs}__add--PaddingInlineEnd: var(--pf-t--global--spacer--sm);

// Nav variant
--#{$tabs}--m-nav--inset: var(--pf-t--global--spacer--xl);

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.

@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.

LGTM!

Your last commit allowed setting --#{$tabs}--link-accent--color on regular and animated tabs to theme the accent color, but we lost the ability to set either --#{$tabs}__item--m-current__link--after--BorderColor or --#{$tabs}__item--m-current__link--after--BorderColor on animated tabs to theme it. Since those worked before this change, and would have likely been how someone had themed that accent color, that's breaking.

Pushed an update to address that. It's basically just the way the CSS was originally for the accent color, but now the non-animated tabs use --link-accent--color, so you can set any of those 3 vars above on both animated and non-animated tabs and it themes the accent color.

@mcoker
mcoker merged commit 1a9a98c into patternfly:main Oct 27, 2025
4 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.5.0-prerelease.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

edonehoo pushed a commit to edonehoo/patternfly that referenced this pull request Nov 11, 2025
* feat(tabs): add nav variant

* feat(tabs): fix circular reference

* feat(tabs): remove custom color and inset per comments

* chore: update vars

* chore: move example under other nav example

---------

Co-authored-by: mcoker <[email protected]>
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.

Tabs - nav variant

3 participants