Skip to content

Commit e861dcb

Browse files
Dropzone styling improvements (#15291) (#15374)
* Dropzone styling improvements - Move all dropzone styles to separate file - Fix white background in arc-green - Fix rendering of non-square images and previews * increase thumbnail quality, set contain in js, replace blur effect with opacity Co-authored-by: techknowlogick <[email protected]>
1 parent 53c2136 commit e861dcb

File tree

5 files changed

+57
-37
lines changed

5 files changed

+57
-37
lines changed

web_src/js/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,9 @@ async function initRepository() {
997997
dictFileTooBig: $dropzone.data('file-too-big'),
998998
dictRemoveFile: $dropzone.data('remove-file'),
999999
timeout: 0,
1000+
thumbnailMethod: 'contain',
1001+
thumbnailWidth: 480,
1002+
thumbnailHeight: 480,
10001003
init() {
10011004
this.on('success', (file, data) => {
10021005
filenameDict[file.name] = {
@@ -2601,6 +2604,9 @@ $(document).ready(async () => {
26012604
dictFileTooBig: $dropzone.data('file-too-big'),
26022605
dictRemoveFile: $dropzone.data('remove-file'),
26032606
timeout: 0,
2607+
thumbnailMethod: 'contain',
2608+
thumbnailWidth: 480,
2609+
thumbnailHeight: 480,
26042610
init() {
26052611
this.on('success', (file, data) => {
26062612
filenameDict[file.name] = data.uuid;

web_src/less/_repository.less

-28
Original file line numberDiff line numberDiff line change
@@ -1021,11 +1021,6 @@
10211021
color: var(--color-text-light-2);
10221022
font-style: italic;
10231023
}
1024-
1025-
.dropzone-attachments .thumbnails .ui.image {
1026-
max-height: 150px;
1027-
}
1028-
10291024
}
10301025

10311026
.ui.form {
@@ -2417,29 +2412,6 @@
24172412
padding-top: 15px;
24182413
}
24192414

2420-
.ui.form {
2421-
.dropzone {
2422-
border: 2px dashed var(--color-secondary);
2423-
background: none;
2424-
box-shadow: none !important;
2425-
padding: 0;
2426-
min-height: 5rem;
2427-
border-radius: 4px;
2428-
2429-
.dz-button {
2430-
color: rgba(0, 0, 0, .6);
2431-
}
2432-
2433-
&:hover .dz-button {
2434-
color: rgba(0, 0, 0, .8);
2435-
}
2436-
2437-
.dz-error-message {
2438-
top: 140px;
2439-
}
2440-
}
2441-
}
2442-
24432415
.settings {
24442416
.content {
24452417
margin-top: 2px;

web_src/less/features/dropzone.less

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.dropzone {
2+
border: 2px dashed var(--color-secondary) !important;
3+
background: none !important;
4+
box-shadow: none !important;
5+
padding: 0 !important;
6+
min-height: 5rem !important;
7+
border-radius: 4px !important;
8+
}
9+
10+
.dropzone .dz-button {
11+
color: var(--color-text-light) !important;
12+
}
13+
14+
.dropzone:hover .dz-button {
15+
color: var(--color-text) !important;
16+
}
17+
18+
.dropzone .dz-error-message {
19+
top: 120px !important;
20+
}
21+
22+
.dropzone .dz-image {
23+
display: flex !important;
24+
align-items: center !important;
25+
justify-content: center !important;
26+
border-radius: 0 !important;
27+
}
28+
29+
.dropzone .dz-image img {
30+
max-width: 100% !important;
31+
max-height: 100% !important;
32+
object-fit: contain !important;
33+
}
34+
35+
.dropzone .dz-preview.dz-image-preview,
36+
.dropzone-attachments .thumbnails img {
37+
background: transparent !important;
38+
}
39+
40+
.dropzone-attachments .thumbnails img {
41+
height: 120px !important;
42+
width: 120px !important;
43+
object-fit: contain !important;
44+
margin-bottom: 0 !important;
45+
}
46+
47+
.dropzone .dz-preview:hover .dz-image img {
48+
filter: opacity(.5) !important;
49+
}

web_src/less/index.less

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
@import "./variables.less";
44
@import "./shared/issuelist.less";
5-
@import "./features/gitgraph.less";
65
@import "./features/animations.less";
6+
@import "./features/dropzone.less";
7+
@import "./features/gitgraph.less";
78
@import "./features/heatmap.less";
89
@import "./features/imagediff.less";
910
@import "./features/codeeditor.less";

web_src/less/themes/theme-arc-green.less

-8
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,6 @@ td.blob-hunk {
426426
box-shadow: 0 0 0 1px rgba(121, 71, 66, .5) inset, 0 0 0 0 transparent;
427427
}
428428

429-
.ui.form .dropzone .dz-button {
430-
color: rgba(158, 158, 158, .8);
431-
}
432-
433-
.ui.form .dropzone:hover .dz-button {
434-
color: rgba(158, 158, 158, 1);
435-
}
436-
437429
.ui.list .list > .item .header,
438430
.ui.list > .item .header {
439431
color: #dedede;

0 commit comments

Comments
 (0)