Skip to content

fix(ui): always apply inline-flex by default to Badge component#1466

Merged
edda merged 2 commits intomainfrom
edda-style-fix-badge
Feb 17, 2026
Merged

fix(ui): always apply inline-flex by default to Badge component#1466
edda merged 2 commits intomainfrom
edda-style-fix-badge

Conversation

@edda
Copy link
Contributor

@edda edda commented Feb 16, 2026

Summary

Always apply inline-flex to Badge component to enable flex alignment properties.

Problem

The Badge component has justify-center and items-center in its base styles, but these CSS properties only take effect when the element has display: flex or display: inline-flex. Previously, inline-flex was only applied conditionally when the icon prop was truthy, meaning badges without icons had ineffective alignment styles.

Changes Made

  • Added jn:inline-flex to badgeBaseStyles so it's always applied
  • Removed conditional ${icon ? "jn:inline-flex" : ""} from the render

Why This Is Safe

  • inline-flex still flows inline with surrounding text (like inline or inline-block)
  • The Badge is a <span>, so inline display is expected behavior
  • No breaking changes to the component API
  • All existing Badge tests pass

Related Issues

Testing Instructions

  • pnpm --filter @cloudoperators/juno-ui-components test Badge - 12 tests passing

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

@edda edda requested review from a team and franzheidl as code owners February 16, 2026 17:33
@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 7d6c821

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@cloudoperators/juno-ui-components Patch
@cloudoperators/juno-app-carbon Patch
@cloudoperators/juno-app-doop Patch
@cloudoperators/juno-app-example Patch
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-heureka Patch
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-template Patch
@cloudoperators/juno-messages-provider Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@edda edda linked an issue Feb 16, 2026 that may be closed by this pull request
4 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-17 14:43 UTC

@edda edda changed the title fix(ui): Badge - always apply inline-flex by default Fix(ui): Badge - always apply inline-flex by default Feb 16, 2026
@edda edda changed the title Fix(ui): Badge - always apply inline-flex by default fix(ui): always apply inline-flex by default to Badge component Feb 16, 2026
Copy link
Contributor

@guoda-puidokaite guoda-puidokaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, Thank You for the detail. 🚀

@edda edda merged commit 6b26feb into main Feb 17, 2026
17 of 19 checks passed
@edda edda deleted the edda-style-fix-badge branch February 17, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task](ui): Adjust Badge default styles for consistent rendering

3 participants