我想在 Firefox 阅读器 View 样式中包含我选择的字体。
请告诉我 Firefox 是使用本地 CSS 文件进行样式设置还是位于其他位置?
此外,Firefox 用于阅读器 View 的 CSS 文件名是什么,我如何编辑它。
提前致谢!
最佳答案
您可以在路径下找到“Firefox 阅读器 View ”的 CSS 文件
cd /home/$USER/.mozilla/firefox/<PROFILE_FOLDER>/chrome/userContent.css
仅当您已经设置好它时:
- 在您的 Firefox URL 搜索栏中输入:
about:support
. - 通过选择
Show Folder
打开您的个人资料文件夹 . - 在您的个人资料文件夹 中创建一个名为
chrome
的新文件夹. - 导航到
chrome
并创建一个名为userContent.css
的新纯文本文件 - 编辑
userContent.css
根据您的 CSS 偏好。 - 在新的 Firefox 配置文件中,从 Firefox 69 开始,您还必须启用
toolkit.legacyUserProfileCustomizations.stylesheets
在about:config
,比照。 Firefox 69: userChrome.css and userContent.css disabled by default .
在我的例子中,它看起来像下面这样:
cd /home/$USER/.mozilla/firefox/<PROFILE_FOLDER>/
mkdir chrome
cd ./chrome
touch userContent.css
CSS 示例:
@-moz-document url-prefix("about:reader") {
body.dark {
color: salmon !important;
background-color: black !important;
}
body.light {
color: #222 !important;
background-color: #EEE !important;
}
body.sepia {
color: #5B4636 !important;
background-color: #F4ECD8 !important;
}
body.serif {
font-family: serif !important;
}
body.sans-serif {
font-family: sans-serif !important;
}
}
参见 this Reference进一步的解释。
关于css - 如何编辑 Firefox 阅读器 View 的 CSS/样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52033767/