diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-10-25 11:11:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 19:11:49 +0800 |
commit | 29c00eb1ed13fbcd2a5e493d075c2bbd0e2a26f7 (patch) | |
tree | f89469e7905d14f15a7dca66a0977f4c3813cfb8 /web_src/less/_review.less | |
parent | 06a7ed4e04deec7718d3a3c0b4ae1c27f6cacc2c (diff) | |
download | gitea-29c00eb1ed13fbcd2a5e493d075c2bbd0e2a26f7.tar.gz gitea-29c00eb1ed13fbcd2a5e493d075c2bbd0e2a26f7.zip |
Improve code comment review on mobile (#21461)
- Fix placement of avatar image, this was not placed in the
`comment-header-left` and add CSS to cover the limiting of width+height
of avatar for code-review comment on "Files changed" page. This fixes
the big noticeable avatar issue.
- Apply `margin-bottom` to the "next" button, so it's consistent with
the "previous" button.
- Make sure the "next"/"previous" start at `flex-start` on mobile and
not off-screen at `flex-end`. As well force them to have `flex: 1` so
they won't overflow on x-asis. This also requires the `width: 100%` for
the `.ui.buttons` div.
- Resolves #20074
### Before
<details><img width="512"
src="https://user-images.githubusercontent.com/25481501/195952930-09560cad-419f-43a3-a8a4-a4166c117994.jpg"></details>
### After
<details><img width="512"
src="https://user-images.githubusercontent.com/25481501/197340081-0365dfa8-4344-46b4-8702-a40c778c073f.jpg"></details>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'web_src/less/_review.less')
-rw-r--r-- | web_src/less/_review.less | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/web_src/less/_review.less b/web_src/less/_review.less index 013d6d5aa1..4dd232945e 100644 --- a/web_src/less/_review.less +++ b/web_src/less/_review.less @@ -48,6 +48,12 @@ } } +.add-comment .lines-num, +.add-comment .lines-escape, +.add-comment .lines-type-marker { + display: none; +} + .show-outdated, .hide-outdated { &:extend(.unselectable); @@ -59,11 +65,13 @@ } .comment-code-cloud { - padding: .5rem !important; + padding: .5rem 1rem !important; position: relative; margin: 0 auto; + max-width: 1000px; @media @mediaSm { + max-width: auto; padding: .75rem !important; .code-comment-buttons { @@ -73,13 +81,22 @@ width: 100%; } } + + .ui.buttons { + width: 100%; + margin: 0 !important; + + .button { + flex: 1; + } + } } .comments .comment { - margin: 0; + padding: 0; @media @mediaSm { - padding: 0; + display: flex; .comment-header-right.actions .ui.basic.label { display: none; @@ -90,6 +107,10 @@ float: none; margin: 0 .5rem 0 0; flex-shrink: 0; + + ~ .content { + margin-left: 1em; + } } img.avatar { @@ -100,6 +121,10 @@ margin-left: 0 !important; } + .comment-container { + width: 100%; + } + &.code-comment { padding: 0 0 .5rem !important; } @@ -166,10 +191,7 @@ .button { width: 100%; margin: 0 !important; - - &:not(:last-child) { - margin-bottom: .75rem !important; - } + margin-bottom: .75rem !important; } } } |