Skip to content

[EuiBadge] Add light badge variants via the fill prop #9300

@tkajtoch

Description

@tkajtoch

Summary

As part of the EuiBadge design update, we need to add support for light color variants activated via the new fill prop.

The fill prop should be optional, accept boolean values, and default to true since the existing badge colors are considered the filled variant. The light color variants can be found in the Figma file. The prop is named fill to match the EuiButton API.

Technical details

The light badge colors should be added to euiBadgeStyles and the euiBadgeColors function it uses to get the color values. Whenever fill = false the light colors should be used.

Color map

Color name (color prop) fill = true fill = false
default #5A6D8C #E3E8F2
primary #0B64DD #D9E8FF
accent #BD1F70 #FDDDE9
success #008A5E #C9F3E3
warning #FACB3D #FDE9B5
danger #BD271E #FDDDD8
risk #ED6723 #FFDEBF
neutral #1C8CB5 #CFEEF7
hollow
Includes a border
#FFFFFF #FFFFFF

Acceptance criteria

  • The fill?: boolean defaulting to true should be added to EuiBadgeProps
  • Styles should be updated to use light badge colors when fill = false
  • Tests and stories should be updated to fully cover the new functionality and the fill prop
  • A VRT test should be added to test all badge colors (fill = true and fill = false variants)
  • There should be no regressions in the high contrast mode
  • Both light and dark color schemes should be supported

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions