Subject: [bug#47710] [PATCH] website: Fix dropdown menu shrinking when clicked

From: Luis Felipe <[email-masked]>
Date: Sun, 11 Apr 2021 15:35:32 +0000

Hi,

This patch fixes dropdown menus shrinking when toggling dropdown buttons.

---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

From 9ef47c6870a742d1c3b824a65e262dc30d4db6de Mon Sep 17 00:00:00 2001
From: Luis Felipe <[email-masked]>
Date: Sun, 11 Apr 2021 10:02:25 -0500
Subject: [PATCH] website: Fix dropdown menu shrinking when clicked.

When clicking or tapping on a dropdown button in the primary menu of
the website the menu width is shrunk to its min-width, and long items
are broken into separate lines making them look as if they were
different items in the menu.

This change fixes these problems by leaving the menu width as wide as
its longest item when the button is toggled.

* apps/base/templates/components.scm (menu-dropdown): Set width to
  max-content on :checked.
---
 website/apps/base/templates/components.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/website/apps/base/templates/components.scm b/website/apps/base/templates/components.scm
index 5440408..f521436 100644
--- a/website/apps/base/templates/components.scm
+++ b/website/apps/base/templates/components.scm
@@ -310,7 +310,7 @@ manual.
 {
     min-width: 150px;
     /* reset to initial values: */
-    width: auto;
+    width: max-content;
     height: auto;
     overflow: visible;
 }"))

base-commit: af5f9244a8c8032bec77d5f4334f49940b814220
-- 
2.31.0