Developer forum

Forum » Rapido » Extending Brand Colors to more than 5

Extending Brand Colors to more than 5

Lara Arsénio
Reply

Hello. I needed to extend the brand colours collection, to set the background colour of multiple paragraph containers.

After setting all the necessary fields in Item Types, I got to extend the pallet and apply the colours. Everything worked well, the generated markup automatically included the classes relative to the new colours I added. But the background-colour for those classes would stay white in the frontend.

After some digging, I realized that DW is automatically creating the new variables and classes, in the variables_[i].auto.less files.

But the related mixins, that are required for the colors to work, are hardcoded in the template .less files

For each new color created in the backend, this change needs to be manually performed. Can this also be automatically written by the system in the generated less files, so it becomes trully configurable and automated? 

_helpers.less

.u-brand-color-six {
    .brand-color-mixin(@layout-brand-color-six);
}

_images.less

.image-filter--brand-color-six{
  .image-filter--brand-color-six-mixin();
}
.image-filter--brand-color-six-mixin() when not (@layout-brand-color-six = none) {
  background-color: fade(@layout-brand-color-six, 30%);
}

 

 


Replies

 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply

Hi Lara

Great question. The reason for the limit of 5 colors is to help keep the design as clean, and easy as possible. But in the next release of Rapido, we have replaced the old color selector and dropdowns with the new Color swatch selector item type field, everywhere where a color can be selected (See attachment). 

The new Color swatch item type field has 5 brand colors + 5 shades of each brand color, 5 neutral colors and the posibility to either use a custom color or setting the color to transparent.

It should be possible to extend the color swatch to support more than 5 colors, but I will have to investigate if that correct. If it is, we can prepare the Less files to fx. support 10 colors if they exist.

Is this a need you have solely for the image filters? Then I think the new color swatch selector will solve your needs, as it does support the posibility to select a custom color.

 

Best regards
Karsten Thuen

Skærmbillede_2019-02-07_kl._12.29.49.png
 
Lara Arsénio
Reply

Hello. The need to extend the color swatch in this specific case is for defining the background in paragraphs, not on image filters (although they are both using the brand colors fields).

As the pages tend to have more than 5 paragraphs and multiple color variations, depending on context. The possibility to choose a color from a color-swatch resolves the problem indeed.

I think it would be great to add the mixins above automatically just to give the customer the choice if they want to save more "common usage" colors.

 

Best Regards 

 
Karsten Thuen Dynamicweb Employee
Karsten Thuen
Reply

Hi Lara

Thank you for the clarification. I can confirm that we have a perfect solution for this scenario, using the new color swatches, in the next Rapido release. 

 

Best regards
Karsten Thuen

 

You must be logged in to post in the forum