Skip to content

Commit

Permalink
style: image attachments not being centered (#4313)
Browse files Browse the repository at this point in the history
* refactor: DRY: add a CSS variable

This is a preparation to fix narrow image attachments not being
centered inside message body.

* style: image attachments not being centered

The bug was introduced in 260fdd2.
Somehow even `display: block` doesn't make the button
fill the parent.
  • Loading branch information
WofWca authored Nov 8, 2024
1 parent de667c2 commit bd589d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- move the "Realtime Webxdc Channels" setting out of the "Experimental" section #4316

## Fixed
- image attachments not being centered within a message #4313

<a id="1_47_1"></a>

Expand Down
7 changes: 4 additions & 3 deletions packages/frontend/scss/message/_message-attachment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
text-align: center;
position: relative;

margin-left: -12px;
margin-right: -12px;
margin-top: -10px;
margin-left: calc(-1 * var(--msg-container-padding-horizontal));
margin-right: calc(-1 * var(--msg-container-padding-horizontal));
width: calc(100% + 2 * var(--msg-container-padding-horizontal));
margin-top: calc(-1 * var(--msg-container-padding-top));
margin-bottom: -12px;

border-radius: 16px;
Expand Down
8 changes: 5 additions & 3 deletions packages/frontend/scss/message/_message.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@
display: inline-block;
max-width: 100%;
border-radius: 16px;
padding-right: 12px;
padding-left: 12px;
padding-top: 10px;
--msg-container-padding-horizontal: 12px;
--msg-container-padding-top: 10px;
padding-right: var(--msg-container-padding-horizontal);
padding-left: var(--msg-container-padding-horizontal);
padding-top: var(--msg-container-padding-top);
padding-bottom: 10px;

.msg-body {
Expand Down

0 comments on commit bd589d3

Please sign in to comment.