3

I am currently doing preliminary research for a project which, if it is feasible, will consist of a Thunderbird extension with Lightning integration. My question is this: How do I use a Thunderbird extension to programmatically change the CSS in Lightning?

Specifically, I want to change the background on the Lightning UI from the normal color to a picture from within my extension -- the idea being that the user downloads the extension, and voila, he has an interesting background. Do you have any idea how I could achieve this?

4

1 回答 1

2

这应该相当简单。首先,您需要创建基本的 Thunderbird 扩展布局,包括 chrome.manifest、install.rdf 等。这与传统 Firefox 附加组件中的布局相同,有时在那里称为“传统扩展”。在 chrome.manifest 中,您需要添加一个覆盖chrome://messenger/content/messenger.xul的样式覆盖。这将允许您覆盖 CSS 文件。

在您的 CSS 文件中,您只需添加正确的规则。您可以使用DOM Inspector找出当前应用了哪些 CSS 规则,或者使用远程开发人员工具的检查器工具

这可以做到:

#view-deck > * {
    background-image: url(http://baconmockup.com/800/600);
    background-size: cover;
    padding: 0;
}
calendar-month-day-box, calendar-event-column {
    opacity: 0.8;
}

如果您希望图像出现在每天的框中,只需稍微调整规则即可。我将把周视图作为练习。

calendar-month-day-box {
    background-image: url(http://baconmockup.com/200/130);
    background-size: cover;
}

培根日历

于 2016-01-19T12:11:34.970 回答