mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 00:33:20 +08:00
19 lines
819 B
JavaScript
19 lines
819 B
JavaScript
export const WECOM_STYLE_ID = 'xmanrui-dsh-im-wecom-settings';
|
|
|
|
const CSS = String.raw`
|
|
.dwecom-page { --ddt-accent: #3370ff; --ddt-accent-deep: #245bdb; --ddt-accent-wash: #eef4ff; }
|
|
.dwecom-avatar, .dwecom-brand { color: #3370ff; background: #fff; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); }
|
|
.dwecom-avatar svg, .dwecom-brand svg { display: block; }
|
|
`;
|
|
|
|
export function installWecomStyles() {
|
|
if (typeof document === 'undefined') return () => {};
|
|
const existing = document.querySelector(`style[data-plugin-css="${WECOM_STYLE_ID}"]`);
|
|
if (existing) return () => {};
|
|
const style = document.createElement('style');
|
|
style.dataset.plugin = '@xmanrui/dsh-im';
|
|
style.dataset.pluginCss = WECOM_STYLE_ID;
|
|
style.textContent = CSS;
|
|
document.head.appendChild(style);
|
|
return () => style.remove();
|
|
}
|