From 22f048e527552cf0451ea03e0e9bd869b6ad240b Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 9 Jul 2021 18:21:29 -0400 Subject: Update Anki field marker menu (#1816) * Update anki field marker menu to have less vertical padding * Update positioning of field marker menu --- ext/css/material.css | 7 +++++++ ext/js/pages/settings/anki-controller.js | 2 +- ext/settings.html | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ext/css/material.css b/ext/css/material.css index b19b0b0f..3aa6b18b 100644 --- a/ext/css/material.css +++ b/ext/css/material.css @@ -1211,6 +1211,9 @@ button.popup-menu-item { button.popup-menu-item:not([hidden]) { display: flex; } +button.popup-menu-item.popup-menu-item-thin { + --button-padding-vertical: 0.375em; +} .popup-menu-item-icon { width: calc(16em / var(--font-size-no-units)); height: calc(16em / var(--font-size-no-units)); @@ -1236,6 +1239,10 @@ button.popup-menu-item:not([hidden]) { font-size: var(--font-size-small); } +:root[data-page-type=popup] .popup-menu.popup-menu-auto-size button.popup-menu-item.popup-menu-item-thin, +.popup-menu.popup-menu-small button.popup-menu-item.popup-menu-item-thin { + --button-padding-vertical: 0.25em; +} .popup-menu-item-group { position: relative; display: flex; diff --git a/ext/js/pages/settings/anki-controller.js b/ext/js/pages/settings/anki-controller.js index c0f7f626..1ec14c4b 100644 --- a/ext/js/pages/settings/anki-controller.js +++ b/ext/js/pages/settings/anki-controller.js @@ -241,7 +241,7 @@ class AnkiController { for (const marker of markers) { const option = document.createElement('button'); option.textContent = marker; - option.className = 'popup-menu-item'; + option.className = 'popup-menu-item popup-menu-item-thin'; option.dataset.menuAction = 'setFieldMarker'; option.dataset.marker = marker; fragment.appendChild(option); diff --git a/ext/settings.html b/ext/settings.html index 0144ddd3..d392b0c0 100644 --- a/ext/settings.html +++ b/ext/settings.html @@ -2888,7 +2888,7 @@ -- cgit v1.2.3