From 5c4a0492eaab285b809264434226987c1e2ce2c8 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Thu, 7 Nov 2019 16:52:11 +0000 Subject: [PATCH] [design] improve dropdown menu --- src/css/form.css | 3 ++- src/style-guide.html | 30 ++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/css/form.css b/src/css/form.css index 9cc7c730..ba95c94b 100755 --- a/src/css/form.css +++ b/src/css/form.css @@ -1243,7 +1243,7 @@ input[type="range"]:disabled::-moz-range-progress { .form-dropdown-menu { background-color: rgb(var(--form-dropdown-background)); border-radius: var(--theme-radius); - padding: var(--theme-radius) 0; + padding: 0.5em 0; position: absolute; top: calc(100% + calc(var(--layout-line-width) * 2)); left: 0; @@ -1251,6 +1251,7 @@ input[type="range"]:disabled::-moz-range-progress { min-width: 12em; box-shadow: var(--layout-shadow-large); z-index: var(--z-index-dropdown); + overflow: hidden; display: none; } diff --git a/src/style-guide.html b/src/style-guide.html index 15f99171..3237ee80 100644 --- a/src/style-guide.html +++ b/src/style-guide.html @@ -53,28 +53,43 @@
-
+
-
+
-
+

-
+
-
+
-
+
+
+
+ +
    +
  • + +
  • +
  • + +
  • +
+
+

@@ -259,6 +274,9 @@ var html = helper.e("html"); html.style.setProperty("--theme-radius", (parseInt(this.value, 10) / 100) + "rem"); }, false); + helper.e(".style-guide-form-dropdown").addEventListener("click", function() { + helper.toggleClass(this, "form-dropdown-open"); + }, false);