Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Again, thanks for a great theme.
I have been looking around and as yet have not found a reference for AT. I would like to add additional color setting support over and above those that exist in AT 8.x, say for instance setting the background colors of the regions. My client needs to white label a product with different theme colors for different clients. Any advice greatly appreciated.
Comments
Comment #2
Jeff Burnz CreditAttribution: Jeff Burnz commentedWell, it's using the standard Color module system in Drupal.
So you have to declare color variables in:
YourTheme/color/color.inc
The most important colors are in the "default" schema. These must be unique in that schema - you can't have two colors the same in default. Make sure each schema has an entry for the new field (array item).
You take those default color hex values and use them in:
YourTheme/styles/css/components/color.css
Or is using SASS:
YourTheme/styles/uikit/components/partials/theme/_color.scss
Now - one VERY important point I need to make. AT makes heavy use of the "shift" feature in color module - by using neutral greys only we can get pretty good shifts relative to a base color selected by the user.
This is how i get away with only having a few declared colors in our basic schemas yet nearly everything will "shift" when you select a different color scheme.
If you need very specific colors, then yes you need to declare new variables and hex values in color.inc and map those precisely to elements in color.css. You need to be very precise, for example do not use uppercase hex in the color.inc and then lowercase in the color.css file.
Comment #3
PatrickMichael CreditAttribution: PatrickMichael commentedGreat, thanks for the direction.
Comment #4
Jeff Burnz CreditAttribution: Jeff Burnz commentedYou're welcome!
Comment #6
PatrickMichael CreditAttribution: PatrickMichael commentedHi, if i may re-open this, i am a bit stumped. I have added additional field and a gradient as per instruction above and from various tutorials. I have created two test blocks to test, these can be seen at dev4.digitalsolace.co.za. Technically all is working as when saving color settings, the test content is having styles applied to it from color.css in sites/default/files and the color changes when selecting different values.
Is also showing correct data.
However it is seems that the color module _color_shift is being applied as the resultant hex output is not as per the settings, and this is possibly working as expected.
However i do not want my custom fields to be influenced by color shift. I need to be able to add additional color fields and gradients and not have these altered. Is this possible, and how would i go about doing that?
Additional to this I have 2 new questions if i may.
How would i add an additional gradients?
The gradients in my design use rgba values as per below, is this possible to achieve with AT and color module?
I have been hitting my head with this and any help would be greatly appreciated.
Added to color.inc
And added to color.css (this is just to test, gradient is not rgba)