Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Better support for hookable menubar colors #14944
This makes it easier for themes such as Shoreditch to adjust menubar colors conditionally so as not to override user settings.
Only base menu color could be changed via hook.
Base menu color, highlight color, text color, etc can all be changed via hook.
This also includes some general improvements to CRM_Utils_Color, making it easier to work with color settings. E.g. you can now set the menubar color to "green" and it will automatically be converted to the correct hex value. Tests included.
This looks good to merge.
Did an r-run on both Drupal and WP. With and Without Shoreditch. Shoreditch looks to be able to override any menu color changes.
Without Shoreditch it works as expected.
The only concern is if a user attempts to change the menu color when an extension is overriding it they may be driven mad when it does not work as there is no indication that changing is not possible.
Can we add a documentation task on this?
So this PR is aimed at avoiding that kind of user frustration so that themes can check settings before overriding colors rather than just clobbering them with css rules, but the theme has to implement it in a conditional way. I agree to writing some documentation about the correct way to implement the hook so that user preferences are respected.