fix: Conform standalone button width to its container #2361 #2390
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 PR fulfills these requirements: (check all the apply)
main
branch.feat: Add a button #xxx
, where "xxx" is the issue number).Closes #xxx
, where "xxx" is the issue number.ui
folder, unit tests (make test
) still pass.The idea of this fix is to make the standalone button together with its left margin to fit its container width. This is by specifying
display: 'flex
for the button wrapper.Example:
When the standalone button with has specified width of
150px
is followed by another standalone button with the same width, the first button will be 150px wide but the second one and every other will be 142px wide as it accounts for 8px left padding. This marginal difference can only be caught by a perfectionist eye. This is demonstrated in the recording below:Screen.Recording.2024-09-12.at.08.46.16.mov
The
alignItems: 'center'
is specified not to break existing button stylings.The solution was manually and visual regression tested.
Closes #2361