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.
Comment | File | Size | Author |
---|---|---|---|
#2 | bartik_incorrect_link_colors-2942293-2.patch | 511 bytes | Neograph734 |
Comments
Comment #2
Neograph734Comment #3
cilefen CreditAttribution: cilefen at Institute for Advanced Study commentedComment #4
Tim.Jongsma CreditAttribution: Tim.Jongsma commentedThanks, works as expected!
Comment #5
alexpottThis 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.
Comment #6
alexpottGiven 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!
Comment #9
xjmThis 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.