Gray out optional hard coded key modifiers

This commit is contained in:
JannisX11 2021-08-03 10:17:42 +02:00
parent 4fa0415050
commit 1344841417
2 changed files with 8 additions and 1 deletions

View File

@ -478,6 +478,10 @@
background: var(--color-button);
padding: 2px 5px;
}
.keybindslot .optional {
color: var(--color-subtle_text);
padding: 2px 5px;
}
/*Colors*/
dialog#theme .dialog_wrapper {

View File

@ -110,7 +110,10 @@ class Keybind {
}
if (colorized) {
modifiers.forEach((text, i) => {
modifiers[i] = `<span class="${i !== modifiers.length-1 ? 'modifier' : 'key'}">${text}</span>`;
let type = i !== modifiers.length-1
? text.match(/\[\w+\]/) ? 'optional' : 'modifier'
: 'key'
modifiers[i] = `<span class="${type}">${text}</span>`;
})
return modifiers.join(`<span class="punctuation"> + </span>`);