diff options
author | Oto Šťáva <oto.stava@gmail.com> | 2024-11-24 16:41:09 +0100 |
---|---|---|
committer | Oto Šťáva <oto.stava@gmail.com> | 2024-11-25 09:50:13 +0100 |
commit | c0777279fec4e08bc13665f0e862bfc4f164a5e3 (patch) | |
tree | ef0e8f696364565deb2a4c67fa555dc666902951 /templates | |
parent | Merge pull request 'Lock file maintenance (forgejo)' (#6067) from renovate/fo... (diff) | |
download | forgejo-c0777279fec4e08bc13665f0e862bfc4f164a5e3.tar.xz forgejo-c0777279fec4e08bc13665f0e862bfc4f164a5e3.zip |
Fix wiki search overflowing on wide screens (#6047)
Confine the search menu to be at most the width of the page, or 80% of
the viewport width, whichever is smaller. To do this, introduce a new
`--container-width` variable for the descendant elements of
`.ui.container` to be able to access.
Also update the relevant e2e test: add a long 'lorem ipsum' page, add a
search for it, parameterize the width.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/wiki/search.tmpl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/wiki/search.tmpl b/templates/repo/wiki/search.tmpl index 1b774908d0..5795b399af 100644 --- a/templates/repo/wiki/search.tmpl +++ b/templates/repo/wiki/search.tmpl @@ -1,6 +1,6 @@ {{if .Results}} {{range .Results}} - <a class="item tw-max-w-[80vw]" href="{{$.RepoLink}}/wiki/{{.Filename}}"> + <a class="item tw-max-w-[min(80vw,var(--container-width))]" href="{{$.RepoLink}}/wiki/{{.Filename}}"> <b class="tw-block tw-mb-2 tw-whitespace-break-spaces">{{.Title}}</b> {{range .LineCodes}} <p class="tw-my-0 tw-whitespace-break-spaces">{{.}}</p> |