mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 14:41:20 -08:00
add cssVar
This commit is contained in:
1 parent
49e1ed15b8
commit
339034d30d
2 files changed
+4
-4
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import { def } from '../utils';
|
||||
|
||||
export default function cssVarMix(art) {
|
||||
const { $player } = art.template;
|
||||
|
||||
def(art, 'cssVar', {
|
||||
value(key, value) {
|
||||
if (value) {
|
||||
return $player.style.setProperty(key, value);
|
||||
} else {
|
||||
return getComputedStyle($player).getPropertyValue(key);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user