diff options
author | Brecht Van Lommel <brecht@blender.org> | 2023-05-21 23:19:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-21 21:19:37 +0000 |
commit | 268d121f4bf9bd7c0b601937c9232a3e2b233cb6 (patch) | |
tree | 1ff703ad98f7927a89ae019fd3d46d56c9f1c8cf /web_src/css/markup/content.css | |
parent | e95b42e187cde9ac4bd541cd714bdb4f5c1fd8bc (diff) | |
download | gitea-268d121f4bf9bd7c0b601937c9232a3e2b233cb6.tar.gz gitea-268d121f4bf9bd7c0b601937c9232a3e2b233cb6.zip |
Fix video width overflow in markdown, and other changes to match img (#24834)
This change makes the CSS for `<video>` in markup match that of `<img>`,
and also allows additional attributes to be used. This way the width,
padding, alignment should work equally well for both.
Diffstat (limited to 'web_src/css/markup/content.css')
-rw-r--r-- | web_src/css/markup/content.css | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/web_src/css/markup/content.css b/web_src/css/markup/content.css index 5b2d6ef244..fb1e8ea630 100644 --- a/web_src/css/markup/content.css +++ b/web_src/css/markup/content.css @@ -301,7 +301,8 @@ background-color: var(--color-markup-table-row); } -.markup img { +.markup img, +.markup video { max-width: 100%; box-sizing: initial; } @@ -309,17 +310,23 @@ /* this background ensures images can break <hr>. We can only do this on cases where the background is known and not transparent. */ .markup.file-view img, +.markup.file-view video, .comment-body .markup img, /* regular comment */ +.comment-body .markup video, .comment-content .markup img, /* code comment */ -.wiki .markup img { +.comment-content .markup video, +.wiki .markup img, +.wiki .markup video { background: var(--color-box-body); } -.markup img[align="right"] { +.markup img[align="right"], +.markup video[align="right"] { padding-left: 20px; } -.markup img[align="left"] { +.markup img[align="left"], +.markup video[align="left"] { padding-right: 20px; } @@ -343,7 +350,8 @@ border: 1px solid var(--color-secondary); } -.markup span.frame span img { +.markup span.frame span img, +.markup span.frame span video { display: block; float: left; } @@ -368,7 +376,8 @@ text-align: center; } -.markup span.align-center span img { +.markup span.align-center span img +.markup span.align-center span video { margin: 0 auto; text-align: center; } @@ -386,7 +395,8 @@ text-align: right; } -.markup span.align-right span img { +.markup span.align-right span img, +.markup span.align-right span video { margin: 0; text-align: right; } |