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

Buttons should make it easy to style overflow text with ellipses #6515

Closed
adidahiya opened this issue Nov 6, 2023 · 0 comments · Fixed by #6543
Closed

Buttons should make it easy to style overflow text with ellipses #6515

adidahiya opened this issue Nov 6, 2023 · 0 comments · Fixed by #6543

Comments

@adidahiya
Copy link
Contributor

Environment

  • Package version(s): core v5.6.0
  • Browser and OS versions: Chrome on macOS

Feature request

Users often need to style Button text with Classes.TEXT_OVERFLOW_ELLIPSIS styling to truncate long text. This is currently somewhat cumbersome to do; we often see styles like this in a CSS module:

// in a CSS module

@use "@blueprintjs/core/lib/scss/variables" as bp;

.my-button {
 :global(.#{bp.$ns}-button-text) {
    overflow: hidden;
    text-wrap: nowrap;
    text-overflow: ellipsis;
  }
}

#4460 will help with this; that will allow users to use Blueprint's utility styling class:

<Button textClassName={Classes.TEXT_OVERFLOW_ELLIPSIS} />

However it would be even nicer if Buttons had a prop for this styling behavior, something like:

<Button ellipsizeText={true} />

^ this prop naming attempts to match up with <Text ellipsize={true}>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant