[bug#63720] website: List languages in two columns.
Commit Message
* website/apps/base/templates/components.scm (navbar): Specify a CSS
class for the languages dropdown list.
* website/static/base/css/navbar.css (languages-dropdown-list): New
rule.
---
The translations dropdown is too long and high. It seems to me
adjusting the number of columns dynamically and limiting the height is
not possible, unless we rewrite dropdowns to use CSS flexbox in <div>
elements instead of lists. Instead, this patch sets a fixed column
number of two, which should be appropriate for the foreseeable future.
Also, there is only one languages dropdown, so this patch could
specify an id and not a new class for the languages dropdown. But a
class works too and works always, so using a class seems better (?).
website/apps/base/templates/components.scm | 3 ++-
website/static/base/css/navbar.css | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
base-commit: c4df5a59a97bce391e1be68dd8b4c1107cce4b23
Comments
Hi,
"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> * website/apps/base/templates/components.scm (navbar): Specify a CSS
> class for the languages dropdown list.
> * website/static/base/css/navbar.css (languages-dropdown-list): New
> rule.
> ---
>
> The translations dropdown is too long and high. It seems to me
> adjusting the number of columns dynamically and limiting the height is
> not possible, unless we rewrite dropdowns to use CSS flexbox in <div>
> elements instead of lists. Instead, this patch sets a fixed column
> number of two, which should be appropriate for the foreseeable future.
>
> Also, there is only one languages dropdown, so this patch could
> specify an id and not a new class for the languages dropdown. But a
> class works too and works always, so using a class seems better (?).
No opinion on this, but two columns sounds like a good idea to me.
Thanks,
Ludo’.
Pushed as a076562297db72b45ac82f7627a23e4be615d558.
Thank you Ludo for confirming the columns number.
Regards,
Florian
@@ -1,5 +1,5 @@
;;; GNU Guix web site
-;;; Copyright © 2019 Florian Pelz <pelzflorian@pelzflorian.de>
+;;; Copyright © 2019, 2023 Florian Pelz <pelzflorian@pelzflorian.de>
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Initially written by sirgazil who waives all
;;; copyright interest on this file.
@@ -501,6 +501,7 @@ manual.
,(menu-dropdown #:label (locale-display-name) #:active-item active-item
#:items
(append
+ (list '(@ (class "languages-dropdown-list")))
(map-in-order
(lambda (ietf-info)
(let ((lingua (car ietf-info))
@@ -117,6 +117,9 @@ label.menu-item {
display: none;
}
+.languages-dropdown-list {
+ columns: 2;
+}