mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-08 21:52:33 +01:00
Improve "Fill column background with option color" (#16340)
* 🎨 Improve "Fill column background with option color" fix https://github.com/siyuan-note/siyuan/issues/16337 02 * fix 01 02 * fix 03
This commit is contained in:
parent
4f17c7fc8d
commit
cc59bd1087
6 changed files with 96 additions and 38 deletions
|
|
@ -732,14 +732,15 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
|||
item.removeAttribute("style");
|
||||
return;
|
||||
}
|
||||
let selectBg;
|
||||
const nameElement = item.querySelector(".av__group-title .b3-chip") as HTMLElement;
|
||||
if (nameElement) {
|
||||
selectBg = getComputedStyle(document.documentElement).getPropertyValue(`--b3-font-background${nameElement.style.backgroundColor.slice(-2, -1)}`);
|
||||
const colorMatch = nameElement.style.backgroundColor.match(/--b3-font-background(\d+)/);
|
||||
if (colorMatch) {
|
||||
item.setAttribute("style", `--b3-av-kanban-border: var(--b3-font-background${colorMatch[1]}); --b3-av-kanban-content-hover-bg: var(--b3-av-kanban-border);`);
|
||||
}
|
||||
} else {
|
||||
selectBg = getComputedStyle(document.documentElement).getPropertyValue("--b3-border-color");
|
||||
item.setAttribute("style", "--b3-av-kanban-border: var(--b3-border-color); --b3-av-kanban-content-hover-bg: var(--b3-av-kanban-border);");
|
||||
}
|
||||
item.setAttribute("style", `--b3-av-kanban-border:${selectBg};--b3-av-kanban-bg:${selectBg}29;--b3-av-kanban-content-bg:${selectBg}47;--b3-av-kanban-content-hover-bg:${selectBg}5c;`);
|
||||
});
|
||||
});
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue