From 4a0103fa293cc42075d4a9c10ca4dffa9c2d3a40 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 8 Nov 2023 08:52:08 +0900 Subject: [PATCH] Add word-break to repo description in home page (#27924) In #25315, @denyskon fixed UI on mobile view. But for the repo description, on desktop view there's no word-break. So maybe we can just add `gt-word-break` to fix it on both mobile view and desktop view. Before: desktop view: ![image](https://github.com/go-gitea/gitea/assets/18380374/a7659f5b-fbe9-400a-8cc2-cca44778556e) mobile view: ![image](https://github.com/go-gitea/gitea/assets/18380374/611f1b81-58ac-4213-b165-5c73e24ca79e) After: desktop view: ![image](https://github.com/go-gitea/gitea/assets/18380374/f21bf3a7-f6aa-457d-9bfa-5c57659c68b1) mobile view(almost same?) ![image](https://github.com/go-gitea/gitea/assets/18380374/ad2d1a4d-1172-402c-b5fc-5e910657847d) --------- Co-authored-by: silverwind --- templates/repo/home.tmpl | 2 +- web_src/css/repo.css | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 81b2ba1b0..d91dc4394 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -5,7 +5,7 @@ {{template "base/alert" .}} {{template "repo/code/recently_pushed_new_branches" .}} {{if and (not .HideRepoInfo) (not .IsBlame)}} -
+
{{$description := .Repository.DescriptionHTML $.Context}} {{if $description}}{{$description | RenderCodeBlock}}{{else if .IsRepositoryAdmin}}{{ctx.Locale.Tr "repo.no_desc"}}{{end}} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 40f08f412..d759d10c8 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -211,14 +211,14 @@ display: flex; justify-content: space-between; align-items: center; + gap: 5px; margin-bottom: 5px; } -@media (max-width: 767.68px) { +@media (max-width: 767.98px) { .repository.file.list .repo-description { flex-direction: column; - gap: 8px; - align-items: normal; + align-items: stretch; } }