2022-12-08 16:20:02 +08:00

18 lines
462 B
TypeScript

import log from "./log";
/**
* @deprecated
*/
export default function addStyle(css: string) {
let wh_gStyle = document.querySelector('style#wh-trans-gStyle');
if (wh_gStyle) {
wh_gStyle.innerHTML += css;
} else {
wh_gStyle = document.createElement("style");
wh_gStyle.id = 'wh-trans-gStyle';
wh_gStyle.innerHTML = css;
document.head.append(wh_gStyle);
}
log.info('CSS规则已添加', wh_gStyle);
}