Skip to content

Invert tab backgrounds - #632

Merged
flacoman91 merged 12 commits into
mainfrom
rad-tabs-inverted
Aug 4, 2026
Merged

Invert tab backgrounds#632
flacoman91 merged 12 commits into
mainfrom
rad-tabs-inverted

Conversation

@flacoman91

@flacoman91 flacoman91 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

invert tab backgrounds for pages that need it, like CCDB
Fixed the faint line under active tabs (worse on mobile):
Root cause — heading-4 still added a 10px bottom margin at xs, so the tablist rule sat in a gap below the tab fills.
parent border-bottom didn’t cover cleanly under the active tab; switched to an inset box-shadow, opaque active fills, and zeroed that mobile margin.

Extras — focus ring outline-offset: 2px;

removed unused eslint-disables in SelectMulti.

Flips active/inactive tab fills (active white, inactive gray-5) without changing default link styles on inactive tabs.
Inactive tabs were only getting the gray fill; keep a gray-40 border on all sides while the active tab still opens into the panel.
Adjacent 1px borders were stacking into a thicker seam; pull following tabs left by 1px and raise the active tab.
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-04 23:41 UTC

Comment thread src/components/tabs/tab.scss Outdated
button.tab {
background: var(--gray-5);
border-color: var(--gray-40);
margin-left: -1px;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Double-check that the focus rectangles aren't shifted by 1px.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch.
Screenshot 2026-07-30 at 12 05 02 PM
Screenshot 2026-07-30 at 12 04 54 PM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would add an outline-offset: 2px; too. You can tab through the footer links on cf.gov in the mobile screen width to see what I mean. Those deal with the same overlapping borders issue. IIRC, the first item is technically 1px taller than the others when inspected, but visually they are the same height (because the first item "owns" two borders, whereas the rest only "own" one).

Screenshot 2026-07-31 at 6 00 37 PM

Raise :focus-visible above neighboring tabs and use a positive outline-offset so the ring isn’t eaten by the shared side border.
Drop gray/white fills and inactive borders; inverted now matches default tab chrome with no backgrounds.
Transparent fills were letting the list bottom border show through; cover that 1px so the active tab has no underline into the panel.
App bundles can let equal-specificity button/tab background rules win; force transparent fills on tablist--inverted.
@flacoman91

Copy link
Copy Markdown
Collaborator Author

Seeing faint line in this inverted variant. It's really obvious on mobile.

Screenshot_20260801_073336_Chrome Screenshot_20260801_073344_Chrome

@natalia-fitzgerald

Copy link
Copy Markdown
Collaborator

@flacoman91
I noticed this faint line. Is it possible that it is also on the standard variant too and that it isn't noticeable because the background there is gray?

@flacoman91

Copy link
Copy Markdown
Collaborator Author

@natalia-fitzgerald I've updated it and the line shouldn't be visible.

@flacoman91
flacoman91 enabled auto-merge (squash) August 4, 2026 23:35
@natalia-fitzgerald
natalia-fitzgerald self-requested a review August 4, 2026 23:40

@natalia-fitzgerald natalia-fitzgerald left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@flacoman91 - Looks great!

@flacoman91
flacoman91 merged commit fe94ab8 into main Aug 4, 2026
3 checks passed
@flacoman91
flacoman91 deleted the rad-tabs-inverted branch August 4, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants