Skip to content

Commit 6119d89

Browse files
authored
fix(ui): upload action button styles (#12592)
### What The upload action buttons had extra top & bottom `margin` extended on them from the `.btn` class which caused the upload-actions container to be larger than the thumbnail image. Can be seen below: ![Screenshot 2025-05-28 at 1 04 57 PM](https://github.com/user-attachments/assets/d1a9ff8a-ff69-4c62-bbde-9deda6721ad3) ### Fix To fix this issue, we've removed the bottom margin to allow the thumbnail image control the height of the component. #### Before ![Screenshot 2025-05-28 at 1 04 46 PM](https://github.com/user-attachments/assets/61f6dc9a-bf9d-411e-8d66-d50d27a328e9) #### After ![Screenshot 2025-05-28 at 1 05 29 PM](https://github.com/user-attachments/assets/7687f3e8-e699-4a16-964d-20072e63d10f)
1 parent d561195 commit 6119d89

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

packages/ui/src/elements/FileDetails/StaticFileDetails/index.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@
3333
}
3434

3535
&__main-detail {
36-
padding: base(0.8) base(1.2);
36+
padding: var(--base) calc(var(--base) * 1.2);
3737
width: auto;
3838
flex-grow: 1;
3939
min-width: 280px;
4040
max-width: 100%;
4141
display: flex;
4242
flex-direction: column;
43-
justify-content: center;
43+
justify-content: space-between;
4444
align-self: stretch;
45-
gap: base(0.2);
45+
gap: calc(var(--base) * 0.2);
4646
}
4747

4848
&__toggle-more-info {
@@ -61,14 +61,14 @@
6161

6262
&__sizes {
6363
margin: 0;
64-
padding: base(1.5) $baseline 0;
64+
padding: calc(var(--base) * 1.5) $baseline 0;
6565
list-style: none;
6666
display: flex;
6767
flex-wrap: wrap;
6868

6969
li {
7070
width: 50%;
71-
padding: 0 base(0.5);
71+
padding: 0 calc(var(--base) * 0.5);
7272
margin-bottom: $baseline;
7373
}
7474
}
@@ -79,7 +79,7 @@
7979

8080
&__file-mutation {
8181
display: flex;
82-
margin-top: base(0.25);
82+
margin-top: calc(var(--base) * 0.25);
8383
gap: calc(var(--base) / 2);
8484
}
8585

@@ -88,7 +88,7 @@
8888
background-color: var(--theme-elevation-150);
8989
border: none;
9090
border-radius: $style-radius-m;
91-
padding: base(0.25) base(0.5);
91+
padding: calc(var(--base) * 0.25) calc(var(--base) * 0.5);
9292

9393
&:hover {
9494
background-color: var(--theme-elevation-100);
@@ -102,7 +102,7 @@
102102

103103
&__sizes {
104104
display: block;
105-
padding: $baseline $baseline base(0.5);
105+
padding: $baseline $baseline calc(var(--base) * 0.5);
106106

107107
li {
108108
padding: 0;

packages/ui/src/elements/Upload/index.scss

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
.tooltip.error-message {
1515
z-index: 3;
16-
bottom: calc(100% - #{base(0.5)});
16+
bottom: calc(100% - #{calc(var(--base) * 0.5)});
1717
}
1818

1919
&__file-selected {
@@ -60,13 +60,18 @@
6060
flex-wrap: wrap;
6161
}
6262

63+
&__previewSizes,
64+
&__edit {
65+
margin-top: calc(var(--base) * 1.2);
66+
}
67+
6368
&__previewDrawer {
6469
& h2 {
65-
margin: 0 base(1) 0 0;
66-
text-wrap: nowrap;
70+
margin: 0 var(--base) 0 0;
71+
white-space: nowrap;
6772
overflow: hidden;
6873
text-overflow: ellipsis;
69-
max-width: calc(100% - base(2));
74+
max-width: calc(100% - calc(var(--base) * 2));
7075
}
7176
}
7277

@@ -78,7 +83,7 @@
7883
&__dropzoneContent {
7984
display: flex;
8085
flex-wrap: wrap;
81-
gap: base(0.4);
86+
gap: calc(var(--base) * 0.4);
8287
justify-content: space-between;
8388
width: 100%;
8489
}

packages/ui/src/elements/Upload/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const UploadActions = ({
6767
<Button
6868
buttonStyle="pill"
6969
className={`${baseClass}__previewSizes`}
70+
margin={false}
7071
onClick={() => {
7172
openModal(sizePreviewSlug)
7273
}}
@@ -79,6 +80,7 @@ export const UploadActions = ({
7980
<Button
8081
buttonStyle="pill"
8182
className={`${baseClass}__edit`}
83+
margin={false}
8284
onClick={() => {
8385
openModal(editDrawerSlug)
8486
}}
@@ -394,6 +396,7 @@ export const Upload_v4: React.FC<UploadProps_v4> = (props) => {
394396
setFileUrl(e.target.value)
395397
}}
396398
ref={urlInputRef}
399+
title={fileUrl}
397400
type="text"
398401
value={fileUrl}
399402
/>
@@ -435,6 +438,7 @@ export const Upload_v4: React.FC<UploadProps_v4> = (props) => {
435438
<input
436439
className={`${baseClass}__filename`}
437440
onChange={handleFileNameChange}
441+
title={filename || value.name}
438442
type="text"
439443
value={filename || value.name}
440444
/>

0 commit comments

Comments
 (0)