Skip to content

Cannot center text in chip #1854

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

Open
2 tasks done
katie-weisenberger opened this issue Apr 24, 2025 · 3 comments
Open
2 tasks done

Cannot center text in chip #1854

katie-weisenberger opened this issue Apr 24, 2025 · 3 comments
Labels
Workflow: Issue created JIRA issue is created and will be analyzed

Comments

@katie-weisenberger
Copy link

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

What happened?

When using the ix-chip component, if I manually set a width of the chip, the text is automatically aligned left, and cannot be changed. I would like to be able to center the text.

I tried justify-content: center and align-content: center but this didn't work.

What type of frontend framework are you seeing the problem on?

Angular

Which version of iX do you use?

v2.7.0

Code to produce this issue.

<ix-chip
    class="chip-btn"
    [active]="true"
    [outline]="true"
    variant="primary"
    background="var(--theme-color-ghost--hover)"
  >
    Testing1234
  </ix-chip>

.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13rem;
  height: 2rem;
  border-radius: 50px;
}
@katie-weisenberger katie-weisenberger added the triage We discuss this topic in our internal weekly label Apr 24, 2025
@danielleroux danielleroux added Workflow: Issue created JIRA issue is created and will be analyzed and removed triage We discuss this topic in our internal weekly labels Apr 25, 2025
Copy link
Contributor

github-actions bot commented Apr 25, 2025

🤖 Hello @katie-weisenberger

Your issue will be analyzed and is part of our internal workflow.
To get informed about our workflow please checkout the Contributing Guidelines

JIRA: IX-2645

@danielleroux danielleroux added the Contribution welcome 👨‍💻 This issue is open for contributions from the community label Apr 25, 2025
@danielleroux
Copy link
Collaborator

danielleroux commented Apr 25, 2025

@katie-weisenberger as a workaround you can try the following:

<ix-chip
    [active]="true"
    [outline]="true"
    variant="primary"
  >
    <div class="chip-btn">Testing1234</div>
</ix-chip>

.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13rem;
}

@danielleroux danielleroux removed the Contribution welcome 👨‍💻 This issue is open for contributions from the community label Apr 25, 2025
@siemens siemens deleted a comment from github-actions bot Apr 25, 2025
@katie-weisenberger
Copy link
Author

@katie-weisenberger as a workaround you can try the following:

<ix-chip
    [active]="true"
    [outline]="true"
    variant="primary"
  >
    <div class="chip-btn">Testing1234</div>
</ix-chip>

.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13rem;
}

That worked for me, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Workflow: Issue created JIRA issue is created and will be analyzed
Projects
None yet
Development

No branches or pull requests

2 participants