Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix alignment of user menu avatar #12289

Merged
merged 5 commits into from
Feb 27, 2024
Merged

Fix alignment of user menu avatar #12289

merged 5 commits into from
Feb 27, 2024

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Feb 27, 2024

#12267 made the avatar a couple of pixels out of alignment with the space icons. It just needed to be moved 2px to the right to match the 18px margin of the space icons (including the padding from the black border).

Also change elements in the user menu to block elements so they don't generate extra vertical space in the user menu div, which was causing the hairline to be too far down (unless anyone knows of a better way to avoid this extra height in the div: setting the hight of the div explicitly didn't work).

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

#12267 made the avatar
a couple of pixels out of alignment with the space icons. It just needed
to be moved 2px to the right to match the 18px margin of the space icons
(including the padding from the black border).

Also change elements in the user menu to block elements so they don't
generate extra vertical space in the user menu div, which was causing the
hairline to be too far down.
Comment on lines 400 to 401
span,
img {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you target a class name here so we're not relying on the specific elements used in the Compound Avatar implementation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can for the span, but the image only has an autogenerated class name. Unsure whether adding one just for this or just using the element type is the lesser evil. We could also match everything, which might actually be better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my brief testing it looked like setting display: block only on the span was enough to fix the height, for what it's worth

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I retested and you're absolutely right.

res/css/structures/_SpacePanel.pcss Outdated Show resolved Hide resolved
Co-authored-by: Robin <robin@robin.town>
@dbkr dbkr added this pull request to the merge queue Feb 27, 2024
Merged via the queue into develop with commit 5ac222e Feb 27, 2024
22 checks passed
@dbkr dbkr deleted the dbkr/fix_avatar_alignment branch February 27, 2024 20:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants