Update Anki field marker menu (#1816)

* Update anki field marker menu to have less vertical padding

* Update positioning of field marker menu
This commit is contained in:
toasted-nutbread 2021-07-09 18:21:29 -04:00 committed by GitHub
parent d446484947
commit 22f048e527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -1211,6 +1211,9 @@ button.popup-menu-item {
button.popup-menu-item:not([hidden]) { button.popup-menu-item:not([hidden]) {
display: flex; display: flex;
} }
button.popup-menu-item.popup-menu-item-thin {
--button-padding-vertical: 0.375em;
}
.popup-menu-item-icon { .popup-menu-item-icon {
width: calc(16em / var(--font-size-no-units)); width: calc(16em / var(--font-size-no-units));
height: 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); 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 { .popup-menu-item-group {
position: relative; position: relative;
display: flex; display: flex;

View File

@ -241,7 +241,7 @@ class AnkiController {
for (const marker of markers) { for (const marker of markers) {
const option = document.createElement('button'); const option = document.createElement('button');
option.textContent = marker; option.textContent = marker;
option.className = 'popup-menu-item'; option.className = 'popup-menu-item popup-menu-item-thin';
option.dataset.menuAction = 'setFieldMarker'; option.dataset.menuAction = 'setFieldMarker';
option.dataset.marker = marker; option.dataset.marker = marker;
fragment.appendChild(option); fragment.appendChild(option);

View File

@ -2888,7 +2888,7 @@
<template id="anki-card-field-template"><div class="anki-card-field-name-container"><span class="anki-card-field-name"></span></div> <template id="anki-card-field-template"><div class="anki-card-field-name-container"><span class="anki-card-field-name"></span></div>
<div class="anki-card-field-value-container"> <div class="anki-card-field-value-container">
<input type="text" class="anki-card-field-value input-with-suffix-button" autocomplete="off"> <input type="text" class="anki-card-field-value input-with-suffix-button" autocomplete="off">
<button class="anki-card-field-value-menu-button input-suffix-button input-suffix-icon-button light-icon" data-menu-position="below left"><span class="icon" data-icon="material-down-arrow"></span></button> <button class="anki-card-field-value-menu-button input-suffix-button input-suffix-icon-button light-icon" data-menu-position="v-center left"><span class="icon" data-icon="material-down-arrow"></span></button>
</div></template> </div></template>
<template id="anki-card-terms-field-menu-template"><div class="popup-menu-container" tabindex="-1" role="dialog"><div class="popup-menu"><div class="popup-menu-body"></div></div></div></template> <template id="anki-card-terms-field-menu-template"><div class="popup-menu-container" tabindex="-1" role="dialog"><div class="popup-menu"><div class="popup-menu-body"></div></div></div></template>