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

Button: Support "unstyled" usage #67320

Open
mirka opened this issue Nov 26, 2024 · 1 comment
Open

Button: Support "unstyled" usage #67320

mirka opened this issue Nov 26, 2024 · 1 comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@mirka
Copy link
Member

mirka commented Nov 26, 2024

What problem does this address?

There have been cases where the Button component is used with heavy style overrides. This can lead to subtle bugs and breakages down the line.

Although we should always first reconsider if one of the standard Button style variants can be used instead, in some cases heavy style customization is warranted. While styling a simple button element from scratch may seem like a valid alternative, that may also lead to developers overlooking subtle considerations (focus styles, accessibility, etc) that are already handled in Button.

What is your proposed solution?

We should audit the repo for the kinds of valid style overrides we have, and figure out how Button can support those use cases cleanly. Some possibilities include:

  • an unstyled variant
  • providing modular styles (focus styles, hover styles, etc) through something like a useButtonStyles hook
@ciampo
Copy link
Contributor

ciampo commented Dec 4, 2024

A useful exercise could be to run through Button's code and, for each "feature", assign it to either "core behavior" or a separate "add on" (ie. styles).

Also, we may want to "merge" the unstyled variant work with the potential refactor from default / primary / secondary / tertiary / link to solid / outline / text proposed here and also related to #63856

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants