fix: border radius on connected button groups#663
Open
penguinencounter wants to merge 1 commit intostoatchat:mainfrom
Open
fix: border radius on connected button groups#663penguinencounter wants to merge 1 commit intostoatchat:mainfrom
penguinencounter wants to merge 1 commit intostoatchat:mainfrom
Conversation
Contributor
|
The affected buttons are Material 3 button groups. |
Author
|
@infi they should, unless the existing |
dfb22c9 to
dd48042
Compare
Original styling would cause border radii on connected groups to be inconsistent between buttons in the middle vs buttons on the end of the group. (This is most obvious in the Appearance tab in the settings.) This is due to how the CSS spec handles `border-radius` values that cause overlapping corners (ex. the ones used to create pill-shaped buttons here) - instead of only reducing the conflicting corners, all corners are reduced proportionally as needed: https://drafts.csswg.org/css-backgrounds/#corner-overlap This is fixed by introducing a `--max-radius` CSS variable that is half of the button's height, which achieves the same effect without having corner overlaps. As a bonus, we reduce the `shape: "round"` variants to a single one that references the variable. Note that there could potentially still be a consistency issue if a button is less wide than tall, but that seems very unlikely. Signed-off-by: penguinencounter <49845522+penguinencounter@users.noreply.github.com>
dd48042 to
21ef94f
Compare
This file contains hidden or 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
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.

Hopefully you don't mind this PR, apologies in advance if I did it wrong! The inconsistency was bothering me.
Before:

After:

roughly copied from the commit message: