css - 如何编辑 Firefox 阅读器 View 的 CSS/样式

标签 css firefox styling firefox-reader-view

我想在 Firefox 阅读器 View 样式中包含我选择的字体。

请告诉我 Firefox 是使用本地 CSS 文件进行样式设置还是位于其他位置?

此外,Firefox 用于阅读器 View 的 CSS 文件名是什么,我如何编辑它。

提前致谢!

最佳答案

您可以在路径下找到“Firefox 阅读器 View ”的 CSS 文件 cd /home/$USER/.mozilla/firefox/<PROFILE_FOLDER>/chrome/userContent.css 仅当您已经设置好它时:

  1. 在您的 Firefox URL 搜索栏中输入:about:support .
  2. 通过选择 Show Folder 打开您的个人资料文件夹 .
  3. 在您的个人资料文件夹 中创建一个名为chrome 的新文件夹.
  4. 导航到 chrome并创建一个名为 userContent.css 的新纯文本文件
  5. 编辑 userContent.css根据您的 CSS 偏好。
  6. 在新的 Firefox 配置文件中,从 Firefox 69 开始,您还必须启用 toolkit.legacyUserProfileCustomizations.stylesheetsabout: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/

相关文章:

javascript - 将当前选项卡的 URL 发送到插件内容

javascript - 在 Firefox 中打印 iframe 时如何打开打印预览对话框?

android - 如何在全局范围内为我的所有 Activity 重新定义工具栏样式?

css - Silverlight 中的常规样式和 CSS 支持

javascript - 使用 HTML/CSS 在 R/Shiny 中并排放置传单控件而不是垂直堆叠

html - 最小高度最小宽度不适用于 Cordova

html - 如何使用 CSS 使边距单独作用于内联元素?

firefox - 如何在firefox检查器中找到元素的xpath

react-native - React Native按比例缩放方形图像

html - Bourbon Neat——响应式网格