Custom colors for buttons or counts


#1

In the documentation it says the color for buttons or for count bubbles (such as on a Sidebar) can be set to one of the following values: “success”, “danger”, “primary”, “secondary”. But is there an easy way to set them to another color that isn’t one of those four pre-defined colors? In my case, I’m doing a count of associated “orange sheets”, so I would like to make the countColor of my sidebar item to be an orange color to make that visual connection. I tried using a hex code like below, but it didn’t work.

countColor: "#FFAA00"

I also tried defining a css rule

.dhx_navbar-count--color_orange { background-color: #FFAA00; color: white; }

and using

countColor: "orange"

But that also didn’t work. Is there a way to break out of the 4-color limitation for buttons and count bubbles?


#2

Unfortunaetly currently only the suggested four variants are supported.
I’ve sent your report to the dev team, so the probable solution may appear in the future updates.


#3

As a workaround you may try to redefine the css class of these predefined colors. Like:

.dhx_navbar-count--color_danger{
background-color:#FFAA00
}

#4

Thank you for that workaround. I may be able to use that somewhere else, but in the particular situation I was working on, I’m already using the existing colors elsewhere on the page and was looking to use an additional specified color. I can make do with the default colors for now and hope for a full solution in the future.

It doesn’t seem like it should be too difficult to parameterize the existing code a bit further to allow custom names to refer to manual CSS classes similar to the redefined class above. But as a developer, I know that difficulty and priority are two entirely different things.


#5

I understand.
Anyway, as I’ve mentioned before, that problem is confirmed. We’ll try to extend this functionality in the future udpates.
Thank you for your report.