diff mbox series

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

Message ID 6qPduW122TIVLNu9Rj_6WQGFxdoNCifPrJccAjS5vVqz-1ROc0Oz9Mj1jQNuueNtgXJh1VyK9NX1bUnZV0__a7E1n1_La1beKfPVxcn1Zes=@protonmail.com
State Accepted
Headers show
Series [bug#47710] website: Fix dropdown menu shrinking when clicked | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Luis Felipe April 11, 2021, 3:35 p.m. UTC
Hi,

This patch fixes dropdown menus shrinking when toggling dropdown buttons.

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

Comments

Mathieu Othacehe April 11, 2021, 4:30 p.m. UTC | #1
Hey,

> This patch fixes dropdown menus shrinking when toggling dropdown buttons.

Works great, thanks for fixing it. Pushed as
d3f524d4ea9502e216208b7c3d5f22b9045d4a5c.

Mathieu
pelzflorian (Florian Pelz) April 11, 2021, 9:48 p.m. UTC | #2
On Sun, Apr 11, 2021 at 03:35:32PM +0000, Luis Felipe via Guix-patches via wrote:
> Subject: [PATCH] website: Fix dropdown menu shrinking when clicked.
> […]
> This change fixes these problems by leaving the menu width as wide as
> its longest item when the button is toggled.

Thank you, this does the trick.  (Except on Microsoft Internet
Explorer, which we do not need to care about anymore.)

> * apps/base/templates/components.scm (menu-dropdown): Set width to
>   max-content on :checked.

The last line should not be indented, but it does not matter.

> ---
>  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;
>  }"))

The comment /* reset to initial values: */ is misplaced now;
max-content is not an initial value for width.  I have moved the
comment down one line in commit
81a6c477d92b2c4a206c390b97c9cb0159d79719.

Regards,
Florian
Luis Felipe April 12, 2021, 2:05 a.m. UTC | #3
Thank you for cleaning that up, Florian.
diff mbox series

Patch

From 9ef47c6870a742d1c3b824a65e262dc30d4db6de Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
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