-
Notifications
You must be signed in to change notification settings - Fork 160
feat(badge): design enhancement #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
Conversation
Co-authored-by: kdinev <[email protected]>
Co-authored-by: kdinev <[email protected]>
Co-authored-by: kdinev <[email protected]>
Co-authored-by: kdinev <[email protected]>
Co-authored-by: kdinev <[email protected]>
…operty Co-authored-by: kdinev <[email protected]>
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.
Pull Request Overview
This PR enhances igx-badge with a new dot variant, updates outline rendering to use CSS outlines, and adjusts colors to achieve WCAG AA contrast. Key updates also introduce CSS variable-driven sizing and expand samples, tests, and documentation.
- Add dot property with styling and tests
- Replace inset box-shadow outline with outline/outline-offset; update theme colors for contrast
- Use CSS variables for sizing; update samples and README
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/badge/badge.sample.ts | Adds dot control to the sample property panel; minor variant mapping edit |
| src/app/badge/badge.sample.scss | Updates sample layout and positions badges on avatars |
| src/app/badge/badge.sample.html | Adds interactive, dot, and type variant examples |
| projects/igniteui-angular/src/lib/core/styles/components/badge/_badge-theme.scss | Implements CSS variable sizing, outline using outline/offset, color contrast updates, and dot styles |
| projects/igniteui-angular/src/lib/core/styles/components/badge/_badge-component.scss | Wires the dot modifier to the dot placeholder styles |
| projects/igniteui-angular/src/lib/badge/badge.component.ts | Introduces the dot @input with HostBinding |
| projects/igniteui-angular/src/lib/badge/badge.component.spec.ts | Adds tests for dot initialization and with success type |
| projects/igniteui-angular/src/lib/badge/README.md | Documents the dot property and examples; mentions sizes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
projects/igniteui-angular/src/lib/core/styles/components/badge/_badge-theme.scss
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
All requested changes have been addressed.
Closes #16276
Overview
This PR implements comprehensive enhancements to the
igx-badgecomponent 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
dotproperty that works with any badge type for status indicators:dotas 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: -2pxThis 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-sizeCSS 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.