add cssPropertyMix

This commit is contained in:
Harvey Zack committed 2023-04-17 22:39:18 +08:00
1 parent f013f8604e
commit 49e1ed15b8
12 files changed
+72 -49

No files matched your search

+3 -6
View File
@@ -1,18 +1,15 @@
import { def } from '../utils';
export default function themeMix(art) {
const {
option,
template: { $player },
} = art;
const { option } = art;
def(art, 'theme', {
get() {
return getComputedStyle($player).getPropertyValue('--art-theme');
return art.cssProperty('--art-theme');
},
set(theme) {
option.theme = theme;
$player.style.setProperty('--art-theme', theme);
art.cssProperty('--art-theme', theme);
},
});
}