Skip to content
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

Badge: Enable usage inside typographic components #1547

Merged
merged 10 commits into from
Aug 6, 2024

Conversation

michaeltaranto
Copy link
Contributor

A Badge can now be nested inside typographic components, e.g. Text and Heading, as an inline element alongside text.
Previously a Badge had to be aligned against text using an Inline component, which would result in the Badge dropping below the text when the copy wrapped.

EXAMPLE USAGE:

<Text>
  Lorem ipsum velit in <Badge>amet</Badge>.
</Text>

@michaeltaranto michaeltaranto requested a review from a team as a code owner July 30, 2024 22:29
Copy link

changeset-bot bot commented Jul 30, 2024

🦋 Changeset detected

Latest commit: 904da1d

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

This PR includes changesets to release 1 package
Name Type
braid-design-system Minor

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

Copy link
Contributor

@askoufis askoufis left a comment

Choose a reason for hiding this comment

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

Is it worth updating the Badge vertical bleed docs, i.e. do we want encourage putting the badge in the heading rather than bleeding?

Also, is the badge meant to be vertically centered at all heading sizes? It doesn't appear to be the case.
EDIT: The screenshot below is of the apac theme. It's perfectly aligned in seekJobs.
image

@michaeltaranto
Copy link
Contributor Author

Good shout on the docs example. I have updated with the following
Docs preview

In terms of the position of the badge, because it is being used "inline" we are at the mercy of the line box created by the font itself as we are using vertical-align: middle. I have tweaked the spacing a touch to further improve across the current themes, plus added docs for this.

@michaeltaranto michaeltaranto merged commit 0546bd3 into master Aug 6, 2024
6 checks passed
@michaeltaranto michaeltaranto deleted the badge-inline-support branch August 6, 2024 23:22
@seek-oss-ci seek-oss-ci mentioned this pull request Aug 6, 2024
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.

2 participants