mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-02-06 04:58:02 +09:00
2250e521e4
* refactor: getBgColor関数の切り出し + fix types (taiyme#291) * move thing * revert unnecesary changes --------- Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com>
22 lines
522 B
TypeScript
22 lines
522 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 = window.getComputedStyle(src).backgroundColor;
|
|
|
|
if (parentBg === myBg) {
|
|
src.style.backgroundColor = 'var(--MI_THEME-bg)';
|
|
} else {
|
|
src.style.backgroundColor = myBg;
|
|
}
|
|
},
|
|
} as Directive;
|