Skip to content

Commit d0a70fb

Browse files
authored
Make the text copy button use IconButton (#34224)
* Make the text copy button use IconButton This obviously should be a shared component, but design is looking at what it will actually look like long term, so until then, let's at least make it use compound's IconButton so it gets the hover background state, and sort out the padding & margins. Requires element-hq/compound-web#528 * snapshots & add aria-label * more snapshots * Remove unnecessary width & height update other screenshots with expected changes * One more screenshot * This really shouldn't be necessary: see what test fails * Fix test to look in screen for the labels Because the labels from the tooltip don't go in the container, they get added to the dom at the top level in a floaty bit. * update snapshots again * Fix button size and also add comment to the other place where we fudge the padding * Update snapshots * Align to center * Screenshots
1 parent 67fc33a commit d0a70fb

25 files changed

Lines changed: 551 additions & 404 deletions

File tree

-1.43 KB
Loading
155 Bytes
Loading
93 Bytes
Loading
157 Bytes
Loading
-1.04 KB
Loading
-29 Bytes
Loading
117 Bytes
Loading
115 Bytes
Loading
229 Bytes
Loading

apps/web/res/css/views/elements/_CopyableText.pcss

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.
88
*/
99

1010
.mx_CopyableText {
11-
align-items: flex-start;
11+
align-items: center;
1212
display: flex;
1313
justify-content: space-between;
1414
width: max-content;
@@ -20,27 +20,17 @@ Please see LICENSE files in the repository root for full details.
2020
border: solid 1px $light-fg-color;
2121
margin-bottom: 10px;
2222
margin-top: 10px;
23-
padding: 10px 0 10px 10px;
23+
padding: 10px;
2424
}
2525

2626
.mx_CopyableText_copyButton {
2727
flex-shrink: 0;
28-
/* using em here to adapt to the local font size */
29-
width: 1em;
30-
height: 1em;
31-
padding-left: 12px;
32-
padding-right: 10px;
3328
display: block;
3429
/* If the copy button is used within a scrollable div, make it stick to the right while scrolling */
3530
position: sticky;
36-
right: 0;
37-
/* center to first line */
38-
top: 0.15em;
39-
background-color: $background;
31+
margin-left: var(--cpd-space-1x);
4032

4133
svg {
42-
width: 1em;
43-
height: 1em;
4434
color: $message-action-bar-fg-color;
4535
display: block;
4636
}

0 commit comments

Comments
 (0)