add style sheet

This commit is contained in:
volatile static 2023-01-03 20:55:25 +08:00
parent 717548a470
commit 0bd4b5987e
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,3 @@
.makeItRed {
background-color: tomato;
}

View File

@ -19,7 +19,16 @@ class AddonViews extends AddonModule {
// You can init the UI elements that
// cannot be initialized with overlay.xul
this._Addon.toolkit.Tool.log("Initializing UI");
const menuIcon = "chrome://addontemplate/content/icons/favicon@0.5x.png";
// register style sheet
const styles = this._Addon.toolkit.UI.createElement(document, 'link', 'html') as HTMLLinkElement;
styles.type = 'text/css';
styles.rel = 'stylesheet';
styles.href = `chrome://${config.addonRef}/content/zoteroPane.css`;
document.documentElement.appendChild(styles);
document.getElementById('zotero-item-pane-content')?.classList.add('makeItRed');
const menuIcon = `chrome://${config.addonRef}/content/icons/favicon@0.5x.png`;
// item menuitem with icon
this._Addon.toolkit.UI.insertMenuItem("item", {
tag: "menuitem",