Skip to content

Commit ca0ce9f

Browse files
authored
Set opaque background on markup and images (#23578)
- Set opaque background on markup images so they can visually break `<hr>` - Change padding of comment box so `padding` is provided by the `.markup` element instead of its parent, matching the file rendering view which does the same. Before: <img width="243" alt="Screenshot 2023-03-19 at 19 22 03" src="https://user-images.githubusercontent.com/115237/226198663-8ff4d940-6a15-452d-ac58-14485b37fbc7.png"> After: <img width="261" alt="Screenshot 2023-03-19 at 19 23 26" src="https://user-images.githubusercontent.com/115237/226198689-1bf56561-4726-46dc-b583-423d65e1e13a.png"> <img width="263" alt="image" src="https://user-images.githubusercontent.com/115237/226199002-e93c817d-6d9c-4b98-bad8-0aa0bd45b62f.png"> Example documents: https://try.gitea.io/silverwind/symlink-test/src/branch/master/test-page.md https://github.com/silverwind/symlink-test/blob/master/test-page.md
1 parent 76a1edf commit ca0ce9f

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

web_src/css/features/dropzone.css

+10
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,13 @@
5151
.dropzone .dz-preview:hover .dz-image img {
5252
filter: opacity(0.5) !important;
5353
}
54+
55+
.dropzone-attachments .divider {
56+
margin-top: 0 !important;
57+
margin-bottom: 0 !important;
58+
}
59+
60+
.dropzone-attachments .grid,
61+
.dropzone-attachments .thumbnails {
62+
padding: .5rem 1rem;
63+
}

web_src/css/markup/content.css

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
font-size: 16px;
44
line-height: 1.5 !important;
55
word-wrap: break-word;
6+
background: var(--color-box-body);
67
}
78

89
.markup.ui.segment {
@@ -308,6 +309,7 @@
308309
.markup img {
309310
max-width: 100%;
310311
box-sizing: initial;
312+
background: var(--color-box-body);
311313
}
312314

313315
.markup img[align="right"] {

web_src/css/repository.css

+6
Original file line numberDiff line numberDiff line change
@@ -2740,6 +2740,12 @@
27402740
width: 100% !important;
27412741
max-width: 100% !important;
27422742
margin: 0 !important;
2743+
padding: 0 !important;
2744+
}
2745+
2746+
.comment-body .markup {
2747+
padding: 1em;
2748+
border-radius: 0 0 var(--border-radius) var(--border-radius); /* don't render outside box */
27432749
}
27442750

27452751
.edit-label.modal .form .column,

0 commit comments

Comments
 (0)