-
Notifications
You must be signed in to change notification settings - Fork 156
Badge enhancements: Add dot property, improved outline, and WCAG AA compliance #16309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
* ``` | ||
*/ | ||
@Input() | ||
public size: string | IgxBadgeSize = IgxBadgeSize.MEDIUM; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Unlike the igx-avatar
, where the size
input is about to be deprecated, the size of components is now driven entirely by css variables coming from the igniteui-theming dependency. The size definitions should be created in the igniteui-theming
repository and then the component should consume the new size tokens in it's component theme. There shouldn't be a size
input in the component definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit 0efce73. Removed the size
input property and IgxBadgeSize
enum. Badge sizing is now controlled entirely by CSS variables (--ig-size
) from the igniteui-theming dependency, following the same pattern as other components.
WARNING: 'warning', | ||
ERROR: 'error' | ||
ERROR: 'error', | ||
DOT: 'dot' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Any of the previous types of badges can also be a dot
badge - displaying just as a dot, instead of showing a value, but preserving all other badge type functionality. The dot type should be set separately through a boolean input indicating whether, for example, a success badge is a dot or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit 0efce73. Changed dot
from a type to a boolean input property. Any badge type (primary, info, success, warning, error) can now be displayed as a dot by setting the dot
property. Example: <igx-badge dot type="success"></igx-badge>
…operty Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Overview
This PR implements comprehensive enhancements to the
igx-badge
component based on the latest design handoff specifications. The changes introduce a dot property for minimal badge indicators, improved outline rendering, and accessibility improvements to ensure WCAG AA compliance across all themes.Key Changes
1. Dot Property
Introduced a new boolean
dot
property that works with any badge type for status indicators:dot
as a boolean input property2. Improved Outline Implementation
Replaced the border-based outline with a proper CSS outline that doesn't affect internal sizing:
Before:
box-shadow: inset 0 0 0 2px var(--border-color)
After:
outline: 2px solid var(--border-color); outline-offset: -2px
This approach ensures the outline is rendered outside the badge content area without affecting padding or internal element positioning. Theme-specific outline widths are maintained (2px for Material/Fluent/Indigo, 1px for Bootstrap).
3. WCAG AA Accessibility Improvements
Updated foreground colors for colored badge variants to meet WCAG AA contrast requirements:
All colored badge types (info, success, warning, error) now use white text and icons to ensure proper contrast ratios.
4. CSS Variable-Driven Sizing
Badge sizing is now controlled entirely by CSS variables from the igniteui-theming dependency:
--ig-size
CSS variable for size control5. Theme Compatibility
All enhancements work consistently across all 4 themes:
API Changes
New Dot Property
Sample Application
Enhanced the badge sample with comprehensive examples:
Testing
Breaking Changes
None. All changes are backward compatible. Existing badge implementations continue to work unchanged, with new features being opt-in via properties.
Documentation
Fixes #16276
Original prompt
Fixes #16276
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.