Since the color module uses array_search() to detect the default theme colors, it is case sensitive. This means that if the default color definition is not in the same case as the CSS file it is extrapolated instead of being replaced. Which means that any color you provide as link color, will not be rendered as entered because of the extrapolation.

This can be tested by enabling the color module and changing Bartik to use the firehouse colors instead of default. The link color according to firehouse should be #d6121f, but the actual color is #d61111.

Above effect occurs because the default definition in Bartik's color.inc contains an uppercased value:

  // Pre-defined color schemes.
  'schemes' => [
    'default' => [
      'title' => t('Blue Lagoon (default)'),
      'colors' => [
        'top' => '#055a8e',
        'bottom' => '#1d84c3',
        'bg' => '#ffffff',
        'sidebar' => '#f6f6f2',
        'sidebarborders' => '#f9f9f9',
        'footer' => '#292929',
        'titleslogan' => '#fffeff',
        'text' => '#3b3b3b',
        'link' => '#0071B3', // <--- There is an uppercase B here.
      ],
    ],

Changing the value to lowercase resolves the issue and guarantees the link color is rendered as entered.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Neograph734 created an issue. See original summary.

Neograph734’s picture

Status: Active » Needs review
FileSize
511 bytes
cilefen’s picture

Tim.Jongsma’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, works as expected!

alexpott’s picture

This was broken by #1360790: CSS coding standards: Recommend lowercase not UPPERCASE hex colors.

There's part of me that ponders if we should harden the color module to normalise these colours but the problem is this needs to match what is used in the module's css. This is where the stylelint patches make a difference because all css will use the standard lowercase. Yay.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Given the stylelint patches forcing everything to lower case and the fact everything is lowercase here I think we're good.

Committed and pushed 0e56417299 to 8.6.x and b724598670 to 8.5.x. Thanks!

  • alexpott committed 0e56417 on 8.6.x
    Issue #2942293 by Neograph734: Uppercase letter in Bartik's color.inc...

  • alexpott committed b724598 on 8.5.x
    Issue #2942293 by Neograph734: Uppercase letter in Bartik's color.inc...
xjm’s picture

This issue should not have been committed to 8.5.x yet as we are in a commit freeze. It's a tiny, fairly harmless thing so I am not reverting it, but please take note of this for other issues.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.