-
Notifications
You must be signed in to change notification settings - Fork 4.8k
UI/Badge: none intent has no contrast against surface-neutral backgrounds #76321
Copy link
Copy link
Closed
Closed
Copy link
Labels
Design SystemIssues related to the system of combining components according to best practices.Issues related to the system of combining components according to best practices.Needs Design FeedbackNeeds general design feedback.Needs general design feedback.[Package] UI/packages/ui/packages/ui[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Metadata
Metadata
Assignees
Labels
Design SystemIssues related to the system of combining components according to best practices.Issues related to the system of combining components according to best practices.Needs Design FeedbackNeeds general design feedback.Needs general design feedback.[Package] UI/packages/ui/packages/ui[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
💫 Done
The
Badgecomponent withintent="none"(the default) uses--wpds-color-bg-surface-neutral(#f8f8f8) as its background color. When this badge is rendered inside a container that also usessurface-neutralas its background, the badge becomes visually indistinguishable from its surroundings because the background values are identical.The badge text (
#6d6d6d) is still readable, but without any visible badge boundary, it just looks like floating gray text rather than a badge element. The pill shape and visual containment that a badge is supposed to provide are lost.Steps to reproduce
Badgewithintent="none"(or no intent, sincenoneis the default) inside a container with asurface-neutralbackground.Expected behavior
The badge should be visually distinct from its container regardless of the background it's placed on. The pill shape should be perceivable.
Possible solutions
A few options to consider:
noneintent (e.g.--wpds-color-bg-surface-neutral-weakat#f0f0f0). The trade-off here is that the problem will still occur when badges are rendered onneutral-weak, so I'd rule this out.cc @WordPress/gutenberg-components