Skip to content

fix(tabs): scope secondary variant CSS to prevent leaking into nested Tabs#6384

Merged
jrgarciadev merged 2 commits into
heroui-inc:v3.0.3from
Gdhanush-13:fix/tabs-nested-variant-inheritance
Apr 17, 2026
Merged

fix(tabs): scope secondary variant CSS to prevent leaking into nested Tabs#6384
jrgarciadev merged 2 commits into
heroui-inc:v3.0.3from
Gdhanush-13:fix/tabs-nested-variant-inheritance

Conversation

@Gdhanush-13

Copy link
Copy Markdown
Contributor

What

Fixes #6381

Problem

The secondary variant styles use descendant selectors (e.g. .tabs--secondary .tabs__tab) which leak into nested Tabs components that use a different variant. When a primary Tabs is nested inside a secondary Tabs, the inner tabs incorrectly inherit the secondary (underline) styling because their elements are still DOM descendants of the outer .tabs--secondary.

Root Cause

CSS descendant selectors in .tabs--secondary match ALL nested .tabs__tab, .tabs__list, .tabs__indicator, etc. elements regardless of which Tabs instance they belong to.

Fix

Scoped all secondary variant selectors through the direct child > .tabs__list-container. This correctly stops at the Tabs component boundary because nested Tabs have their own .tabs__list-container that is NOT a direct child of the outer .tabs--secondary.

Before: .tabs--secondary .tabs__list { ... }
After: .tabs--secondary > .tabs__list-container > .tabs__list { ... }

This is a CSS-only fix (9 insertions, 6 deletions in tabs.css).

… Tabs

The secondary variant styles used descendant selectors (e.g.
.tabs--secondary .tabs__tab) which leaked into nested Tabs
components with a different variant, because inner elements are
still descendants of the outer .tabs--secondary.

Fixed by scoping all secondary variant selectors through the direct
child > .tabs__list-container, which correctly stops at the Tabs
component boundary. Nested Tabs have their own .tabs__list-container
that is NOT a direct child of the outer .tabs--secondary.

Closes heroui-inc#6381
@Gdhanush-13 Gdhanush-13 requested a review from jrgarciadev as a code owner April 1, 2026 10:35
@vercel

vercel Bot commented Apr 1, 2026

Copy link
Copy Markdown

@Gdhanush-13 is attempting to deploy a commit to the HeroUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

@wingkwong wingkwong self-assigned this Apr 3, 2026
@vercel

vercel Bot commented Apr 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
heroui Ready Ready Preview, Comment Apr 12, 2026 2:19pm
heroui-sb Ready Ready Preview, Comment Apr 12, 2026 2:19pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Apr 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@heroui/react@6384
npm i https://pkg.pr.new/@heroui/styles@6384

commit: 2bff23a

@wingkwong wingkwong changed the base branch from v3 to v3.0.3 April 12, 2026 14:17
@wingkwong wingkwong modified the milestones: v2.8.11, v3.0.3 Apr 12, 2026
@wingkwong wingkwong removed their assignment Apr 12, 2026
@jrgarciadev jrgarciadev merged commit 93198d0 into heroui-inc:v3.0.3 Apr 17, 2026
8 checks passed
jrgarciadev added a commit that referenced this pull request Apr 17, 2026
* chore(deps): React Aria Upgrade (v1.17.0) (#6433)

* chore(deps): bump react-aria versions

* fix(toast): align ToastRegion queue with stately ToastQueue types

* refactor(react): apply subpaths to RAC

* feat(table): introduce Expandable Rows

* fix(tabs): scope secondary variant CSS to prevent leaking into nested Tabs (#6384)

* fix(tabs): scope secondary variant CSS to prevent leaking into nested Tabs

The secondary variant styles used descendant selectors (e.g.
.tabs--secondary .tabs__tab) which leaked into nested Tabs
components with a different variant, because inner elements are
still descendants of the outer .tabs--secondary.

Fixed by scoping all secondary variant selectors through the direct
child > .tabs__list-container, which correctly stops at the Tabs
component boundary. Nested Tabs have their own .tabs__list-container
that is NOT a direct child of the outer .tabs--secondary.

Closes #6381

* chore(styles): remove comment

---------

Co-authored-by: WK Wong <wingkwong.code@gmail.com>

* feat(hooks): add use-theme hook (#6426)

* feat(hooks): add use-theme hook

* feat(hooks): revise use-theme logic

* chore(docs): add dark mode section and include use-theme example

* fix(hooks): check custom theme before removing

* refactor(hooks): simplify useTheme to accept any theme name string

Remove ThemeProps constant and allow passing plain strings ("light",
"dark", "brutalism-light", etc.) directly to useTheme.

Made-with: Cursor

---------

Co-authored-by: Junior <jrgarciadev@gmail.com>

* feat: dom polymorphic utility and render-prop element customization (#6403)

* feat(utils): add dom polymorphic utility

* feat(card): enable render-prop element customization for card

* feat(card): enable render-prop element customization for card

* chore(react): export dom utility

* feat(alert): enable render-prop element customization

* feat(badge): enable render-prop element customization

* feat(chip): enable render-prop element customization

* feat(empty-state): enable render-prop element customization

* feat(fieldset): enable render-prop element customization

* feat(kbd): enable render-prop element customization

* feat(pagination): enable render-prop element customization

* feat(skeleton): enable render-prop element customization

* feat(spinner): enable render-prop element customization

* feat(switch-group): enable render-prop element customization

* feat(table): enable render-prop element customization

* feat(react): enable render-prop element customization

* chore(utils): add use client

* fix(calendar-year-picker): type issue

* chore(docs): add heroui's render prop in composition

* docs(native): add v1.0.2 release notes and update component API references (#6429)

* docs(native): update radio-group doc file with radio api ref

* docs(native): update portal ref with unstable_accessibilityContainerViewIsModal

* docs(native): update overlay portal api ref

* docs(native): add 1.0.2 release note

* fix(docs): broken link in migration guide (#6440)

* fix(utils): remove unexpected DOM element warning from render prop

Made-with: Cursor

* Revert "Merge remote-tracking branch 'origin/v3' into feat/HHTA-580"

This reverts commit 8f68adb, reversing
changes made to 226d179.

---------

Co-authored-by: Volodymyr Serbulenko <115154506+vvv-sss@users.noreply.github.com>
Co-authored-by: Stybo <84643947+Stybo@users.noreply.github.com>
Co-authored-by: Junior <jrgarciadev@gmail.com>

* feat(docs): v3.0.3 release note (#6435)

* feat(docs): add v3.0.3 meta

* feat(docs): add v3.0.3 synopsis

* feat(docs): add v3.0.3 release note (draft)

* docs(releases): remove NumberField PR #6417 from v3.0.3 release notes

Made-with: Cursor

---------

Co-authored-by: Junior <jrgarciadev@gmail.com>

* fix: restore files reverted by squash merge from feat/HHTA-580

The squash merge in #6403 included an accidental revert of the v3
merge, which undid the Apache License, Codex MCP examples, and other
docs changes. This restores all affected files to match v3.

Made-with: Cursor

* docs(releases): update useTheme example to use plain strings

Made-with: Cursor

* docs(releases): use Button component in useTheme example

Made-with: Cursor

* chore(docs): update pull id (#6442)

* docs(releases): mention Apache 2.0 license change in v3.0.3 notes

Made-with: Cursor

* docs(home): update hero badge to v3.0.3 release

Made-with: Cursor

* docs(releases): revise v3.0.3 notes and hero badge

- Highlight RAC 1.17 with 90% fewer deps in badge and intro
- Split expandable rows into its own section with demo
- Link RAC release notes in dependencies
- Remove stale NumberField references

Made-with: Cursor

* docs(home): fix spacing in hero badge title

Made-with: Cursor

* docs(home): capitalize Table in hero badge title

Made-with: Cursor

---------

Co-authored-by: WK <wingkwong.code@gmail.com>
Co-authored-by: Dhanush <122294583+Gdhanush-13@users.noreply.github.com>
Co-authored-by: Volodymyr Serbulenko <115154506+vvv-sss@users.noreply.github.com>
Co-authored-by: Stybo <84643947+Stybo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants