Update badge icon 1.3.0#3576
Conversation
❌ Deploy Preview for boosted failed. Why did it fail? →
|
✅ Deploy Preview for boosted ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates the badge-icon component to align with the newer design tokens (system tokens 2.4.0) and the “Update badge - icon 1.3” spec, including new icon assets and additional supported sizes.
Changes:
- Added xsmall and small size variants for badge-icon documentation and styling.
- Reworked functional status badge-icon rendering to use new SVG mask assets (including a two-layer warning icon) and updated padding tokens.
- Added new badge icon SVG token assets per brand and updated Bundlewatch thresholds to reflect the CSS size increase.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| site/src/content/docs/components/badges.mdx | Updates badge-icon docs/examples for new sizes and disabled/variant states. |
| scss/_badges.scss | Refactors badge-icon styling (new size vars, status variant mixin, mask-based icons). |
| packages/sosh/scss/tokens/_composite.scss | Adds new badge icon SVG assets (positive/info/warning/negative). |
| packages/orange/scss/tokens/_composite.scss | Adds new badge icon SVG assets (positive/info/warning/negative). |
| packages/orange-compact/scss/tokens/_composite.scss | Adds new badge icon SVG assets (positive/info/warning/negative). |
| .bundlewatch.config.json | Updates max bundle sizes to accommodate CSS growth from new assets/styles. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I changed the styles of the |
| { | ||
| "path": "./packages/orange/dist/css/ouds-web.css", | ||
| "maxSize": "65.5 kB" | ||
| "maxSize": "66.75 kB" |
There was a problem hiding this comment.
Oooff, as they say...
242709f to
d85c591
Compare
|
Design review Figma : 👌 OK Design |
| @@ -1,46 +1,107 @@ | |||
| // | |||
| // Mixins | |||
There was a problem hiding this comment.
We used to have the mixins in a separate file in scss/mixins, don't know if we have to move it or not.
| &.badge-info { | ||
| --#{$prefix}badge-color: #{$ouds-color-content-on-status-info-emphasized}; | ||
| --#{$prefix}badge-background-color: #{$ouds-color-surface-status-info-emphasized}; | ||
| &.badge-positive:not(.badge-neutral, .badge-accent) { |
There was a problem hiding this comment.
I think where there is a variant class, we can safely remove :not(...)
| mask-image: escape-svg(var(--#{$prefix}badge-warning-icon)); | ||
| } | ||
| } | ||
| &.badge.badge-disabled { // Artificially increase the selector's weight to overwrite colors when badge is disabled |
There was a problem hiding this comment.
If above works, we can remove .badge in here
|
|
||
| // Badge | ||
| // badge-icon tick-confirmation-fill v1.6 | ||
| $badge-icon-positive: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><g clip-path='url(#a)'><path fill-rule='evenodd' d='M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0Zm5.878 6.363a1.054 1.054 0 0 0-1.485.142l-6.902 8.363-1.75-3.709a1.055 1.055 0 1 0-1.908.901l2.46 5.21a1.055 1.055 0 0 0 1.767.221l7.96-9.643a1.053 1.053 0 0 0-.142-1.485Z' clip-rule='evenodd'/></g><defs><clipPath id='a'><path fill='#fff' d='M0 0h24v24H0z'/></clipPath></defs></svg>") !default; |
There was a problem hiding this comment.
I don't understand why these icons are filled, we could have only the inside of them, here they are semi transparent, so it might lead to issues on a11y side, it's heavier, it makes us change the behavior of the badge ... not convinced, but I'd like to hear why this choice has been made on design side.
| height: var(--#{$prefix}badge-size); | ||
| padding: 0; | ||
|
|
||
| .badge-status-icon { |
There was a problem hiding this comment.
Could be outside of .badge-icon to lesser specificity
| .badge-xsmall:not(.badge-count) { | ||
| --#{$prefix}badge-size: #{px-to-rem($ouds-badge-size-xsmall)}; | ||
|
|
||
| &:not(:has(.badge-status-icon)) { |
There was a problem hiding this comment.
It feels tricky to me, I'd rather set it for everyone and remove the padding on .badge-icon:has(.badge-status-icon)
| } | ||
|
|
||
| .badge-icon { | ||
| font-size: calc(#{$ouds-badge-size-xsmall} - (2 * var(--#{$prefix}badge-padding-icon-xsmall))); |
There was a problem hiding this comment.
We could probably set a CSS var in this case
Types of change
Related issues
Closes #3541
Context & Motivation
Tokens update to 2.4.0
Description
Checklists
Checklist (for Core Team only)
Progression (for Core Team only)
ouds/mainfollowing conventional commitLive previews