mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-06-17 02:16:57 +00:00
* refactor: getBgColor関数の切り出し + fix types (taiyme#291) * move thing * revert unnecesary changes --------- Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com>
21 lines
576 B
TypeScript
21 lines
576 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { Directive } from 'vue';
|
|
import { getBgColor } from '@/scripts/get-bg-color.js';
|
|
|
|
export default {
|
|
mounted(src, binding, vn) {
|
|
const parentBg = getBgColor(src.parentElement) ?? 'transparent';
|
|
|
|
const myBg = getComputedStyle(document.documentElement).getPropertyValue('--MI_THEME-panel');
|
|
|
|
if (parentBg === myBg) {
|
|
src.style.backgroundColor = 'var(--MI_THEME-bg)';
|
|
} else {
|
|
src.style.backgroundColor = 'var(--MI_THEME-panel)';
|
|
}
|
|
},
|
|
} as Directive;
|