Skip to content

Commit

Permalink
Set opaque background on markup and images (#23578)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
silverwind authored Mar 21, 2023
1 parent 76a1edf commit ca0ce9f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions web_src/css/features/dropzone.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@
.dropzone .dz-preview:hover .dz-image img {
filter: opacity(0.5) !important;
}

.dropzone-attachments .divider {
margin-top: 0 !important;
margin-bottom: 0 !important;
}

.dropzone-attachments .grid,
.dropzone-attachments .thumbnails {
padding: .5rem 1rem;
}
2 changes: 2 additions & 0 deletions web_src/css/markup/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
font-size: 16px;
line-height: 1.5 !important;
word-wrap: break-word;
background: var(--color-box-body);
}

.markup.ui.segment {
Expand Down Expand Up @@ -308,6 +309,7 @@
.markup img {
max-width: 100%;
box-sizing: initial;
background: var(--color-box-body);
}

.markup img[align="right"] {
Expand Down
6 changes: 6 additions & 0 deletions web_src/css/repository.css
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,12 @@
width: 100% !important;
max-width: 100% !important;
margin: 0 !important;
padding: 0 !important;
}

.comment-body .markup {
padding: 1em;
border-radius: 0 0 var(--border-radius) var(--border-radius); /* don't render outside box */
}

.edit-label.modal .form .column,
Expand Down

0 comments on commit ca0ce9f

Please sign in to comment.