如何修改Thunderbird日历周视图与单日视图的日期背景色?
修改Thunderbird周视图/单日视图指定日期背景色
Thunderbird不同日历视图的DOM结构差异较大,月/多周视图的选择器无法直接复用在周视图或单日视图上,以下是对应场景的CSS代码:
周视图指定日期背景修改
周视图中目标日期的容器类为.calendar-week-day-box,结合日期属性即可定位:
/* 周视图:2023年12月25日背景色改为周末样式 */ .calendar-week-day-box[year="2023"][month="12"][day="25"] { background-color: var(--viewWeekendBackground) !important; }
若仅需修改日期内容区域的背景,可替换选择器为:
.calendar-week-day-box[year="2023"][month="12"][day="25"] .calendar-week-day-box-content { background-color: var(--viewWeekendBackground) !important; }
单日视图指定日期背景修改
单日视图的日期容器类为.calendar-day-box,使用如下代码:
/* 单日视图:2023年12月25日背景色改为周末样式 */ .calendar-day-box[year="2023"][month="12"][day="25"] { background-color: var(--viewWeekendBackground) !important; }
注意事项
- 替换代码中的
year、month、day参数为目标日期的数值 - 可将
var(--viewWeekendBackground)替换为具体颜色值(如#f0f8ff)自定义背景色 - 确保Thunderbird已开启自定义CSS支持:在
about:config中将toolkit.legacyUserProfileCustomizations.stylesheets设为true,并将代码放入用户文件夹下的chrome/userChrome.css文件中
内容的提问来源于stack exchange,提问作者maf
相关产品推荐
相关产品推荐

