Files
ArtPlayer/packages/artplayer/src/player/themeMix.js
T
2022-01-07 18:35:05 +08:00

19 lines
404 B
JavaScript

import { def } from '../utils';
export default function themeMix(art) {
const {
option,
template: { $player },
} = art;
def(art, 'theme', {
get() {
return getComputedStyle($player).getPropertyValue('--theme');
},
set(theme) {
option.theme = theme;
$player.style.setProperty('--theme', theme);
},
});
}