diff --git a/ts/editor-toolbar/ColorPicker.svelte b/ts/editor-toolbar/ColorPicker.svelte index 42ac0931e..7e0358574 100644 --- a/ts/editor-toolbar/ColorPicker.svelte +++ b/ts/editor-toolbar/ColorPicker.svelte @@ -17,7 +17,8 @@ } &:active { - box-shadow: inset 0 0 10px 3px rgb(0 0 0 / 30%); + box-shadow: inset 0 0 12px 4px rgb(0 0 0 / 30%); + border-color: #aaa; } } diff --git a/ts/editor-toolbar/CommandIconButton.svelte b/ts/editor-toolbar/CommandIconButton.svelte index 2513c04bf..633d824c8 100644 --- a/ts/editor-toolbar/CommandIconButton.svelte +++ b/ts/editor-toolbar/CommandIconButton.svelte @@ -10,19 +10,27 @@ ); } - export function updateButtons() { + function updateButtons(callback: (key: string) => boolean): void { commandMap.update( (map: Map): Map => { const newMap = new Map(); for (const key of map.keys()) { - newMap.set(key, document.queryCommandState(key)); + newMap.set(key, callback(key)); } return newMap; } ); } + + export function updateButtonActive() { + updateButtons((key: string): boolean => document.queryCommandState(key)); + } + + export function clearButtonActive() { + updateButtons((): boolean => false); + }