覆盖自动生成的颜色变量的值

从 v2.3.3 版本(9 月初发布)开始,您现在可以在远程主题中覆盖我们自动生成的 SASS 颜色变量(如 $primary-low$primary-medium 等)(目前尚无法通过管理界面直接操作)。

要覆盖其中一种颜色,您需要将其添加到主题 about.json 文件的 color_scheme 部分。完成后,您可以在 /admin/customize/colors 的颜色方案中看到该覆盖项。

"color_schemes": {
    "My_colors": {
      "primary": "000000",
      "primary-high": "333333",
      "primary-medium": "666666",
      "primary-low-mid": "999999",
      "primary-low": "cccccc"
    }
  }

我们所有的颜色转换规则均列在 color_transformations.scss 中。您也可以在 https://theme-creator.discourse.org/styleguide/atoms/colors 上预览默认浅色主题中生成的颜色。

如需了解更多关于远程主题的信息,请访问 Structure of themes and theme componentshttps://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648。

32 个赞