高亮颜色

Hi,
I’ve been playing with the color schemes. I’m trying to set the highlight color but when applied, the results are not the same colors, some kind of weird transformation is going on.
See the next image:

Is it the default behaviour?

Yes, this is the default behavior.

There is the highlight color, which is the value you set in the color scheme,

In your case it would look like:

$highlight: #1a1a1a; 

And the usage would be like:

background-color: $highlight;

And then there are three color transformations based on the $highlight and $secondary values and they are:

$highlight-low: dark-light-diff($highlight, $secondary, 70%, -80%);
$highlight-medium: dark-light-diff($highlight, $secondary, 50%, -55%);
$highlight-high: dark-light-diff($highlight, $secondary, -50%, -10%);  

And these are used like so:

.overridden {
      background-color: $highlight-medium;
}

这非常有帮助。

我有一位客户认为他们不需要这些颜色的各种变体(我怀疑他们错了)。我该如何重写这些高亮部分,使其在主题中不发生变化?我能否在 common.scss 中全局覆盖它们?

你可以在这里找到所有颜色:color_transformations.scss

主题的 about.json 文件中包含一个颜色部分。如果你想覆盖上述文件中的任何颜色,只需在该部分中定义新值即可,示例如下:

{
  "name": "My theme",
  "about_url": null,
  "license_url": null,
  "assets": {},
  "color_schemes": {
    "My Colour Scheme": {
      "highlight-low": "FF0000",
      "highlight-medium": "FF0000",
      "highlight-high": "FF0000"
    }
  }
}