-
Notifications
You must be signed in to change notification settings - Fork 138
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
Shared button component #10347
Merged
Shared button component #10347
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
bvaughn
commented
Feb 22, 2024
@@ -0,0 +1,58 @@ | |||
.Button { | |||
font-family: var(--font-family-default); | |||
font-size: 0.875rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like using non-standard font sizes and pixel sizes here, but I matched the old styles exactly so this switch would be less controversial.
hbenl
approved these changes
Feb 23, 2024
This was referenced Feb 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
ui/components/shared/Button
component has long confused me. It exports a lot of component variants, many of which don't seem to be used directly (rather the baseButton
component is used with various combinations of props) and many of which don't actually work (combinations of attributes that don't produce usable styles). In addition to that, most of our newer DevTools code can't use these buttons because thereplay-next
package can't import from the legacyui
package.This PR adds a new
Button
component toreplay-next
that supports our two style variants (solid vs outlined) and colors (primary vs secondary). The API is more constrained (e.g. it doesn't try to support a dozen colors, when we only use two and it doesn't export a dozen components when there is, conceptually, only one button).cc @jonbell-lot23 since this is a UI related change.
Comparison screenshots
Here is a side by side comparison of the old and new buttons.
The new button component fixes some issues with the old one, some of which can be seen in the comparison above:
The screenshots above were generated using the following test code.
Example replacements
Below I've updated a couple of pages to use the new button component instead.
Note that by updating this page we fix the following problems:
Follow up work to this PR
replay-next
code to use these buttons instead of one-off re-implementing the styles everywhereui/components/shared/Button
and replace with new buttonsui/components/shared/Button
components once references have been removed